diff options
Diffstat (limited to 'include')
41 files changed, 514 insertions, 142 deletions
diff --git a/include/asm-arm/hardware/locomo.h b/include/asm-arm/hardware/locomo.h index 5f10048ec54e..22dfb1737768 100644 --- a/include/asm-arm/hardware/locomo.h +++ b/include/asm-arm/hardware/locomo.h | |||
@@ -111,6 +111,8 @@ | |||
111 | #define LOCOMO_ALS 0x00 /* Adjust light cycle */ | 111 | #define LOCOMO_ALS 0x00 /* Adjust light cycle */ |
112 | #define LOCOMO_ALD 0x04 /* Adjust light duty */ | 112 | #define LOCOMO_ALD 0x04 /* Adjust light duty */ |
113 | 113 | ||
114 | #define LOCOMO_ALC_EN 0x8000 | ||
115 | |||
114 | /* Backlight controller: TFT signal */ | 116 | /* Backlight controller: TFT signal */ |
115 | #define LOCOMO_BACKLIGHT 0x38 | 117 | #define LOCOMO_BACKLIGHT 0x38 |
116 | #define LOCOMO_TC 0x00 /* TFT control signal */ | 118 | #define LOCOMO_TC 0x00 /* TFT control signal */ |
@@ -203,4 +205,7 @@ void locomo_gpio_write(struct locomo_dev *ldev, unsigned int bits, unsigned int | |||
203 | /* M62332 control function */ | 205 | /* M62332 control function */ |
204 | void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel); | 206 | void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel); |
205 | 207 | ||
208 | /* Frontlight control */ | ||
209 | void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf); | ||
210 | |||
206 | #endif | 211 | #endif |
diff --git a/include/asm-i386/delay.h b/include/asm-i386/delay.h index 456db8501c09..b1c7650dc7b9 100644 --- a/include/asm-i386/delay.h +++ b/include/asm-i386/delay.h | |||
@@ -23,4 +23,6 @@ extern void __delay(unsigned long loops); | |||
23 | ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ | 23 | ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ |
24 | __ndelay(n)) | 24 | __ndelay(n)) |
25 | 25 | ||
26 | void use_tsc_delay(void); | ||
27 | |||
26 | #endif /* defined(_I386_DELAY_H) */ | 28 | #endif /* defined(_I386_DELAY_H) */ |
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h index 96d0828ce096..d18cdb9fc9a6 100644 --- a/include/asm-i386/kdebug.h +++ b/include/asm-i386/kdebug.h | |||
@@ -19,6 +19,8 @@ struct die_args { | |||
19 | 19 | ||
20 | extern int register_die_notifier(struct notifier_block *); | 20 | extern int register_die_notifier(struct notifier_block *); |
21 | extern int unregister_die_notifier(struct notifier_block *); | 21 | extern int unregister_die_notifier(struct notifier_block *); |
22 | extern int register_page_fault_notifier(struct notifier_block *); | ||
23 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
22 | extern struct atomic_notifier_head i386die_chain; | 24 | extern struct atomic_notifier_head i386die_chain; |
23 | 25 | ||
24 | 26 | ||
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h index 57d157c5cf89..0730a20f6db8 100644 --- a/include/asm-i386/kprobes.h +++ b/include/asm-i386/kprobes.h | |||
@@ -44,6 +44,7 @@ typedef u8 kprobe_opcode_t; | |||
44 | 44 | ||
45 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 45 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
46 | #define ARCH_SUPPORTS_KRETPROBES | 46 | #define ARCH_SUPPORTS_KRETPROBES |
47 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
47 | 48 | ||
48 | void arch_remove_kprobe(struct kprobe *p); | 49 | void arch_remove_kprobe(struct kprobe *p); |
49 | void kretprobe_trampoline(void); | 50 | void kretprobe_trampoline(void); |
diff --git a/include/asm-i386/mach-default/mach_timer.h b/include/asm-i386/mach-default/mach_timer.h index 4b9703bb0288..807992fd4171 100644 --- a/include/asm-i386/mach-default/mach_timer.h +++ b/include/asm-i386/mach-default/mach_timer.h | |||
@@ -15,7 +15,9 @@ | |||
15 | #ifndef _MACH_TIMER_H | 15 | #ifndef _MACH_TIMER_H |
16 | #define _MACH_TIMER_H | 16 | #define _MACH_TIMER_H |
17 | 17 | ||
18 | #define CALIBRATE_LATCH (5 * LATCH) | 18 | #define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ |
19 | #define CALIBRATE_LATCH \ | ||
20 | ((CLOCK_TICK_RATE * CALIBRATE_TIME_MSEC + 1000/2)/1000) | ||
19 | 21 | ||
20 | static inline void mach_prepare_counter(void) | 22 | static inline void mach_prepare_counter(void) |
21 | { | 23 | { |
diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h index 1cce2b924a80..94268399170d 100644 --- a/include/asm-i386/mach-summit/mach_mpparse.h +++ b/include/asm-i386/mach-summit/mach_mpparse.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_MACH_MPPARSE_H | 2 | #define __ASM_MACH_MPPARSE_H |
3 | 3 | ||
4 | #include <mach_apic.h> | 4 | #include <mach_apic.h> |
5 | #include <asm/tsc.h> | ||
5 | 6 | ||
6 | extern int use_cyclone; | 7 | extern int use_cyclone; |
7 | 8 | ||
@@ -29,6 +30,7 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | |||
29 | (!strncmp(productid, "VIGIL SMP", 9) | 30 | (!strncmp(productid, "VIGIL SMP", 9) |
30 | || !strncmp(productid, "EXA", 3) | 31 | || !strncmp(productid, "EXA", 3) |
31 | || !strncmp(productid, "RUTHLESS SMP", 12))){ | 32 | || !strncmp(productid, "RUTHLESS SMP", 12))){ |
33 | mark_tsc_unstable(); | ||
32 | use_cyclone = 1; /*enable cyclone-timer*/ | 34 | use_cyclone = 1; /*enable cyclone-timer*/ |
33 | setup_summit(); | 35 | setup_summit(); |
34 | return 1; | 36 | return 1; |
@@ -42,6 +44,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
42 | if (!strncmp(oem_id, "IBM", 3) && | 44 | if (!strncmp(oem_id, "IBM", 3) && |
43 | (!strncmp(oem_table_id, "SERVIGIL", 8) | 45 | (!strncmp(oem_table_id, "SERVIGIL", 8) |
44 | || !strncmp(oem_table_id, "EXA", 3))){ | 46 | || !strncmp(oem_table_id, "EXA", 3))){ |
47 | mark_tsc_unstable(); | ||
45 | use_cyclone = 1; /*enable cyclone-timer*/ | 48 | use_cyclone = 1; /*enable cyclone-timer*/ |
46 | setup_summit(); | 49 | setup_summit(); |
47 | return 1; | 50 | return 1; |
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h index aed16437479d..d0ebd05f8516 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-i386/timer.h | |||
@@ -3,68 +3,11 @@ | |||
3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
5 | 5 | ||
6 | /** | ||
7 | * struct timer_ops - used to define a timer source | ||
8 | * | ||
9 | * @name: name of the timer. | ||
10 | * @init: Probes and initializes the timer. Takes clock= override | ||
11 | * string as an argument. Returns 0 on success, anything else | ||
12 | * on failure. | ||
13 | * @mark_offset: called by the timer interrupt. | ||
14 | * @get_offset: called by gettimeofday(). Returns the number of microseconds | ||
15 | * since the last timer interupt. | ||
16 | * @monotonic_clock: returns the number of nanoseconds since the init of the | ||
17 | * timer. | ||
18 | * @delay: delays this many clock cycles. | ||
19 | */ | ||
20 | struct timer_opts { | ||
21 | char* name; | ||
22 | void (*mark_offset)(void); | ||
23 | unsigned long (*get_offset)(void); | ||
24 | unsigned long long (*monotonic_clock)(void); | ||
25 | void (*delay)(unsigned long); | ||
26 | unsigned long (*read_timer)(void); | ||
27 | int (*suspend)(pm_message_t state); | ||
28 | int (*resume)(void); | ||
29 | }; | ||
30 | |||
31 | struct init_timer_opts { | ||
32 | int (*init)(char *override); | ||
33 | struct timer_opts *opts; | ||
34 | }; | ||
35 | |||
36 | #define TICK_SIZE (tick_nsec / 1000) | 6 | #define TICK_SIZE (tick_nsec / 1000) |
37 | |||
38 | extern struct timer_opts* __init select_timer(void); | ||
39 | extern void clock_fallback(void); | ||
40 | void setup_pit_timer(void); | 7 | void setup_pit_timer(void); |
41 | |||
42 | /* Modifiers for buggy PIT handling */ | 8 | /* Modifiers for buggy PIT handling */ |
43 | |||
44 | extern int pit_latch_buggy; | 9 | extern int pit_latch_buggy; |
45 | |||
46 | extern struct timer_opts *cur_timer; | ||
47 | extern int timer_ack; | 10 | extern int timer_ack; |
48 | |||
49 | /* list of externed timers */ | ||
50 | extern struct timer_opts timer_none; | ||
51 | extern struct timer_opts timer_pit; | ||
52 | extern struct init_timer_opts timer_pit_init; | ||
53 | extern struct init_timer_opts timer_tsc_init; | ||
54 | #ifdef CONFIG_X86_CYCLONE_TIMER | ||
55 | extern struct init_timer_opts timer_cyclone_init; | ||
56 | #endif | ||
57 | |||
58 | extern unsigned long calibrate_tsc(void); | ||
59 | extern unsigned long read_timer_tsc(void); | ||
60 | extern void init_cpu_khz(void); | ||
61 | extern int recalibrate_cpu_khz(void); | 11 | extern int recalibrate_cpu_khz(void); |
62 | #ifdef CONFIG_HPET_TIMER | ||
63 | extern struct init_timer_opts timer_hpet_init; | ||
64 | extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); | ||
65 | #endif | ||
66 | 12 | ||
67 | #ifdef CONFIG_X86_PM_TIMER | ||
68 | extern struct init_timer_opts timer_pmtmr_init; | ||
69 | #endif | ||
70 | #endif | 13 | #endif |
diff --git a/include/asm-i386/timex.h b/include/asm-i386/timex.h index d434984303ca..3666044409f0 100644 --- a/include/asm-i386/timex.h +++ b/include/asm-i386/timex.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define _ASMi386_TIMEX_H | 7 | #define _ASMi386_TIMEX_H |
8 | 8 | ||
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | #include <asm/tsc.h> | ||
10 | 11 | ||
11 | #ifdef CONFIG_X86_ELAN | 12 | #ifdef CONFIG_X86_ELAN |
12 | # define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */ | 13 | # define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */ |
@@ -15,39 +16,6 @@ | |||
15 | #endif | 16 | #endif |
16 | 17 | ||
17 | 18 | ||
18 | /* | ||
19 | * Standard way to access the cycle counter on i586+ CPUs. | ||
20 | * Currently only used on SMP. | ||
21 | * | ||
22 | * If you really have a SMP machine with i486 chips or older, | ||
23 | * compile for that, and this will just always return zero. | ||
24 | * That's ok, it just means that the nicer scheduling heuristics | ||
25 | * won't work for you. | ||
26 | * | ||
27 | * We only use the low 32 bits, and we'd simply better make sure | ||
28 | * that we reschedule before that wraps. Scheduling at least every | ||
29 | * four billion cycles just basically sounds like a good idea, | ||
30 | * regardless of how fast the machine is. | ||
31 | */ | ||
32 | typedef unsigned long long cycles_t; | ||
33 | |||
34 | static inline cycles_t get_cycles (void) | ||
35 | { | ||
36 | unsigned long long ret=0; | ||
37 | |||
38 | #ifndef CONFIG_X86_TSC | ||
39 | if (!cpu_has_tsc) | ||
40 | return 0; | ||
41 | #endif | ||
42 | |||
43 | #if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC) | ||
44 | rdtscll(ret); | ||
45 | #endif | ||
46 | return ret; | ||
47 | } | ||
48 | |||
49 | extern unsigned int cpu_khz; | ||
50 | |||
51 | extern int read_current_timer(unsigned long *timer_value); | 19 | extern int read_current_timer(unsigned long *timer_value); |
52 | #define ARCH_HAS_READ_CURRENT_TIMER 1 | 20 | #define ARCH_HAS_READ_CURRENT_TIMER 1 |
53 | 21 | ||
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h new file mode 100644 index 000000000000..97b828ce31e0 --- /dev/null +++ b/include/asm-i386/tsc.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * linux/include/asm-i386/tsc.h | ||
3 | * | ||
4 | * i386 TSC related functions | ||
5 | */ | ||
6 | #ifndef _ASM_i386_TSC_H | ||
7 | #define _ASM_i386_TSC_H | ||
8 | |||
9 | #include <linux/config.h> | ||
10 | #include <asm/processor.h> | ||
11 | |||
12 | /* | ||
13 | * Standard way to access the cycle counter on i586+ CPUs. | ||
14 | * Currently only used on SMP. | ||
15 | * | ||
16 | * If you really have a SMP machine with i486 chips or older, | ||
17 | * compile for that, and this will just always return zero. | ||
18 | * That's ok, it just means that the nicer scheduling heuristics | ||
19 | * won't work for you. | ||
20 | * | ||
21 | * We only use the low 32 bits, and we'd simply better make sure | ||
22 | * that we reschedule before that wraps. Scheduling at least every | ||
23 | * four billion cycles just basically sounds like a good idea, | ||
24 | * regardless of how fast the machine is. | ||
25 | */ | ||
26 | typedef unsigned long long cycles_t; | ||
27 | |||
28 | extern unsigned int cpu_khz; | ||
29 | extern unsigned int tsc_khz; | ||
30 | |||
31 | static inline cycles_t get_cycles(void) | ||
32 | { | ||
33 | unsigned long long ret = 0; | ||
34 | |||
35 | #ifndef CONFIG_X86_TSC | ||
36 | if (!cpu_has_tsc) | ||
37 | return 0; | ||
38 | #endif | ||
39 | |||
40 | #if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC) | ||
41 | rdtscll(ret); | ||
42 | #endif | ||
43 | return ret; | ||
44 | } | ||
45 | |||
46 | extern void tsc_init(void); | ||
47 | extern void mark_tsc_unstable(void); | ||
48 | |||
49 | #endif | ||
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index c195a9ad1255..aed7142f9e4a 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h | |||
@@ -40,6 +40,8 @@ struct die_args { | |||
40 | 40 | ||
41 | extern int register_die_notifier(struct notifier_block *); | 41 | extern int register_die_notifier(struct notifier_block *); |
42 | extern int unregister_die_notifier(struct notifier_block *); | 42 | extern int unregister_die_notifier(struct notifier_block *); |
43 | extern int register_page_fault_notifier(struct notifier_block *); | ||
44 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
43 | extern struct atomic_notifier_head ia64die_chain; | 45 | extern struct atomic_notifier_head ia64die_chain; |
44 | 46 | ||
45 | enum die_val { | 47 | enum die_val { |
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 8c0fc227f0fb..2418a787c405 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
@@ -82,6 +82,7 @@ struct kprobe_ctlblk { | |||
82 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 82 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
83 | 83 | ||
84 | #define ARCH_SUPPORTS_KRETPROBES | 84 | #define ARCH_SUPPORTS_KRETPROBES |
85 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | ||
85 | 86 | ||
86 | #define SLOT0_OPCODE_SHIFT (37) | 87 | #define SLOT0_OPCODE_SHIFT (37) |
87 | #define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) | 88 | #define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) |
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h index c01786ab5fa6..532bfee934f4 100644 --- a/include/asm-powerpc/kdebug.h +++ b/include/asm-powerpc/kdebug.h | |||
@@ -18,6 +18,8 @@ struct die_args { | |||
18 | 18 | ||
19 | extern int register_die_notifier(struct notifier_block *); | 19 | extern int register_die_notifier(struct notifier_block *); |
20 | extern int unregister_die_notifier(struct notifier_block *); | 20 | extern int unregister_die_notifier(struct notifier_block *); |
21 | extern int register_page_fault_notifier(struct notifier_block *); | ||
22 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
21 | extern struct atomic_notifier_head powerpc_die_chain; | 23 | extern struct atomic_notifier_head powerpc_die_chain; |
22 | 24 | ||
23 | /* Grossly misnamed. */ | 25 | /* Grossly misnamed. */ |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index f466bc804f41..2d0af52c823d 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -50,6 +50,8 @@ typedef unsigned int kprobe_opcode_t; | |||
50 | IS_TWI(instr) || IS_TDI(instr)) | 50 | IS_TWI(instr) || IS_TDI(instr)) |
51 | 51 | ||
52 | #define ARCH_SUPPORTS_KRETPROBES | 52 | #define ARCH_SUPPORTS_KRETPROBES |
53 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | ||
54 | |||
53 | void kretprobe_trampoline(void); | 55 | void kretprobe_trampoline(void); |
54 | extern void arch_remove_kprobe(struct kprobe *p); | 56 | extern void arch_remove_kprobe(struct kprobe *p); |
55 | 57 | ||
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index 4040d127ac3e..11251bdd00cb 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h | |||
@@ -17,6 +17,8 @@ struct die_args { | |||
17 | 17 | ||
18 | extern int register_die_notifier(struct notifier_block *); | 18 | extern int register_die_notifier(struct notifier_block *); |
19 | extern int unregister_die_notifier(struct notifier_block *); | 19 | extern int unregister_die_notifier(struct notifier_block *); |
20 | extern int register_page_fault_notifier(struct notifier_block *); | ||
21 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
20 | extern struct atomic_notifier_head sparc64die_chain; | 22 | extern struct atomic_notifier_head sparc64die_chain; |
21 | 23 | ||
22 | extern void bad_trap(struct pt_regs *, long); | 24 | extern void bad_trap(struct pt_regs *, long); |
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index e9bb26f770ed..15065af566c2 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -12,6 +12,7 @@ typedef u32 kprobe_opcode_t; | |||
12 | 12 | ||
13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
14 | #define arch_remove_kprobe(p) do {} while (0) | 14 | #define arch_remove_kprobe(p) do {} while (0) |
15 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
15 | 16 | ||
16 | /* Architecture specific copy of original instruction*/ | 17 | /* Architecture specific copy of original instruction*/ |
17 | struct arch_specific_insn { | 18 | struct arch_specific_insn { |
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index cf795631d9b4..cd52c7f33bca 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h | |||
@@ -15,6 +15,8 @@ struct die_args { | |||
15 | 15 | ||
16 | extern int register_die_notifier(struct notifier_block *); | 16 | extern int register_die_notifier(struct notifier_block *); |
17 | extern int unregister_die_notifier(struct notifier_block *); | 17 | extern int unregister_die_notifier(struct notifier_block *); |
18 | extern int register_page_fault_notifier(struct notifier_block *); | ||
19 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
18 | extern struct atomic_notifier_head die_chain; | 20 | extern struct atomic_notifier_head die_chain; |
19 | 21 | ||
20 | /* Grossly misnamed. */ | 22 | /* Grossly misnamed. */ |
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h index 98a1e95ddb98..d36febd9bb18 100644 --- a/include/asm-x86_64/kprobes.h +++ b/include/asm-x86_64/kprobes.h | |||
@@ -43,6 +43,7 @@ typedef u8 kprobe_opcode_t; | |||
43 | 43 | ||
44 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 44 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
45 | #define ARCH_SUPPORTS_KRETPROBES | 45 | #define ARCH_SUPPORTS_KRETPROBES |
46 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | ||
46 | 47 | ||
47 | void kretprobe_trampoline(void); | 48 | void kretprobe_trampoline(void); |
48 | extern void arch_remove_kprobe(struct kprobe *p); | 49 | extern void arch_remove_kprobe(struct kprobe *p); |
diff --git a/include/keys/user-type.h b/include/keys/user-type.h index a3dae1803f45..c37c34275a44 100644 --- a/include/keys/user-type.h +++ b/include/keys/user-type.h | |||
@@ -37,6 +37,7 @@ extern struct key_type key_type_user; | |||
37 | extern int user_instantiate(struct key *key, const void *data, size_t datalen); | 37 | extern int user_instantiate(struct key *key, const void *data, size_t datalen); |
38 | extern int user_update(struct key *key, const void *data, size_t datalen); | 38 | extern int user_update(struct key *key, const void *data, size_t datalen); |
39 | extern int user_match(const struct key *key, const void *criterion); | 39 | extern int user_match(const struct key *key, const void *criterion); |
40 | extern void user_revoke(struct key *key); | ||
40 | extern void user_destroy(struct key *key); | 41 | extern void user_destroy(struct key *key); |
41 | extern void user_describe(const struct key *user, struct seq_file *m); | 42 | extern void user_describe(const struct key *user, struct seq_file *m); |
42 | extern long user_read(const struct key *key, | 43 | extern long user_read(const struct key *key, |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h new file mode 100644 index 000000000000..d852024ed095 --- /dev/null +++ b/include/linux/clocksource.h | |||
@@ -0,0 +1,185 @@ | |||
1 | /* linux/include/linux/clocksource.h | ||
2 | * | ||
3 | * This file contains the structure definitions for clocksources. | ||
4 | * | ||
5 | * If you are not a clocksource, or timekeeping code, you should | ||
6 | * not be including this file! | ||
7 | */ | ||
8 | #ifndef _LINUX_CLOCKSOURCE_H | ||
9 | #define _LINUX_CLOCKSOURCE_H | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/timex.h> | ||
13 | #include <linux/time.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <asm/div64.h> | ||
16 | #include <asm/io.h> | ||
17 | |||
18 | /* clocksource cycle base type */ | ||
19 | typedef u64 cycle_t; | ||
20 | |||
21 | /** | ||
22 | * struct clocksource - hardware abstraction for a free running counter | ||
23 | * Provides mostly state-free accessors to the underlying hardware. | ||
24 | * | ||
25 | * @name: ptr to clocksource name | ||
26 | * @list: list head for registration | ||
27 | * @rating: rating value for selection (higher is better) | ||
28 | * To avoid rating inflation the following | ||
29 | * list should give you a guide as to how | ||
30 | * to assign your clocksource a rating | ||
31 | * 1-99: Unfit for real use | ||
32 | * Only available for bootup and testing purposes. | ||
33 | * 100-199: Base level usability. | ||
34 | * Functional for real use, but not desired. | ||
35 | * 200-299: Good. | ||
36 | * A correct and usable clocksource. | ||
37 | * 300-399: Desired. | ||
38 | * A reasonably fast and accurate clocksource. | ||
39 | * 400-499: Perfect | ||
40 | * The ideal clocksource. A must-use where | ||
41 | * available. | ||
42 | * @read: returns a cycle value | ||
43 | * @mask: bitmask for two's complement | ||
44 | * subtraction of non 64 bit counters | ||
45 | * @mult: cycle to nanosecond multiplier | ||
46 | * @shift: cycle to nanosecond divisor (power of two) | ||
47 | * @update_callback: called when safe to alter clocksource values | ||
48 | * @is_continuous: defines if clocksource is free-running. | ||
49 | * @cycle_interval: Used internally by timekeeping core, please ignore. | ||
50 | * @xtime_interval: Used internally by timekeeping core, please ignore. | ||
51 | */ | ||
52 | struct clocksource { | ||
53 | char *name; | ||
54 | struct list_head list; | ||
55 | int rating; | ||
56 | cycle_t (*read)(void); | ||
57 | cycle_t mask; | ||
58 | u32 mult; | ||
59 | u32 shift; | ||
60 | int (*update_callback)(void); | ||
61 | int is_continuous; | ||
62 | |||
63 | /* timekeeping specific data, ignore */ | ||
64 | cycle_t cycle_last, cycle_interval; | ||
65 | u64 xtime_nsec, xtime_interval; | ||
66 | s64 error; | ||
67 | }; | ||
68 | |||
69 | /* simplify initialization of mask field */ | ||
70 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) | ||
71 | |||
72 | /** | ||
73 | * clocksource_khz2mult - calculates mult from khz and shift | ||
74 | * @khz: Clocksource frequency in KHz | ||
75 | * @shift_constant: Clocksource shift factor | ||
76 | * | ||
77 | * Helper functions that converts a khz counter frequency to a timsource | ||
78 | * multiplier, given the clocksource shift value | ||
79 | */ | ||
80 | static inline u32 clocksource_khz2mult(u32 khz, u32 shift_constant) | ||
81 | { | ||
82 | /* khz = cyc/(Million ns) | ||
83 | * mult/2^shift = ns/cyc | ||
84 | * mult = ns/cyc * 2^shift | ||
85 | * mult = 1Million/khz * 2^shift | ||
86 | * mult = 1000000 * 2^shift / khz | ||
87 | * mult = (1000000<<shift) / khz | ||
88 | */ | ||
89 | u64 tmp = ((u64)1000000) << shift_constant; | ||
90 | |||
91 | tmp += khz/2; /* round for do_div */ | ||
92 | do_div(tmp, khz); | ||
93 | |||
94 | return (u32)tmp; | ||
95 | } | ||
96 | |||
97 | /** | ||
98 | * clocksource_hz2mult - calculates mult from hz and shift | ||
99 | * @hz: Clocksource frequency in Hz | ||
100 | * @shift_constant: Clocksource shift factor | ||
101 | * | ||
102 | * Helper functions that converts a hz counter | ||
103 | * frequency to a timsource multiplier, given the | ||
104 | * clocksource shift value | ||
105 | */ | ||
106 | static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) | ||
107 | { | ||
108 | /* hz = cyc/(Billion ns) | ||
109 | * mult/2^shift = ns/cyc | ||
110 | * mult = ns/cyc * 2^shift | ||
111 | * mult = 1Billion/hz * 2^shift | ||
112 | * mult = 1000000000 * 2^shift / hz | ||
113 | * mult = (1000000000<<shift) / hz | ||
114 | */ | ||
115 | u64 tmp = ((u64)1000000000) << shift_constant; | ||
116 | |||
117 | tmp += hz/2; /* round for do_div */ | ||
118 | do_div(tmp, hz); | ||
119 | |||
120 | return (u32)tmp; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * clocksource_read: - Access the clocksource's current cycle value | ||
125 | * @cs: pointer to clocksource being read | ||
126 | * | ||
127 | * Uses the clocksource to return the current cycle_t value | ||
128 | */ | ||
129 | static inline cycle_t clocksource_read(struct clocksource *cs) | ||
130 | { | ||
131 | return cs->read(); | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * cyc2ns - converts clocksource cycles to nanoseconds | ||
136 | * @cs: Pointer to clocksource | ||
137 | * @cycles: Cycles | ||
138 | * | ||
139 | * Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds. | ||
140 | * | ||
141 | * XXX - This could use some mult_lxl_ll() asm optimization | ||
142 | */ | ||
143 | static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles) | ||
144 | { | ||
145 | u64 ret = (u64)cycles; | ||
146 | ret = (ret * cs->mult) >> cs->shift; | ||
147 | return ret; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * clocksource_calculate_interval - Calculates a clocksource interval struct | ||
152 | * | ||
153 | * @c: Pointer to clocksource. | ||
154 | * @length_nsec: Desired interval length in nanoseconds. | ||
155 | * | ||
156 | * Calculates a fixed cycle/nsec interval for a given clocksource/adjustment | ||
157 | * pair and interval request. | ||
158 | * | ||
159 | * Unless you're the timekeeping code, you should not be using this! | ||
160 | */ | ||
161 | static inline void clocksource_calculate_interval(struct clocksource *c, | ||
162 | unsigned long length_nsec) | ||
163 | { | ||
164 | u64 tmp; | ||
165 | |||
166 | /* XXX - All of this could use a whole lot of optimization */ | ||
167 | tmp = length_nsec; | ||
168 | tmp <<= c->shift; | ||
169 | tmp += c->mult/2; | ||
170 | do_div(tmp, c->mult); | ||
171 | |||
172 | c->cycle_interval = (cycle_t)tmp; | ||
173 | if (c->cycle_interval == 0) | ||
174 | c->cycle_interval = 1; | ||
175 | |||
176 | c->xtime_interval = (u64)c->cycle_interval * c->mult; | ||
177 | } | ||
178 | |||
179 | |||
180 | /* used to install a new clocksource */ | ||
181 | int clocksource_register(struct clocksource*); | ||
182 | void clocksource_reselect(void); | ||
183 | struct clocksource* clocksource_get_next(void); | ||
184 | |||
185 | #endif /* _LINUX_CLOCKSOURCE_H */ | ||
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 89ab677cb993..917d62e41480 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -673,6 +673,11 @@ COMPATIBLE_IOCTL(CAPI_SET_FLAGS) | |||
673 | COMPATIBLE_IOCTL(CAPI_CLR_FLAGS) | 673 | COMPATIBLE_IOCTL(CAPI_CLR_FLAGS) |
674 | COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT) | 674 | COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT) |
675 | COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT) | 675 | COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT) |
676 | /* Siemens Gigaset */ | ||
677 | COMPATIBLE_IOCTL(GIGASET_REDIR) | ||
678 | COMPATIBLE_IOCTL(GIGASET_CONFIG) | ||
679 | COMPATIBLE_IOCTL(GIGASET_BRKCHARS) | ||
680 | COMPATIBLE_IOCTL(GIGASET_VERSION) | ||
676 | /* Misc. */ | 681 | /* Misc. */ |
677 | COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */ | 682 | COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */ |
678 | COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */ | 683 | COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */ |
diff --git a/include/linux/console.h b/include/linux/console.h index d0f8a8009490..3bdf2155e565 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -63,9 +63,11 @@ extern const struct consw vga_con; /* VGA text console */ | |||
63 | extern const struct consw newport_con; /* SGI Newport console */ | 63 | extern const struct consw newport_con; /* SGI Newport console */ |
64 | extern const struct consw prom_con; /* SPARC PROM console */ | 64 | extern const struct consw prom_con; /* SPARC PROM console */ |
65 | 65 | ||
66 | int con_is_bound(const struct consw *csw); | ||
67 | int register_con_driver(const struct consw *csw, int first, int last); | ||
68 | int unregister_con_driver(const struct consw *csw); | ||
66 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 69 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
67 | void give_up_console(const struct consw *sw); | 70 | void give_up_console(const struct consw *sw); |
68 | |||
69 | /* scroll */ | 71 | /* scroll */ |
70 | #define SM_UP (1) | 72 | #define SM_UP (1) |
71 | #define SM_DOWN (2) | 73 | #define SM_DOWN (2) |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index aee10b2ea4c6..e3d1c33d1558 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -8,9 +8,12 @@ | |||
8 | #ifndef _LINUX_DEVICE_MAPPER_H | 8 | #ifndef _LINUX_DEVICE_MAPPER_H |
9 | #define _LINUX_DEVICE_MAPPER_H | 9 | #define _LINUX_DEVICE_MAPPER_H |
10 | 10 | ||
11 | #ifdef __KERNEL__ | ||
12 | |||
11 | struct dm_target; | 13 | struct dm_target; |
12 | struct dm_table; | 14 | struct dm_table; |
13 | struct dm_dev; | 15 | struct dm_dev; |
16 | struct mapped_device; | ||
14 | 17 | ||
15 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | 18 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; |
16 | 19 | ||
@@ -78,7 +81,7 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
78 | struct target_type { | 81 | struct target_type { |
79 | const char *name; | 82 | const char *name; |
80 | struct module *module; | 83 | struct module *module; |
81 | unsigned version[3]; | 84 | unsigned version[3]; |
82 | dm_ctr_fn ctr; | 85 | dm_ctr_fn ctr; |
83 | dm_dtr_fn dtr; | 86 | dm_dtr_fn dtr; |
84 | dm_map_fn map; | 87 | dm_map_fn map; |
@@ -128,4 +131,108 @@ struct dm_target { | |||
128 | int dm_register_target(struct target_type *t); | 131 | int dm_register_target(struct target_type *t); |
129 | int dm_unregister_target(struct target_type *t); | 132 | int dm_unregister_target(struct target_type *t); |
130 | 133 | ||
131 | #endif /* _LINUX_DEVICE_MAPPER_H */ | 134 | |
135 | /*----------------------------------------------------------------- | ||
136 | * Functions for creating and manipulating mapped devices. | ||
137 | * Drop the reference with dm_put when you finish with the object. | ||
138 | *---------------------------------------------------------------*/ | ||
139 | |||
140 | /* | ||
141 | * DM_ANY_MINOR chooses the next available minor number. | ||
142 | */ | ||
143 | #define DM_ANY_MINOR (-1) | ||
144 | int dm_create(int minor, struct mapped_device **md); | ||
145 | |||
146 | /* | ||
147 | * Reference counting for md. | ||
148 | */ | ||
149 | struct mapped_device *dm_get_md(dev_t dev); | ||
150 | void dm_get(struct mapped_device *md); | ||
151 | void dm_put(struct mapped_device *md); | ||
152 | |||
153 | /* | ||
154 | * An arbitrary pointer may be stored alongside a mapped device. | ||
155 | */ | ||
156 | void dm_set_mdptr(struct mapped_device *md, void *ptr); | ||
157 | void *dm_get_mdptr(struct mapped_device *md); | ||
158 | |||
159 | /* | ||
160 | * A device can still be used while suspended, but I/O is deferred. | ||
161 | */ | ||
162 | int dm_suspend(struct mapped_device *md, int with_lockfs); | ||
163 | int dm_resume(struct mapped_device *md); | ||
164 | |||
165 | /* | ||
166 | * Event functions. | ||
167 | */ | ||
168 | uint32_t dm_get_event_nr(struct mapped_device *md); | ||
169 | int dm_wait_event(struct mapped_device *md, int event_nr); | ||
170 | |||
171 | /* | ||
172 | * Info functions. | ||
173 | */ | ||
174 | const char *dm_device_name(struct mapped_device *md); | ||
175 | struct gendisk *dm_disk(struct mapped_device *md); | ||
176 | int dm_suspended(struct mapped_device *md); | ||
177 | |||
178 | /* | ||
179 | * Geometry functions. | ||
180 | */ | ||
181 | int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
182 | int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
183 | |||
184 | |||
185 | /*----------------------------------------------------------------- | ||
186 | * Functions for manipulating device-mapper tables. | ||
187 | *---------------------------------------------------------------*/ | ||
188 | |||
189 | /* | ||
190 | * First create an empty table. | ||
191 | */ | ||
192 | int dm_table_create(struct dm_table **result, int mode, | ||
193 | unsigned num_targets, struct mapped_device *md); | ||
194 | |||
195 | /* | ||
196 | * Then call this once for each target. | ||
197 | */ | ||
198 | int dm_table_add_target(struct dm_table *t, const char *type, | ||
199 | sector_t start, sector_t len, char *params); | ||
200 | |||
201 | /* | ||
202 | * Finally call this to make the table ready for use. | ||
203 | */ | ||
204 | int dm_table_complete(struct dm_table *t); | ||
205 | |||
206 | /* | ||
207 | * Table reference counting. | ||
208 | */ | ||
209 | struct dm_table *dm_get_table(struct mapped_device *md); | ||
210 | void dm_table_get(struct dm_table *t); | ||
211 | void dm_table_put(struct dm_table *t); | ||
212 | |||
213 | /* | ||
214 | * Queries | ||
215 | */ | ||
216 | sector_t dm_table_get_size(struct dm_table *t); | ||
217 | unsigned int dm_table_get_num_targets(struct dm_table *t); | ||
218 | int dm_table_get_mode(struct dm_table *t); | ||
219 | struct mapped_device *dm_table_get_md(struct dm_table *t); | ||
220 | |||
221 | /* | ||
222 | * Trigger an event. | ||
223 | */ | ||
224 | void dm_table_event(struct dm_table *t); | ||
225 | |||
226 | /* | ||
227 | * The device must be suspended before calling this method. | ||
228 | */ | ||
229 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); | ||
230 | |||
231 | /* | ||
232 | * Prepare a table for a device that will error all I/O. | ||
233 | * To make it active, call dm_suspend(), dm_swap_table() then dm_resume(). | ||
234 | */ | ||
235 | int dm_create_error_table(struct dm_table **result, struct mapped_device *md); | ||
236 | |||
237 | #endif /* __KERNEL__ */ | ||
238 | #endif /* _LINUX_DEVICE_MAPPER_H */ | ||
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index c67c6786612a..9623bb625090 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 6 | 288 | #define DM_VERSION_MINOR 7 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-02-17)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-06-24)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -314,7 +314,7 @@ typedef char ioctl_struct[308]; | |||
314 | #define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ | 314 | #define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ |
315 | 315 | ||
316 | /* | 316 | /* |
317 | * Set this to improve performance when you aren't going to use open_count. | 317 | * This flag is now ignored. |
318 | */ | 318 | */ |
319 | #define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ | 319 | #define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ |
320 | 320 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index f1281687e549..07a08e92bc73 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -504,23 +504,19 @@ struct fb_cursor_user { | |||
504 | #define FB_EVENT_MODE_DELETE 0x04 | 504 | #define FB_EVENT_MODE_DELETE 0x04 |
505 | /* A driver registered itself */ | 505 | /* A driver registered itself */ |
506 | #define FB_EVENT_FB_REGISTERED 0x05 | 506 | #define FB_EVENT_FB_REGISTERED 0x05 |
507 | /* A driver unregistered itself */ | ||
508 | #define FB_EVENT_FB_UNREGISTERED 0x06 | ||
507 | /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ | 509 | /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ |
508 | #define FB_EVENT_GET_CONSOLE_MAP 0x06 | 510 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 |
509 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ | 511 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
510 | #define FB_EVENT_SET_CONSOLE_MAP 0x07 | 512 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 |
511 | /* A display blank is requested */ | 513 | /* A display blank is requested */ |
512 | #define FB_EVENT_BLANK 0x08 | 514 | #define FB_EVENT_BLANK 0x09 |
513 | /* Private modelist is to be replaced */ | 515 | /* Private modelist is to be replaced */ |
514 | #define FB_EVENT_NEW_MODELIST 0x09 | 516 | #define FB_EVENT_NEW_MODELIST 0x0A |
515 | /* The resolution of the passed in fb_info about to change and | 517 | /* The resolution of the passed in fb_info about to change and |
516 | all vc's should be changed */ | 518 | all vc's should be changed */ |
517 | #define FB_EVENT_MODE_CHANGE_ALL 0x0A | 519 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B |
518 | /* CONSOLE-SPECIFIC: set console rotation */ | ||
519 | #define FB_EVENT_SET_CON_ROTATE 0x0B | ||
520 | /* CONSOLE-SPECIFIC: get console rotation */ | ||
521 | #define FB_EVENT_GET_CON_ROTATE 0x0C | ||
522 | /* CONSOLE-SPECIFIC: rotate all consoles */ | ||
523 | #define FB_EVENT_SET_CON_ROTATE_ALL 0x0D | ||
524 | 520 | ||
525 | struct fb_event { | 521 | struct fb_event { |
526 | struct fb_info *info; | 522 | struct fb_info *info; |
@@ -892,7 +888,6 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var, | |||
892 | struct fb_fix_screeninfo *fix); | 888 | struct fb_fix_screeninfo *fix); |
893 | extern int fb_get_options(char *name, char **option); | 889 | extern int fb_get_options(char *name, char **option); |
894 | extern int fb_new_modelist(struct fb_info *info); | 890 | extern int fb_new_modelist(struct fb_info *info); |
895 | extern int fb_con_duit(struct fb_info *info, int event, void *data); | ||
896 | 891 | ||
897 | extern struct fb_info *registered_fb[FB_MAX]; | 892 | extern struct fb_info *registered_fb[FB_MAX]; |
898 | extern int num_registered_fb; | 893 | extern int num_registered_fb; |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h new file mode 100644 index 000000000000..21ea7610e177 --- /dev/null +++ b/include/linux/hw_random.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | Hardware Random Number Generator | ||
3 | |||
4 | Please read Documentation/hw_random.txt for details on use. | ||
5 | |||
6 | ---------------------------------------------------------- | ||
7 | This software may be used and distributed according to the terms | ||
8 | of the GNU General Public License, incorporated herein by reference. | ||
9 | |||
10 | */ | ||
11 | |||
12 | #ifndef LINUX_HWRANDOM_H_ | ||
13 | #define LINUX_HWRANDOM_H_ | ||
14 | #ifdef __KERNEL__ | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | #include <linux/list.h> | ||
18 | |||
19 | /** | ||
20 | * struct hwrng - Hardware Random Number Generator driver | ||
21 | * @name: Unique RNG name. | ||
22 | * @init: Initialization callback (can be NULL). | ||
23 | * @cleanup: Cleanup callback (can be NULL). | ||
24 | * @data_present: Callback to determine if data is available | ||
25 | * on the RNG. If NULL, it is assumed that | ||
26 | * there is always data available. | ||
27 | * @data_read: Read data from the RNG device. | ||
28 | * Returns the number of lower random bytes in "data". | ||
29 | * Must not be NULL. | ||
30 | * @priv: Private data, for use by the RNG driver. | ||
31 | */ | ||
32 | struct hwrng { | ||
33 | const char *name; | ||
34 | int (*init)(struct hwrng *rng); | ||
35 | void (*cleanup)(struct hwrng *rng); | ||
36 | int (*data_present)(struct hwrng *rng); | ||
37 | int (*data_read)(struct hwrng *rng, u32 *data); | ||
38 | unsigned long priv; | ||
39 | |||
40 | /* internal. */ | ||
41 | struct list_head list; | ||
42 | }; | ||
43 | |||
44 | /** Register a new Hardware Random Number Generator driver. */ | ||
45 | extern int hwrng_register(struct hwrng *rng); | ||
46 | /** Unregister a Hardware Random Number Generator driver. */ | ||
47 | extern void hwrng_unregister(struct hwrng *rng); | ||
48 | |||
49 | #endif /* __KERNEL__ */ | ||
50 | #endif /* LINUX_HWRANDOM_H_ */ | ||
diff --git a/include/linux/idr.h b/include/linux/idr.h index d37c8d808b0f..f559a719dbe8 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -78,6 +78,7 @@ void *idr_find(struct idr *idp, int id); | |||
78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
79 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 79 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
81 | void *idr_replace(struct idr *idp, void *ptr, int id); | ||
81 | void idr_remove(struct idr *idp, int id); | 82 | void idr_remove(struct idr *idp, int id); |
82 | void idr_destroy(struct idr *idp); | 83 | void idr_destroy(struct idr *idp); |
83 | void idr_init(struct idr *idp); | 84 | void idr_init(struct idr *idp); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 41ecbb847f32..e127ef7e8da8 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -119,7 +119,6 @@ extern struct group_info init_groups; | |||
119 | .signal = {{0}}}, \ | 119 | .signal = {{0}}}, \ |
120 | .blocked = {{0}}, \ | 120 | .blocked = {{0}}, \ |
121 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ | 121 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ |
122 | .proc_lock = SPIN_LOCK_UNLOCKED, \ | ||
123 | .journal_info = NULL, \ | 122 | .journal_info = NULL, \ |
124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 123 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
125 | .fs_excl = ATOMIC_INIT(0), \ | 124 | .fs_excl = ATOMIC_INIT(0), \ |
diff --git a/include/linux/key.h b/include/linux/key.h index e81ebf910d0b..e693e729bc92 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -248,7 +248,14 @@ extern struct key *key_alloc(struct key_type *type, | |||
248 | const char *desc, | 248 | const char *desc, |
249 | uid_t uid, gid_t gid, | 249 | uid_t uid, gid_t gid, |
250 | struct task_struct *ctx, | 250 | struct task_struct *ctx, |
251 | key_perm_t perm, int not_in_quota); | 251 | key_perm_t perm, |
252 | unsigned long flags); | ||
253 | |||
254 | |||
255 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ | ||
256 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ | ||
257 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ | ||
258 | |||
252 | extern int key_payload_reserve(struct key *key, size_t datalen); | 259 | extern int key_payload_reserve(struct key *key, size_t datalen); |
253 | extern int key_instantiate_and_link(struct key *key, | 260 | extern int key_instantiate_and_link(struct key *key, |
254 | const void *data, | 261 | const void *data, |
@@ -285,7 +292,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring, | |||
285 | const char *description, | 292 | const char *description, |
286 | const void *payload, | 293 | const void *payload, |
287 | size_t plen, | 294 | size_t plen, |
288 | int not_in_quota); | 295 | unsigned long flags); |
289 | 296 | ||
290 | extern int key_update(key_ref_t key, | 297 | extern int key_update(key_ref_t key, |
291 | const void *payload, | 298 | const void *payload, |
@@ -299,7 +306,7 @@ extern int key_unlink(struct key *keyring, | |||
299 | 306 | ||
300 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 307 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, |
301 | struct task_struct *ctx, | 308 | struct task_struct *ctx, |
302 | int not_in_quota, | 309 | unsigned long flags, |
303 | struct key *dest); | 310 | struct key *dest); |
304 | 311 | ||
305 | extern int keyring_clear(struct key *keyring); | 312 | extern int keyring_clear(struct key *keyring); |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 5810d28fbed9..17e75783e3a5 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -99,9 +99,8 @@ extern void proc_misc_init(void); | |||
99 | 99 | ||
100 | struct mm_struct; | 100 | struct mm_struct; |
101 | 101 | ||
102 | void proc_flush_task(struct task_struct *task); | ||
102 | struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); | 103 | struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); |
103 | struct dentry *proc_pid_unhash(struct task_struct *p); | ||
104 | void proc_pid_flush(struct dentry *proc_dentry); | ||
105 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | 104 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); |
106 | unsigned long task_vsize(struct mm_struct *); | 105 | unsigned long task_vsize(struct mm_struct *); |
107 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | 106 | int task_statm(struct mm_struct *, int *, int *, int *, int *); |
@@ -211,8 +210,7 @@ static inline void proc_net_remove(const char *name) | |||
211 | #define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) | 210 | #define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) |
212 | static inline void proc_net_remove(const char *name) {} | 211 | static inline void proc_net_remove(const char *name) {} |
213 | 212 | ||
214 | static inline struct dentry *proc_pid_unhash(struct task_struct *p) { return NULL; } | 213 | static inline void proc_flush_task(struct task_struct *task) { } |
215 | static inline void proc_pid_flush(struct dentry *proc_dentry) { } | ||
216 | 214 | ||
217 | static inline struct proc_dir_entry *create_proc_entry(const char *name, | 215 | static inline struct proc_dir_entry *create_proc_entry(const char *name, |
218 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } | 216 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } |
@@ -248,8 +246,8 @@ extern void kclist_add(struct kcore_list *, void *, size_t); | |||
248 | #endif | 246 | #endif |
249 | 247 | ||
250 | struct proc_inode { | 248 | struct proc_inode { |
251 | struct task_struct *task; | 249 | struct pid *pid; |
252 | int type; | 250 | int fd; |
253 | union { | 251 | union { |
254 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | 252 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); |
255 | int (*proc_read)(struct task_struct *task, char *page); | 253 | int (*proc_read)(struct task_struct *task, char *page); |
@@ -268,4 +266,10 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) | |||
268 | return PROC_I(inode)->pde; | 266 | return PROC_I(inode)->pde; |
269 | } | 267 | } |
270 | 268 | ||
269 | struct proc_maps_private { | ||
270 | struct pid *pid; | ||
271 | struct task_struct *task; | ||
272 | struct vm_area_struct *tail_vma; | ||
273 | }; | ||
274 | |||
271 | #endif /* _LINUX_PROC_FS_H */ | 275 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index ee918bc6e18c..8b2749a259dc 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -88,7 +88,6 @@ extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __us | |||
88 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 88 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
89 | extern int ptrace_attach(struct task_struct *tsk); | 89 | extern int ptrace_attach(struct task_struct *tsk); |
90 | extern int ptrace_detach(struct task_struct *, unsigned int); | 90 | extern int ptrace_detach(struct task_struct *, unsigned int); |
91 | extern void __ptrace_detach(struct task_struct *, unsigned int); | ||
92 | extern void ptrace_disable(struct task_struct *); | 91 | extern void ptrace_disable(struct task_struct *); |
93 | extern int ptrace_check_attach(struct task_struct *task, int kill); | 92 | extern int ptrace_check_attach(struct task_struct *task, int kill); |
94 | extern int ptrace_request(struct task_struct *child, long request, long addr, long data); | 93 | extern int ptrace_request(struct task_struct *child, long request, long addr, long data); |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 899437802aea..63df898fe2e9 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -140,6 +140,7 @@ typedef __u16 bitmap_counter_t; | |||
140 | enum bitmap_state { | 140 | enum bitmap_state { |
141 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ | 141 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ |
142 | BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ | 142 | BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ |
143 | BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */ | ||
143 | BITMAP_HOSTENDIAN = 0x8000, | 144 | BITMAP_HOSTENDIAN = 0x8000, |
144 | }; | 145 | }; |
145 | 146 | ||
@@ -244,15 +245,9 @@ struct bitmap { | |||
244 | unsigned long daemon_lastrun; /* jiffies of last run */ | 245 | unsigned long daemon_lastrun; /* jiffies of last run */ |
245 | unsigned long daemon_sleep; /* how many seconds between updates? */ | 246 | unsigned long daemon_sleep; /* how many seconds between updates? */ |
246 | 247 | ||
247 | /* | 248 | atomic_t pending_writes; /* pending writes to the bitmap file */ |
248 | * bitmap_writeback_daemon waits for file-pages that have been written, | ||
249 | * as there is no way to get a call-back when a page write completes. | ||
250 | */ | ||
251 | mdk_thread_t *writeback_daemon; | ||
252 | spinlock_t write_lock; | ||
253 | wait_queue_head_t write_wait; | 249 | wait_queue_head_t write_wait; |
254 | struct list_head complete_pages; | 250 | |
255 | mempool_t *write_pool; | ||
256 | }; | 251 | }; |
257 | 252 | ||
258 | /* the bitmap API */ | 253 | /* the bitmap API */ |
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index 7eaf290e10e7..ba15469daf11 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h | |||
@@ -13,8 +13,10 @@ typedef struct dev_info dev_info_t; | |||
13 | 13 | ||
14 | struct linear_private_data | 14 | struct linear_private_data |
15 | { | 15 | { |
16 | struct linear_private_data *prev; /* earlier version */ | ||
16 | dev_info_t **hash_table; | 17 | dev_info_t **hash_table; |
17 | sector_t hash_spacing; | 18 | sector_t hash_spacing; |
19 | sector_t array_size; | ||
18 | int preshift; /* shift before dividing by hash_spacing */ | 20 | int preshift; /* shift before dividing by hash_spacing */ |
19 | dev_info_t disks[0]; | 21 | dev_info_t disks[0]; |
20 | }; | 22 | }; |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 66b44e5e0d6e..eb3e547c8fee 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -85,8 +85,6 @@ extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | |||
85 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); | 85 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); |
86 | extern void md_unplug_mddev(mddev_t *mddev); | 86 | extern void md_unplug_mddev(mddev_t *mddev); |
87 | 87 | ||
88 | extern void md_print_devices (void); | ||
89 | |||
90 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, |
91 | sector_t sector, int size, struct page *page); | 89 | sector_t sector, int size, struct page *page); |
92 | extern void md_super_wait(mddev_t *mddev); | 90 | extern void md_super_wait(mddev_t *mddev); |
@@ -97,7 +95,5 @@ extern void md_new_event(mddev_t *mddev); | |||
97 | 95 | ||
98 | extern void md_update_sb(mddev_t * mddev); | 96 | extern void md_update_sb(mddev_t * mddev); |
99 | 97 | ||
100 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } | ||
101 | |||
102 | #endif | 98 | #endif |
103 | 99 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index e2df61f5b09a..c1e0ac55bab5 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -40,7 +40,8 @@ typedef struct mdk_rdev_s mdk_rdev_t; | |||
40 | * options passed in raidrun: | 40 | * options passed in raidrun: |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define MAX_CHUNK_SIZE (4096*1024) | 43 | /* Currently this must fix in an 'int' */ |
44 | #define MAX_CHUNK_SIZE (1<<30) | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * MD's 'extended' device | 47 | * MD's 'extended' device |
@@ -57,6 +58,7 @@ struct mdk_rdev_s | |||
57 | 58 | ||
58 | struct page *sb_page; | 59 | struct page *sb_page; |
59 | int sb_loaded; | 60 | int sb_loaded; |
61 | __u64 sb_events; | ||
60 | sector_t data_offset; /* start of data in array */ | 62 | sector_t data_offset; /* start of data in array */ |
61 | sector_t sb_offset; | 63 | sector_t sb_offset; |
62 | int sb_size; /* bytes in the superblock */ | 64 | int sb_size; /* bytes in the superblock */ |
@@ -87,6 +89,10 @@ struct mdk_rdev_s | |||
87 | * array and could again if we did a partial | 89 | * array and could again if we did a partial |
88 | * resync from the bitmap | 90 | * resync from the bitmap |
89 | */ | 91 | */ |
92 | sector_t recovery_offset;/* If this device has been partially | ||
93 | * recovered, this is where we were | ||
94 | * up to. | ||
95 | */ | ||
90 | 96 | ||
91 | atomic_t nr_pending; /* number of pending requests. | 97 | atomic_t nr_pending; /* number of pending requests. |
92 | * only maintained for arrays that | 98 | * only maintained for arrays that |
@@ -182,6 +188,8 @@ struct mddev_s | |||
182 | #define MD_RECOVERY_REQUESTED 6 | 188 | #define MD_RECOVERY_REQUESTED 6 |
183 | #define MD_RECOVERY_CHECK 7 | 189 | #define MD_RECOVERY_CHECK 7 |
184 | #define MD_RECOVERY_RESHAPE 8 | 190 | #define MD_RECOVERY_RESHAPE 8 |
191 | #define MD_RECOVERY_FROZEN 9 | ||
192 | |||
185 | unsigned long recovery; | 193 | unsigned long recovery; |
186 | 194 | ||
187 | int in_sync; /* know to not need resync */ | 195 | int in_sync; /* know to not need resync */ |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index f1fbae7e390e..b6ebc69bae54 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -265,9 +265,12 @@ struct mdp_superblock_1 { | |||
265 | 265 | ||
266 | /* feature_map bits */ | 266 | /* feature_map bits */ |
267 | #define MD_FEATURE_BITMAP_OFFSET 1 | 267 | #define MD_FEATURE_BITMAP_OFFSET 1 |
268 | #define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and | ||
269 | * must be honoured | ||
270 | */ | ||
268 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | 271 | #define MD_FEATURE_RESHAPE_ACTIVE 4 |
269 | 272 | ||
270 | #define MD_FEATURE_ALL 5 | 273 | #define MD_FEATURE_ALL (1|2|4) |
271 | 274 | ||
272 | #endif | 275 | #endif |
273 | 276 | ||
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h index b1103298a8c2..c41e56a7c090 100644 --- a/include/linux/raid/raid10.h +++ b/include/linux/raid/raid10.h | |||
@@ -24,11 +24,16 @@ struct r10_private_data_s { | |||
24 | int far_copies; /* number of copies layed out | 24 | int far_copies; /* number of copies layed out |
25 | * at large strides across drives | 25 | * at large strides across drives |
26 | */ | 26 | */ |
27 | int far_offset; /* far_copies are offset by 1 stripe | ||
28 | * instead of many | ||
29 | */ | ||
27 | int copies; /* near_copies * far_copies. | 30 | int copies; /* near_copies * far_copies. |
28 | * must be <= raid_disks | 31 | * must be <= raid_disks |
29 | */ | 32 | */ |
30 | sector_t stride; /* distance between far copies. | 33 | sector_t stride; /* distance between far copies. |
31 | * This is size / far_copies | 34 | * This is size / far_copies unless |
35 | * far_offset, in which case it is | ||
36 | * 1 stripe. | ||
32 | */ | 37 | */ |
33 | 38 | ||
34 | int chunk_shift; /* shift from chunks to sectors */ | 39 | int chunk_shift; /* shift from chunks to sectors */ |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 914af667044f..20ed4c997636 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -212,6 +212,7 @@ struct raid5_private_data { | |||
212 | mddev_t *mddev; | 212 | mddev_t *mddev; |
213 | struct disk_info *spare; | 213 | struct disk_info *spare; |
214 | int chunk_size, level, algorithm; | 214 | int chunk_size, level, algorithm; |
215 | int max_degraded; | ||
215 | int raid_disks, working_disks, failed_disks; | 216 | int raid_disks, working_disks, failed_disks; |
216 | int max_nr_stripes; | 217 | int max_nr_stripes; |
217 | 218 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8d11d9310db0..122a25c1b997 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -842,8 +842,6 @@ struct task_struct { | |||
842 | u32 self_exec_id; | 842 | u32 self_exec_id; |
843 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 843 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ |
844 | spinlock_t alloc_lock; | 844 | spinlock_t alloc_lock; |
845 | /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ | ||
846 | spinlock_t proc_lock; | ||
847 | 845 | ||
848 | #ifdef CONFIG_DEBUG_MUTEXES | 846 | #ifdef CONFIG_DEBUG_MUTEXES |
849 | /* mutex deadlock detection */ | 847 | /* mutex deadlock detection */ |
@@ -856,7 +854,6 @@ struct task_struct { | |||
856 | /* VM state */ | 854 | /* VM state */ |
857 | struct reclaim_state *reclaim_state; | 855 | struct reclaim_state *reclaim_state; |
858 | 856 | ||
859 | struct dentry *proc_dentry; | ||
860 | struct backing_dev_info *backing_dev_info; | 857 | struct backing_dev_info *backing_dev_info; |
861 | 858 | ||
862 | struct io_context *io_context; | 859 | struct io_context *io_context; |
diff --git a/include/linux/security.h b/include/linux/security.h index d2c17bd91a29..51805806f974 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -862,6 +862,7 @@ struct swap_info_struct; | |||
862 | * Permit allocation of a key and assign security data. Note that key does | 862 | * Permit allocation of a key and assign security data. Note that key does |
863 | * not have a serial number assigned at this point. | 863 | * not have a serial number assigned at this point. |
864 | * @key points to the key. | 864 | * @key points to the key. |
865 | * @flags is the allocation flags | ||
865 | * Return 0 if permission is granted, -ve error otherwise. | 866 | * Return 0 if permission is granted, -ve error otherwise. |
866 | * @key_free: | 867 | * @key_free: |
867 | * Notification of destruction; free security data. | 868 | * Notification of destruction; free security data. |
@@ -1324,7 +1325,7 @@ struct security_operations { | |||
1324 | 1325 | ||
1325 | /* key management security hooks */ | 1326 | /* key management security hooks */ |
1326 | #ifdef CONFIG_KEYS | 1327 | #ifdef CONFIG_KEYS |
1327 | int (*key_alloc)(struct key *key, struct task_struct *tsk); | 1328 | int (*key_alloc)(struct key *key, struct task_struct *tsk, unsigned long flags); |
1328 | void (*key_free)(struct key *key); | 1329 | void (*key_free)(struct key *key); |
1329 | int (*key_permission)(key_ref_t key_ref, | 1330 | int (*key_permission)(key_ref_t key_ref, |
1330 | struct task_struct *context, | 1331 | struct task_struct *context, |
@@ -3040,9 +3041,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid | |||
3040 | #ifdef CONFIG_KEYS | 3041 | #ifdef CONFIG_KEYS |
3041 | #ifdef CONFIG_SECURITY | 3042 | #ifdef CONFIG_SECURITY |
3042 | static inline int security_key_alloc(struct key *key, | 3043 | static inline int security_key_alloc(struct key *key, |
3043 | struct task_struct *tsk) | 3044 | struct task_struct *tsk, |
3045 | unsigned long flags) | ||
3044 | { | 3046 | { |
3045 | return security_ops->key_alloc(key, tsk); | 3047 | return security_ops->key_alloc(key, tsk, flags); |
3046 | } | 3048 | } |
3047 | 3049 | ||
3048 | static inline void security_key_free(struct key *key) | 3050 | static inline void security_key_free(struct key *key) |
@@ -3060,7 +3062,8 @@ static inline int security_key_permission(key_ref_t key_ref, | |||
3060 | #else | 3062 | #else |
3061 | 3063 | ||
3062 | static inline int security_key_alloc(struct key *key, | 3064 | static inline int security_key_alloc(struct key *key, |
3063 | struct task_struct *tsk) | 3065 | struct task_struct *tsk, |
3066 | unsigned long flags) | ||
3064 | { | 3067 | { |
3065 | return 0; | 3068 | return 0; |
3066 | } | 3069 | } |
diff --git a/include/linux/time.h b/include/linux/time.h index 0cd696cee998..65dd85b2105e 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -77,6 +77,8 @@ extern struct timespec xtime; | |||
77 | extern struct timespec wall_to_monotonic; | 77 | extern struct timespec wall_to_monotonic; |
78 | extern seqlock_t xtime_lock; | 78 | extern seqlock_t xtime_lock; |
79 | 79 | ||
80 | void timekeeping_init(void); | ||
81 | |||
80 | static inline unsigned long get_seconds(void) | 82 | static inline unsigned long get_seconds(void) |
81 | { | 83 | { |
82 | return xtime.tv_sec; | 84 | return xtime.tv_sec; |
@@ -100,6 +102,7 @@ extern int do_getitimer(int which, struct itimerval *value); | |||
100 | extern void getnstimeofday(struct timespec *tv); | 102 | extern void getnstimeofday(struct timespec *tv); |
101 | 103 | ||
102 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 104 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
105 | extern int timekeeping_is_continuous(void); | ||
103 | 106 | ||
104 | /** | 107 | /** |
105 | * timespec_to_ns - Convert timespec to nanoseconds | 108 | * timespec_to_ns - Convert timespec to nanoseconds |
@@ -142,6 +145,20 @@ extern struct timespec ns_to_timespec(const s64 nsec); | |||
142 | */ | 145 | */ |
143 | extern struct timeval ns_to_timeval(const s64 nsec); | 146 | extern struct timeval ns_to_timeval(const s64 nsec); |
144 | 147 | ||
148 | /** | ||
149 | * timespec_add_ns - Adds nanoseconds to a timespec | ||
150 | * @a: pointer to timespec to be incremented | ||
151 | * @ns: unsigned nanoseconds value to be added | ||
152 | */ | ||
153 | static inline void timespec_add_ns(struct timespec *a, u64 ns) | ||
154 | { | ||
155 | ns += a->tv_nsec; | ||
156 | while(unlikely(ns >= NSEC_PER_SEC)) { | ||
157 | ns -= NSEC_PER_SEC; | ||
158 | a->tv_sec++; | ||
159 | } | ||
160 | a->tv_nsec = ns; | ||
161 | } | ||
145 | #endif /* __KERNEL__ */ | 162 | #endif /* __KERNEL__ */ |
146 | 163 | ||
147 | #define NFDBITS __NFDBITS | 164 | #define NFDBITS __NFDBITS |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 34d3ccff7bbb..19bb6538b49e 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -303,6 +303,8 @@ time_interpolator_reset(void) | |||
303 | 303 | ||
304 | #endif /* !CONFIG_TIME_INTERPOLATION */ | 304 | #endif /* !CONFIG_TIME_INTERPOLATION */ |
305 | 305 | ||
306 | #define TICK_LENGTH_SHIFT 32 | ||
307 | |||
306 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 308 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
307 | extern u64 current_tick_length(void); | 309 | extern u64 current_tick_length(void); |
308 | 310 | ||