diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-28 14:06:39 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-28 14:06:39 -0400 |
commit | f28e71617ddaf2483e3e5c5237103484a303743f (patch) | |
tree | 67627d2d8ddbf6a4449371e9261d796c013b1fa1 /include | |
parent | dc6a78f1af10d28fb8c395034ae1e099b85c05b0 (diff) | |
parent | a39727f212426b9d5f9267b3318a2afaf9922d3b (diff) |
Merge ../linux-2.6/
Conflicts:
drivers/scsi/aacraid/comminit.c
Fixed up by removing the now renamed CONFIG_IOMMU option from
aacraid
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include')
151 files changed, 2487 insertions, 915 deletions
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h index dba70c62a16c..457c34b6eb09 100644 --- a/include/asm-alpha/core_t2.h +++ b/include/asm-alpha/core_t2.h | |||
@@ -435,7 +435,7 @@ static inline void t2_outl(u32 b, unsigned long addr) | |||
435 | set_hae(msb); \ | 435 | set_hae(msb); \ |
436 | } | 436 | } |
437 | 437 | ||
438 | static spinlock_t t2_hae_lock = SPIN_LOCK_UNLOCKED; | 438 | static DEFINE_SPINLOCK(t2_hae_lock); |
439 | 439 | ||
440 | __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) | 440 | __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) |
441 | { | 441 | { |
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h index 7cff235e667a..c1470c695c33 100644 --- a/include/asm-arm/arch-s3c2410/regs-nand.h +++ b/include/asm-arm/arch-s3c2410/regs-nand.h | |||
@@ -39,10 +39,19 @@ | |||
39 | #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) | 39 | #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) |
40 | #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) | 40 | #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) |
41 | #define S3C2440_NFMECC1 S3C2410_NFREG(0x30) | 41 | #define S3C2440_NFMECC1 S3C2410_NFREG(0x30) |
42 | #define S3C2440_NFSECC S3C2410_NFREG(0x34) | 42 | #define S3C2440_NFSECC S3C24E10_NFREG(0x34) |
43 | #define S3C2440_NFSBLK S3C2410_NFREG(0x38) | 43 | #define S3C2440_NFSBLK S3C2410_NFREG(0x38) |
44 | #define S3C2440_NFEBLK S3C2410_NFREG(0x3C) | 44 | #define S3C2440_NFEBLK S3C2410_NFREG(0x3C) |
45 | 45 | ||
46 | #define S3C2412_NFSBLK S3C2410_NFREG(0x20) | ||
47 | #define S3C2412_NFEBLK S3C2410_NFREG(0x24) | ||
48 | #define S3C2412_NFSTAT S3C2410_NFREG(0x28) | ||
49 | #define S3C2412_NFMECC_ERR0 S3C2410_NFREG(0x2C) | ||
50 | #define S3C2412_NFMECC_ERR1 S3C2410_NFREG(0x30) | ||
51 | #define S3C2412_NFMECC0 S3C2410_NFREG(0x34) | ||
52 | #define S3C2412_NFMECC1 S3C2410_NFREG(0x38) | ||
53 | #define S3C2412_NFSECC S3C2410_NFREG(0x3C) | ||
54 | |||
46 | #define S3C2410_NFCONF_EN (1<<15) | 55 | #define S3C2410_NFCONF_EN (1<<15) |
47 | #define S3C2410_NFCONF_512BYTE (1<<14) | 56 | #define S3C2410_NFCONF_512BYTE (1<<14) |
48 | #define S3C2410_NFCONF_4STEP (1<<13) | 57 | #define S3C2410_NFCONF_4STEP (1<<13) |
@@ -77,5 +86,42 @@ | |||
77 | #define S3C2440_NFSTAT_RnB_CHANGE (1<<2) | 86 | #define S3C2440_NFSTAT_RnB_CHANGE (1<<2) |
78 | #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) | 87 | #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) |
79 | 88 | ||
89 | #define S3C2412_NFCONF_NANDBOOT (1<<31) | ||
90 | #define S3C2412_NFCONF_ECCCLKCON (1<<30) | ||
91 | #define S3C2412_NFCONF_ECC_MLC (1<<24) | ||
92 | #define S3C2412_NFCONF_TACLS_MASK (7<<12) /* 1 extra bit of Tacls */ | ||
93 | |||
94 | #define S3C2412_NFCONT_ECC4_DIRWR (1<<18) | ||
95 | #define S3C2412_NFCONT_LOCKTIGHT (1<<17) | ||
96 | #define S3C2412_NFCONT_SOFTLOCK (1<<16) | ||
97 | #define S3C2412_NFCONT_ECC4_ENCINT (1<<13) | ||
98 | #define S3C2412_NFCONT_ECC4_DECINT (1<<12) | ||
99 | #define S3C2412_NFCONT_MAIN_ECC_LOCK (1<<7) | ||
100 | #define S3C2412_NFCONT_INIT_MAIN_ECC (1<<5) | ||
101 | #define S3C2412_NFCONT_nFCE1 (1<<2) | ||
102 | #define S3C2412_NFCONT_nFCE0 (1<<1) | ||
103 | |||
104 | #define S3C2412_NFSTAT_ECC_ENCDONE (1<<7) | ||
105 | #define S3C2412_NFSTAT_ECC_DECDONE (1<<6) | ||
106 | #define S3C2412_NFSTAT_ILLEGAL_ACCESS (1<<5) | ||
107 | #define S3C2412_NFSTAT_RnB_CHANGE (1<<4) | ||
108 | #define S3C2412_NFSTAT_nFCE1 (1<<3) | ||
109 | #define S3C2412_NFSTAT_nFCE0 (1<<2) | ||
110 | #define S3C2412_NFSTAT_Res1 (1<<1) | ||
111 | #define S3C2412_NFSTAT_READY (1<<0) | ||
112 | |||
113 | #define S3C2412_NFECCERR_SERRDATA(x) (((x) >> 21) & 0xf) | ||
114 | #define S3C2412_NFECCERR_SERRBIT(x) (((x) >> 18) & 0x7) | ||
115 | #define S3C2412_NFECCERR_MERRDATA(x) (((x) >> 7) & 0x3ff) | ||
116 | #define S3C2412_NFECCERR_MERRBIT(x) (((x) >> 4) & 0x7) | ||
117 | #define S3C2412_NFECCERR_SPARE_ERR(x) (((x) >> 2) & 0x3) | ||
118 | #define S3C2412_NFECCERR_MAIN_ERR(x) (((x) >> 2) & 0x3) | ||
119 | #define S3C2412_NFECCERR_NONE (0) | ||
120 | #define S3C2412_NFECCERR_1BIT (1) | ||
121 | #define S3C2412_NFECCERR_MULTIBIT (2) | ||
122 | #define S3C2412_NFECCERR_ECCAREA (3) | ||
123 | |||
124 | |||
125 | |||
80 | #endif /* __ASM_ARM_REGS_NAND */ | 126 | #endif /* __ASM_ARM_REGS_NAND */ |
81 | 127 | ||
diff --git a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h index d53bafa9bf1c..fce832820825 100644 --- a/include/asm-arm/assembler.h +++ b/include/asm-arm/assembler.h | |||
@@ -55,30 +55,6 @@ | |||
55 | #define PLD(code...) | 55 | #define PLD(code...) |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #define MODE_USR USR_MODE | ||
59 | #define MODE_FIQ FIQ_MODE | ||
60 | #define MODE_IRQ IRQ_MODE | ||
61 | #define MODE_SVC SVC_MODE | ||
62 | |||
63 | #define DEFAULT_FIQ MODE_FIQ | ||
64 | |||
65 | /* | ||
66 | * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) | ||
67 | */ | ||
68 | #ifdef __STDC__ | ||
69 | #define LOADREGS(cond, base, reglist...)\ | ||
70 | ldm##cond base,reglist | ||
71 | #else | ||
72 | #define LOADREGS(cond, base, reglist...)\ | ||
73 | ldm/**/cond base,reglist | ||
74 | #endif | ||
75 | |||
76 | /* | ||
77 | * Build a return instruction for this processor type. | ||
78 | */ | ||
79 | #define RETINSTR(instr, regs...)\ | ||
80 | instr regs | ||
81 | |||
82 | /* | 58 | /* |
83 | * Enable and disable interrupts | 59 | * Enable and disable interrupts |
84 | */ | 60 | */ |
@@ -117,18 +93,6 @@ | |||
117 | msr cpsr_c, \oldcpsr | 93 | msr cpsr_c, \oldcpsr |
118 | .endm | 94 | .endm |
119 | 95 | ||
120 | /* | ||
121 | * These two are used to save LR/restore PC over a user-based access. | ||
122 | * The old 26-bit architecture requires that we do. On 32-bit | ||
123 | * architecture, we can safely ignore this requirement. | ||
124 | */ | ||
125 | .macro save_lr | ||
126 | .endm | ||
127 | |||
128 | .macro restore_pc | ||
129 | mov pc, lr | ||
130 | .endm | ||
131 | |||
132 | #define USER(x...) \ | 96 | #define USER(x...) \ |
133 | 9999: x; \ | 97 | 9999: x; \ |
134 | .section __ex_table,"a"; \ | 98 | .section __ex_table,"a"; \ |
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-generic/bug.h b/include/asm-generic/bug.h index 845cb67ad8ea..8ceab7bcd8b4 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -51,4 +51,10 @@ | |||
51 | __ret; \ | 51 | __ret; \ |
52 | }) | 52 | }) |
53 | 53 | ||
54 | #ifdef CONFIG_SMP | ||
55 | # define WARN_ON_SMP(x) WARN_ON(x) | ||
56 | #else | ||
57 | # define WARN_ON_SMP(x) do { } while (0) | ||
58 | #endif | ||
59 | |||
54 | #endif | 60 | #endif |
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index d79e9ee10fd7..c61bd1a17f37 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -5,6 +5,8 @@ | |||
5 | 5 | ||
6 | #include <asm/types.h> | 6 | #include <asm/types.h> |
7 | 7 | ||
8 | #include <linux/types.h> | ||
9 | |||
8 | struct alt_instr { | 10 | struct alt_instr { |
9 | u8 *instr; /* original instruction */ | 11 | u8 *instr; /* original instruction */ |
10 | u8 *replacement; | 12 | u8 *replacement; |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 1d8362cb2c5d..2c1e371cebb6 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -111,24 +111,12 @@ extern void init_apic_mappings (void); | |||
111 | extern void smp_local_timer_interrupt (struct pt_regs * regs); | 111 | extern void smp_local_timer_interrupt (struct pt_regs * regs); |
112 | extern void setup_boot_APIC_clock (void); | 112 | extern void setup_boot_APIC_clock (void); |
113 | extern void setup_secondary_APIC_clock (void); | 113 | extern void setup_secondary_APIC_clock (void); |
114 | extern void setup_apic_nmi_watchdog (void); | ||
115 | extern int reserve_lapic_nmi(void); | ||
116 | extern void release_lapic_nmi(void); | ||
117 | extern void disable_timer_nmi_watchdog(void); | ||
118 | extern void enable_timer_nmi_watchdog(void); | ||
119 | extern void nmi_watchdog_tick (struct pt_regs * regs); | ||
120 | extern int APIC_init_uniprocessor (void); | 114 | extern int APIC_init_uniprocessor (void); |
121 | extern void disable_APIC_timer(void); | 115 | extern void disable_APIC_timer(void); |
122 | extern void enable_APIC_timer(void); | 116 | extern void enable_APIC_timer(void); |
123 | 117 | ||
124 | extern void enable_NMI_through_LVT0 (void * dummy); | 118 | extern void enable_NMI_through_LVT0 (void * dummy); |
125 | 119 | ||
126 | extern unsigned int nmi_watchdog; | ||
127 | #define NMI_NONE 0 | ||
128 | #define NMI_IO_APIC 1 | ||
129 | #define NMI_LOCAL_APIC 2 | ||
130 | #define NMI_INVALID 3 | ||
131 | |||
132 | extern int disable_timer_pin_1; | 120 | extern int disable_timer_pin_1; |
133 | 121 | ||
134 | void smp_send_timer_broadcast_ipi(struct pt_regs *regs); | 122 | void smp_send_timer_broadcast_ipi(struct pt_regs *regs); |
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h index e7252c216ca8..b1bc7b1b64b0 100644 --- a/include/asm-i386/cpu.h +++ b/include/asm-i386/cpu.h | |||
@@ -7,8 +7,6 @@ | |||
7 | #include <linux/nodemask.h> | 7 | #include <linux/nodemask.h> |
8 | #include <linux/percpu.h> | 8 | #include <linux/percpu.h> |
9 | 9 | ||
10 | #include <asm/node.h> | ||
11 | |||
12 | struct i386_cpu { | 10 | struct i386_cpu { |
13 | struct cpu cpu; | 11 | struct cpu cpu; |
14 | }; | 12 | }; |
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index 3ecedbafa8ce..d314ebb3d59e 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ | 72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ |
73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ | 73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ |
74 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ | 74 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ |
75 | #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ | ||
75 | 76 | ||
76 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 77 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
77 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 78 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
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/dwarf2.h b/include/asm-i386/dwarf2.h new file mode 100644 index 000000000000..2280f6272f80 --- /dev/null +++ b/include/asm-i386/dwarf2.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef _DWARF2_H | ||
2 | #define _DWARF2_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifndef __ASSEMBLY__ | ||
7 | #warning "asm/dwarf2.h should be only included in pure assembly files" | ||
8 | #endif | ||
9 | |||
10 | /* | ||
11 | Macros for dwarf2 CFI unwind table entries. | ||
12 | See "as.info" for details on these pseudo ops. Unfortunately | ||
13 | they are only supported in very new binutils, so define them | ||
14 | away for older version. | ||
15 | */ | ||
16 | |||
17 | #ifdef CONFIG_UNWIND_INFO | ||
18 | |||
19 | #define CFI_STARTPROC .cfi_startproc | ||
20 | #define CFI_ENDPROC .cfi_endproc | ||
21 | #define CFI_DEF_CFA .cfi_def_cfa | ||
22 | #define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register | ||
23 | #define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset | ||
24 | #define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset | ||
25 | #define CFI_OFFSET .cfi_offset | ||
26 | #define CFI_REL_OFFSET .cfi_rel_offset | ||
27 | #define CFI_REGISTER .cfi_register | ||
28 | #define CFI_RESTORE .cfi_restore | ||
29 | #define CFI_REMEMBER_STATE .cfi_remember_state | ||
30 | #define CFI_RESTORE_STATE .cfi_restore_state | ||
31 | |||
32 | #else | ||
33 | |||
34 | /* Due to the structure of pre-exisiting code, don't use assembler line | ||
35 | comment character # to ignore the arguments. Instead, use a dummy macro. */ | ||
36 | .macro ignore a=0, b=0, c=0, d=0 | ||
37 | .endm | ||
38 | |||
39 | #define CFI_STARTPROC ignore | ||
40 | #define CFI_ENDPROC ignore | ||
41 | #define CFI_DEF_CFA ignore | ||
42 | #define CFI_DEF_CFA_REGISTER ignore | ||
43 | #define CFI_DEF_CFA_OFFSET ignore | ||
44 | #define CFI_ADJUST_CFA_OFFSET ignore | ||
45 | #define CFI_OFFSET ignore | ||
46 | #define CFI_REL_OFFSET ignore | ||
47 | #define CFI_REGISTER ignore | ||
48 | #define CFI_RESTORE ignore | ||
49 | #define CFI_REMEMBER_STATE ignore | ||
50 | #define CFI_RESTORE_STATE ignore | ||
51 | |||
52 | #endif | ||
53 | |||
54 | #endif | ||
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 4153d80e4d2b..1eac92cb5b16 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
11 | #include <asm/system.h> /* for savesegment */ | 11 | #include <asm/system.h> /* for savesegment */ |
12 | #include <asm/auxvec.h> | 12 | #include <asm/auxvec.h> |
13 | #include <asm/desc.h> | ||
13 | 14 | ||
14 | #include <linux/utsname.h> | 15 | #include <linux/utsname.h> |
15 | 16 | ||
@@ -129,15 +130,41 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct | |||
129 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | 130 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) |
130 | #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) | 131 | #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) |
131 | 132 | ||
132 | #define VSYSCALL_BASE (__fix_to_virt(FIX_VSYSCALL)) | 133 | #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) |
133 | #define VSYSCALL_EHDR ((const struct elfhdr *) VSYSCALL_BASE) | 134 | #define VDSO_BASE ((unsigned long)current->mm->context.vdso) |
134 | #define VSYSCALL_ENTRY ((unsigned long) &__kernel_vsyscall) | 135 | |
136 | #ifdef CONFIG_COMPAT_VDSO | ||
137 | # define VDSO_COMPAT_BASE VDSO_HIGH_BASE | ||
138 | # define VDSO_PRELINK VDSO_HIGH_BASE | ||
139 | #else | ||
140 | # define VDSO_COMPAT_BASE VDSO_BASE | ||
141 | # define VDSO_PRELINK 0 | ||
142 | #endif | ||
143 | |||
144 | #define VDSO_COMPAT_SYM(x) \ | ||
145 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) | ||
146 | |||
147 | #define VDSO_SYM(x) \ | ||
148 | (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK) | ||
149 | |||
150 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) | ||
151 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) | ||
152 | |||
135 | extern void __kernel_vsyscall; | 153 | extern void __kernel_vsyscall; |
136 | 154 | ||
155 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) | ||
156 | |||
157 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | ||
158 | struct linux_binprm; | ||
159 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | ||
160 | int executable_stack); | ||
161 | |||
162 | extern unsigned int vdso_enabled; | ||
163 | |||
137 | #define ARCH_DLINFO \ | 164 | #define ARCH_DLINFO \ |
138 | do { \ | 165 | do if (vdso_enabled) { \ |
139 | NEW_AUX_ENT(AT_SYSINFO, VSYSCALL_ENTRY); \ | 166 | NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ |
140 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE); \ | 167 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ |
141 | } while (0) | 168 | } while (0) |
142 | 169 | ||
143 | /* | 170 | /* |
@@ -148,15 +175,15 @@ do { \ | |||
148 | * Dumping its extra ELF program headers includes all the other information | 175 | * Dumping its extra ELF program headers includes all the other information |
149 | * a debugger needs to easily find how the vsyscall DSO was being used. | 176 | * a debugger needs to easily find how the vsyscall DSO was being used. |
150 | */ | 177 | */ |
151 | #define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum) | 178 | #define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum) |
152 | #define ELF_CORE_WRITE_EXTRA_PHDRS \ | 179 | #define ELF_CORE_WRITE_EXTRA_PHDRS \ |
153 | do { \ | 180 | do { \ |
154 | const struct elf_phdr *const vsyscall_phdrs = \ | 181 | const struct elf_phdr *const vsyscall_phdrs = \ |
155 | (const struct elf_phdr *) (VSYSCALL_BASE \ | 182 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ |
156 | + VSYSCALL_EHDR->e_phoff); \ | 183 | + VDSO_HIGH_EHDR->e_phoff); \ |
157 | int i; \ | 184 | int i; \ |
158 | Elf32_Off ofs = 0; \ | 185 | Elf32_Off ofs = 0; \ |
159 | for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ | 186 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ |
160 | struct elf_phdr phdr = vsyscall_phdrs[i]; \ | 187 | struct elf_phdr phdr = vsyscall_phdrs[i]; \ |
161 | if (phdr.p_type == PT_LOAD) { \ | 188 | if (phdr.p_type == PT_LOAD) { \ |
162 | BUG_ON(ofs != 0); \ | 189 | BUG_ON(ofs != 0); \ |
@@ -174,10 +201,10 @@ do { \ | |||
174 | #define ELF_CORE_WRITE_EXTRA_DATA \ | 201 | #define ELF_CORE_WRITE_EXTRA_DATA \ |
175 | do { \ | 202 | do { \ |
176 | const struct elf_phdr *const vsyscall_phdrs = \ | 203 | const struct elf_phdr *const vsyscall_phdrs = \ |
177 | (const struct elf_phdr *) (VSYSCALL_BASE \ | 204 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ |
178 | + VSYSCALL_EHDR->e_phoff); \ | 205 | + VDSO_HIGH_EHDR->e_phoff); \ |
179 | int i; \ | 206 | int i; \ |
180 | for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ | 207 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ |
181 | if (vsyscall_phdrs[i].p_type == PT_LOAD) \ | 208 | if (vsyscall_phdrs[i].p_type == PT_LOAD) \ |
182 | DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ | 209 | DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ |
183 | PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ | 210 | PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ |
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index f7e068f4d2f9..a48cc3f7ccc6 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h | |||
@@ -51,7 +51,7 @@ | |||
51 | */ | 51 | */ |
52 | enum fixed_addresses { | 52 | enum fixed_addresses { |
53 | FIX_HOLE, | 53 | FIX_HOLE, |
54 | FIX_VSYSCALL, | 54 | FIX_VDSO, |
55 | #ifdef CONFIG_X86_LOCAL_APIC | 55 | #ifdef CONFIG_X86_LOCAL_APIC |
56 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 56 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
57 | #endif | 57 | #endif |
@@ -115,14 +115,6 @@ extern void __set_fixmap (enum fixed_addresses idx, | |||
115 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) | 115 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) |
116 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) | 116 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) |
117 | 117 | ||
118 | /* | ||
119 | * This is the range that is readable by user mode, and things | ||
120 | * acting like user mode such as get_user_pages. | ||
121 | */ | ||
122 | #define FIXADDR_USER_START (__fix_to_virt(FIX_VSYSCALL)) | ||
123 | #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) | ||
124 | |||
125 | |||
126 | extern void __this_fixmap_does_not_exist(void); | 118 | extern void __this_fixmap_does_not_exist(void); |
127 | 119 | ||
128 | /* | 120 | /* |
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 95d3fd090298..a4c0a5a9ffd8 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | struct hw_interrupt_type; | 20 | struct hw_interrupt_type; |
21 | 21 | ||
22 | #define NMI_VECTOR 0x02 | ||
23 | |||
22 | /* | 24 | /* |
23 | * Various low-level irq details needed by irq.c, process.c, | 25 | * Various low-level irq details needed by irq.c, process.c, |
24 | * time.c, io_apic.c and smp.c | 26 | * time.c, io_apic.c and smp.c |
diff --git a/include/asm-i386/intel_arch_perfmon.h b/include/asm-i386/intel_arch_perfmon.h new file mode 100644 index 000000000000..134ea9cc5283 --- /dev/null +++ b/include/asm-i386/intel_arch_perfmon.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef X86_INTEL_ARCH_PERFMON_H | ||
2 | #define X86_INTEL_ARCH_PERFMON_H 1 | ||
3 | |||
4 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 | ||
5 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 | ||
6 | |||
7 | #define MSR_ARCH_PERFMON_EVENTSEL0 0x186 | ||
8 | #define MSR_ARCH_PERFMON_EVENTSEL1 0x187 | ||
9 | |||
10 | #define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) | ||
11 | #define ARCH_PERFMON_EVENTSEL_INT (1 << 20) | ||
12 | #define ARCH_PERFMON_EVENTSEL_OS (1 << 17) | ||
13 | #define ARCH_PERFMON_EVENTSEL_USR (1 << 16) | ||
14 | |||
15 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) | ||
16 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) | ||
17 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT (1 << 0) | ||
18 | |||
19 | #endif /* X86_INTEL_ARCH_PERFMON_H */ | ||
diff --git a/include/asm-i386/k8.h b/include/asm-i386/k8.h new file mode 100644 index 000000000000..dfd88a6e6040 --- /dev/null +++ b/include/asm-i386/k8.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-x86_64/k8.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/local.h b/include/asm-i386/local.h index e67fa08260fe..3b4998c51d08 100644 --- a/include/asm-i386/local.h +++ b/include/asm-i386/local.h | |||
@@ -55,12 +55,26 @@ static __inline__ void local_sub(long i, local_t *v) | |||
55 | * much more efficient than these naive implementations. Note they take | 55 | * much more efficient than these naive implementations. Note they take |
56 | * a variable, not an address. | 56 | * a variable, not an address. |
57 | */ | 57 | */ |
58 | #define cpu_local_read(v) local_read(&__get_cpu_var(v)) | 58 | |
59 | #define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) | 59 | /* Need to disable preemption for the cpu local counters otherwise we could |
60 | #define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) | 60 | still access a variable of a previous CPU in a non atomic way. */ |
61 | #define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) | 61 | #define cpu_local_wrap_v(v) \ |
62 | #define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) | 62 | ({ local_t res__; \ |
63 | #define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) | 63 | preempt_disable(); \ |
64 | res__ = (v); \ | ||
65 | preempt_enable(); \ | ||
66 | res__; }) | ||
67 | #define cpu_local_wrap(v) \ | ||
68 | ({ preempt_disable(); \ | ||
69 | v; \ | ||
70 | preempt_enable(); }) \ | ||
71 | |||
72 | #define cpu_local_read(v) cpu_local_wrap_v(local_read(&__get_cpu_var(v))) | ||
73 | #define cpu_local_set(v, i) cpu_local_wrap(local_set(&__get_cpu_var(v), (i))) | ||
74 | #define cpu_local_inc(v) cpu_local_wrap(local_inc(&__get_cpu_var(v))) | ||
75 | #define cpu_local_dec(v) cpu_local_wrap(local_dec(&__get_cpu_var(v))) | ||
76 | #define cpu_local_add(i, v) cpu_local_wrap(local_add((i), &__get_cpu_var(v))) | ||
77 | #define cpu_local_sub(i, v) cpu_local_wrap(local_sub((i), &__get_cpu_var(v))) | ||
64 | 78 | ||
65 | #define __cpu_local_inc(v) cpu_local_inc(v) | 79 | #define __cpu_local_inc(v) cpu_local_inc(v) |
66 | #define __cpu_local_dec(v) cpu_local_dec(v) | 80 | #define __cpu_local_dec(v) cpu_local_dec(v) |
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h index a1d0072e36bc..0dba244c86db 100644 --- a/include/asm-i386/mach-default/mach_ipi.h +++ b/include/asm-i386/mach-default/mach_ipi.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __ASM_MACH_IPI_H | 1 | #ifndef __ASM_MACH_IPI_H |
2 | #define __ASM_MACH_IPI_H | 2 | #define __ASM_MACH_IPI_H |
3 | 3 | ||
4 | /* Avoid include hell */ | ||
5 | #define NMI_VECTOR 0x02 | ||
6 | |||
4 | void send_IPI_mask_bitmask(cpumask_t mask, int vector); | 7 | void send_IPI_mask_bitmask(cpumask_t mask, int vector); |
5 | void __send_IPI_shortcut(unsigned int shortcut, int vector); | 8 | void __send_IPI_shortcut(unsigned int shortcut, int vector); |
6 | 9 | ||
@@ -13,7 +16,7 @@ static inline void send_IPI_mask(cpumask_t mask, int vector) | |||
13 | 16 | ||
14 | static inline void __local_send_IPI_allbutself(int vector) | 17 | static inline void __local_send_IPI_allbutself(int vector) |
15 | { | 18 | { |
16 | if (no_broadcast) { | 19 | if (no_broadcast || vector == NMI_VECTOR) { |
17 | cpumask_t mask = cpu_online_map; | 20 | cpumask_t mask = cpu_online_map; |
18 | 21 | ||
19 | cpu_clear(smp_processor_id(), mask); | 22 | cpu_clear(smp_processor_id(), mask); |
@@ -24,7 +27,7 @@ static inline void __local_send_IPI_allbutself(int vector) | |||
24 | 27 | ||
25 | static inline void __local_send_IPI_all(int vector) | 28 | static inline void __local_send_IPI_all(int vector) |
26 | { | 29 | { |
27 | if (no_broadcast) | 30 | if (no_broadcast || vector == NMI_VECTOR) |
28 | send_IPI_mask(cpu_online_map, vector); | 31 | send_IPI_mask(cpu_online_map, vector); |
29 | else | 32 | else |
30 | __send_IPI_shortcut(APIC_DEST_ALLINC, vector); | 33 | __send_IPI_shortcut(APIC_DEST_ALLINC, vector); |
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/mmu.h b/include/asm-i386/mmu.h index f431a0b86d4c..8358dd3df7aa 100644 --- a/include/asm-i386/mmu.h +++ b/include/asm-i386/mmu.h | |||
@@ -12,6 +12,7 @@ typedef struct { | |||
12 | int size; | 12 | int size; |
13 | struct semaphore sem; | 13 | struct semaphore sem; |
14 | void *ldt; | 14 | void *ldt; |
15 | void *vdso; | ||
15 | } mm_context_t; | 16 | } mm_context_t; |
16 | 17 | ||
17 | #endif | 18 | #endif |
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h index 21f16638fc61..67d994799999 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-i386/nmi.h | |||
@@ -5,24 +5,38 @@ | |||
5 | #define ASM_NMI_H | 5 | #define ASM_NMI_H |
6 | 6 | ||
7 | #include <linux/pm.h> | 7 | #include <linux/pm.h> |
8 | 8 | ||
9 | struct pt_regs; | 9 | struct pt_regs; |
10 | 10 | ||
11 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); | 11 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * set_nmi_callback | 14 | * set_nmi_callback |
15 | * | 15 | * |
16 | * Set a handler for an NMI. Only one handler may be | 16 | * Set a handler for an NMI. Only one handler may be |
17 | * set. Return 1 if the NMI was handled. | 17 | * set. Return 1 if the NMI was handled. |
18 | */ | 18 | */ |
19 | void set_nmi_callback(nmi_callback_t callback); | 19 | void set_nmi_callback(nmi_callback_t callback); |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * unset_nmi_callback | 22 | * unset_nmi_callback |
23 | * | 23 | * |
24 | * Remove the handler previously set. | 24 | * Remove the handler previously set. |
25 | */ | 25 | */ |
26 | void unset_nmi_callback(void); | 26 | void unset_nmi_callback(void); |
27 | 27 | ||
28 | extern void setup_apic_nmi_watchdog (void); | ||
29 | extern int reserve_lapic_nmi(void); | ||
30 | extern void release_lapic_nmi(void); | ||
31 | extern void disable_timer_nmi_watchdog(void); | ||
32 | extern void enable_timer_nmi_watchdog(void); | ||
33 | extern void nmi_watchdog_tick (struct pt_regs * regs); | ||
34 | |||
35 | extern unsigned int nmi_watchdog; | ||
36 | #define NMI_DEFAULT -1 | ||
37 | #define NMI_NONE 0 | ||
38 | #define NMI_IO_APIC 1 | ||
39 | #define NMI_LOCAL_APIC 2 | ||
40 | #define NMI_INVALID 3 | ||
41 | |||
28 | #endif /* ASM_NMI_H */ | 42 | #endif /* ASM_NMI_H */ |
diff --git a/include/asm-i386/node.h b/include/asm-i386/node.h deleted file mode 100644 index e13c6ffa72ae..000000000000 --- a/include/asm-i386/node.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifndef _ASM_I386_NODE_H_ | ||
2 | #define _ASM_I386_NODE_H_ | ||
3 | |||
4 | #include <linux/device.h> | ||
5 | #include <linux/mmzone.h> | ||
6 | #include <linux/node.h> | ||
7 | #include <linux/topology.h> | ||
8 | #include <linux/nodemask.h> | ||
9 | |||
10 | struct i386_node { | ||
11 | struct node node; | ||
12 | }; | ||
13 | extern struct i386_node node_devices[MAX_NUMNODES]; | ||
14 | |||
15 | static inline int arch_register_node(int num){ | ||
16 | int p_node; | ||
17 | struct node *parent = NULL; | ||
18 | |||
19 | if (!node_online(num)) | ||
20 | return 0; | ||
21 | p_node = parent_node(num); | ||
22 | |||
23 | if (p_node != num) | ||
24 | parent = &node_devices[p_node].node; | ||
25 | |||
26 | return register_node(&node_devices[num].node, num, parent); | ||
27 | } | ||
28 | |||
29 | #endif /* _ASM_I386_NODE_H_ */ | ||
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index e3a552fa5538..f5bf544c729a 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
@@ -96,6 +96,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
96 | 96 | ||
97 | #ifndef __ASSEMBLY__ | 97 | #ifndef __ASSEMBLY__ |
98 | 98 | ||
99 | struct vm_area_struct; | ||
100 | |||
99 | /* | 101 | /* |
100 | * This much address space is reserved for vmalloc() and iomap() | 102 | * This much address space is reserved for vmalloc() and iomap() |
101 | * as well as fixmap mappings. | 103 | * as well as fixmap mappings. |
@@ -139,6 +141,7 @@ extern int page_is_ram(unsigned long pagenr); | |||
139 | #include <asm-generic/memory_model.h> | 141 | #include <asm-generic/memory_model.h> |
140 | #include <asm-generic/page.h> | 142 | #include <asm-generic/page.h> |
141 | 143 | ||
144 | #define __HAVE_ARCH_GATE_AREA 1 | ||
142 | #endif /* __KERNEL__ */ | 145 | #endif /* __KERNEL__ */ |
143 | 146 | ||
144 | #endif /* _I386_PAGE_H */ | 147 | #endif /* _I386_PAGE_H */ |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 0c83cf12eec9..b32346d62e10 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -71,8 +71,12 @@ struct cpuinfo_x86 { | |||
71 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ | 71 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ |
72 | #endif | 72 | #endif |
73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | 73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ |
74 | unsigned char booted_cores; /* number of cores as seen by OS */ | ||
75 | unsigned char apicid; | 74 | unsigned char apicid; |
75 | #ifdef CONFIG_SMP | ||
76 | unsigned char booted_cores; /* number of cores as seen by OS */ | ||
77 | __u8 phys_proc_id; /* Physical processor id. */ | ||
78 | __u8 cpu_core_id; /* Core id */ | ||
79 | #endif | ||
76 | } __attribute__((__aligned__(SMP_CACHE_BYTES))); | 80 | } __attribute__((__aligned__(SMP_CACHE_BYTES))); |
77 | 81 | ||
78 | #define X86_VENDOR_INTEL 0 | 82 | #define X86_VENDOR_INTEL 0 |
@@ -104,14 +108,13 @@ extern struct cpuinfo_x86 cpu_data[]; | |||
104 | #define current_cpu_data boot_cpu_data | 108 | #define current_cpu_data boot_cpu_data |
105 | #endif | 109 | #endif |
106 | 110 | ||
107 | extern int phys_proc_id[NR_CPUS]; | ||
108 | extern int cpu_core_id[NR_CPUS]; | ||
109 | extern int cpu_llc_id[NR_CPUS]; | 111 | extern int cpu_llc_id[NR_CPUS]; |
110 | extern char ignore_fpu_irq; | 112 | extern char ignore_fpu_irq; |
111 | 113 | ||
112 | extern void identify_cpu(struct cpuinfo_x86 *); | 114 | extern void identify_cpu(struct cpuinfo_x86 *); |
113 | extern void print_cpu_info(struct cpuinfo_x86 *); | 115 | extern void print_cpu_info(struct cpuinfo_x86 *); |
114 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 116 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
117 | extern unsigned short num_cache_leaves; | ||
115 | 118 | ||
116 | #ifdef CONFIG_X86_HT | 119 | #ifdef CONFIG_X86_HT |
117 | extern void detect_ht(struct cpuinfo_x86 *c); | 120 | extern void detect_ht(struct cpuinfo_x86 *c); |
@@ -554,7 +557,7 @@ extern void prepare_to_copy(struct task_struct *tsk); | |||
554 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | 557 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
555 | 558 | ||
556 | extern unsigned long thread_saved_pc(struct task_struct *tsk); | 559 | extern unsigned long thread_saved_pc(struct task_struct *tsk); |
557 | void show_trace(struct task_struct *task, unsigned long *stack); | 560 | void show_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack); |
558 | 561 | ||
559 | unsigned long get_wchan(struct task_struct *p); | 562 | unsigned long get_wchan(struct task_struct *p); |
560 | 563 | ||
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 0249f912a29c..cab0180567f9 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -427,7 +427,7 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l | |||
427 | * does not enforce ordering, since there is no data dependency between | 427 | * does not enforce ordering, since there is no data dependency between |
428 | * the read of "a" and the read of "b". Therefore, on some CPUs, such | 428 | * the read of "a" and the read of "b". Therefore, on some CPUs, such |
429 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() | 429 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() |
430 | * in cases like thiswhere there are no data dependencies. | 430 | * in cases like this where there are no data dependencies. |
431 | **/ | 431 | **/ |
432 | 432 | ||
433 | #define read_barrier_depends() do { } while(0) | 433 | #define read_barrier_depends() do { } while(0) |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 8420ed12491e..2833fa2c0dd0 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h | |||
@@ -37,6 +37,7 @@ struct thread_info { | |||
37 | 0-0xBFFFFFFF for user-thead | 37 | 0-0xBFFFFFFF for user-thead |
38 | 0-0xFFFFFFFF for kernel-thread | 38 | 0-0xFFFFFFFF for kernel-thread |
39 | */ | 39 | */ |
40 | void *sysenter_return; | ||
40 | struct restart_block restart_block; | 41 | struct restart_block restart_block; |
41 | 42 | ||
42 | unsigned long previous_esp; /* ESP of the previous stack in case | 43 | unsigned long previous_esp; /* ESP of the previous stack in case |
@@ -83,17 +84,15 @@ struct thread_info { | |||
83 | #define init_stack (init_thread_union.stack) | 84 | #define init_stack (init_thread_union.stack) |
84 | 85 | ||
85 | 86 | ||
87 | /* how to get the current stack pointer from C */ | ||
88 | register unsigned long current_stack_pointer asm("esp") __attribute_used__; | ||
89 | |||
86 | /* how to get the thread information struct from C */ | 90 | /* how to get the thread information struct from C */ |
87 | static inline struct thread_info *current_thread_info(void) | 91 | static inline struct thread_info *current_thread_info(void) |
88 | { | 92 | { |
89 | struct thread_info *ti; | 93 | return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1)); |
90 | __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1))); | ||
91 | return ti; | ||
92 | } | 94 | } |
93 | 95 | ||
94 | /* how to get the current stack pointer from C */ | ||
95 | register unsigned long current_stack_pointer asm("esp") __attribute_used__; | ||
96 | |||
97 | /* thread information allocation */ | 96 | /* thread information allocation */ |
98 | #ifdef CONFIG_DEBUG_STACK_USAGE | 97 | #ifdef CONFIG_DEBUG_STACK_USAGE |
99 | #define alloc_thread_info(tsk) \ | 98 | #define alloc_thread_info(tsk) \ |
@@ -140,8 +139,7 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; | |||
140 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 139 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
141 | #define TIF_SECCOMP 8 /* secure computing */ | 140 | #define TIF_SECCOMP 8 /* secure computing */ |
142 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ | 141 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ |
143 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 142 | #define TIF_MEMDIE 16 |
144 | #define TIF_MEMDIE 17 | ||
145 | 143 | ||
146 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 144 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
147 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 145 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
@@ -153,7 +151,6 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; | |||
153 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 151 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
154 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 152 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
155 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 153 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
156 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
157 | 154 | ||
158 | /* work to do on interrupt/exception return */ | 155 | /* work to do on interrupt/exception return */ |
159 | #define _TIF_WORK_MASK \ | 156 | #define _TIF_WORK_MASK \ |
@@ -170,6 +167,9 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; | |||
170 | * have to worry about atomic accesses. | 167 | * have to worry about atomic accesses. |
171 | */ | 168 | */ |
172 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 169 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
170 | #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ | ||
171 | |||
172 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | ||
173 | 173 | ||
174 | #endif /* __KERNEL__ */ | 174 | #endif /* __KERNEL__ */ |
175 | 175 | ||
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/topology.h b/include/asm-i386/topology.h index b94e5eeef917..6adbd9b1ae88 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h | |||
@@ -28,10 +28,8 @@ | |||
28 | #define _ASM_I386_TOPOLOGY_H | 28 | #define _ASM_I386_TOPOLOGY_H |
29 | 29 | ||
30 | #ifdef CONFIG_X86_HT | 30 | #ifdef CONFIG_X86_HT |
31 | #define topology_physical_package_id(cpu) \ | 31 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) |
32 | (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) | 32 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) |
33 | #define topology_core_id(cpu) \ | ||
34 | (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu]) | ||
35 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 33 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) |
36 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 34 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) |
37 | #endif | 35 | #endif |
@@ -114,4 +112,9 @@ extern unsigned long node_remap_size[]; | |||
114 | 112 | ||
115 | extern cpumask_t cpu_coregroup_map(int cpu); | 113 | extern cpumask_t cpu_coregroup_map(int cpu); |
116 | 114 | ||
115 | #ifdef CONFIG_SMP | ||
116 | #define mc_capable() (boot_cpu_data.x86_max_cores > 1) | ||
117 | #define smt_capable() (smp_num_siblings > 1) | ||
118 | #endif | ||
119 | |||
117 | #endif /* _ASM_I386_TOPOLOGY_H */ | 120 | #endif /* _ASM_I386_TOPOLOGY_H */ |
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-i386/unwind.h b/include/asm-i386/unwind.h new file mode 100644 index 000000000000..69f0f1df6722 --- /dev/null +++ b/include/asm-i386/unwind.h | |||
@@ -0,0 +1,98 @@ | |||
1 | #ifndef _ASM_I386_UNWIND_H | ||
2 | #define _ASM_I386_UNWIND_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
6 | * Jan Beulich <jbeulich@novell.com> | ||
7 | * This code is released under version 2 of the GNU GPL. | ||
8 | */ | ||
9 | |||
10 | #ifdef CONFIG_STACK_UNWIND | ||
11 | |||
12 | #include <linux/sched.h> | ||
13 | #include <asm/fixmap.h> | ||
14 | #include <asm/ptrace.h> | ||
15 | #include <asm/uaccess.h> | ||
16 | |||
17 | struct unwind_frame_info | ||
18 | { | ||
19 | struct pt_regs regs; | ||
20 | struct task_struct *task; | ||
21 | }; | ||
22 | |||
23 | #define UNW_PC(frame) (frame)->regs.eip | ||
24 | #define UNW_SP(frame) (frame)->regs.esp | ||
25 | #ifdef CONFIG_FRAME_POINTER | ||
26 | #define UNW_FP(frame) (frame)->regs.ebp | ||
27 | #define FRAME_RETADDR_OFFSET 4 | ||
28 | #define FRAME_LINK_OFFSET 0 | ||
29 | #define STACK_BOTTOM(tsk) STACK_LIMIT((tsk)->thread.esp0) | ||
30 | #define STACK_TOP(tsk) ((tsk)->thread.esp0) | ||
31 | #endif | ||
32 | #define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1)) | ||
33 | |||
34 | #define UNW_REGISTER_INFO \ | ||
35 | PTREGS_INFO(eax), \ | ||
36 | PTREGS_INFO(ecx), \ | ||
37 | PTREGS_INFO(edx), \ | ||
38 | PTREGS_INFO(ebx), \ | ||
39 | PTREGS_INFO(esp), \ | ||
40 | PTREGS_INFO(ebp), \ | ||
41 | PTREGS_INFO(esi), \ | ||
42 | PTREGS_INFO(edi), \ | ||
43 | PTREGS_INFO(eip) | ||
44 | |||
45 | static inline void arch_unw_init_frame_info(struct unwind_frame_info *info, | ||
46 | /*const*/ struct pt_regs *regs) | ||
47 | { | ||
48 | if (user_mode_vm(regs)) | ||
49 | info->regs = *regs; | ||
50 | else { | ||
51 | memcpy(&info->regs, regs, offsetof(struct pt_regs, esp)); | ||
52 | info->regs.esp = (unsigned long)®s->esp; | ||
53 | info->regs.xss = __KERNEL_DS; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | static inline void arch_unw_init_blocked(struct unwind_frame_info *info) | ||
58 | { | ||
59 | memset(&info->regs, 0, sizeof(info->regs)); | ||
60 | info->regs.eip = info->task->thread.eip; | ||
61 | info->regs.xcs = __KERNEL_CS; | ||
62 | __get_user(info->regs.ebp, (long *)info->task->thread.esp); | ||
63 | info->regs.esp = info->task->thread.esp; | ||
64 | info->regs.xss = __KERNEL_DS; | ||
65 | info->regs.xds = __USER_DS; | ||
66 | info->regs.xes = __USER_DS; | ||
67 | } | ||
68 | |||
69 | extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *, | ||
70 | asmlinkage int (*callback)(struct unwind_frame_info *, | ||
71 | void *arg), | ||
72 | void *arg); | ||
73 | |||
74 | static inline int arch_unw_user_mode(const struct unwind_frame_info *info) | ||
75 | { | ||
76 | #if 0 /* This can only work when selector register and EFLAGS saves/restores | ||
77 | are properly annotated (and tracked in UNW_REGISTER_INFO). */ | ||
78 | return user_mode_vm(&info->regs); | ||
79 | #else | ||
80 | return info->regs.eip < PAGE_OFFSET | ||
81 | || (info->regs.eip >= __fix_to_virt(FIX_VDSO) | ||
82 | && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE) | ||
83 | || info->regs.esp < PAGE_OFFSET; | ||
84 | #endif | ||
85 | } | ||
86 | |||
87 | #else | ||
88 | |||
89 | #define UNW_PC(frame) ((void)(frame), 0) | ||
90 | |||
91 | static inline int arch_unw_user_mode(const void *info) | ||
92 | { | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | #endif /* _ASM_I386_UNWIND_H */ | ||
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-ia64/nodedata.h b/include/asm-ia64/nodedata.h index a140310bf84d..2fb337b0e9b7 100644 --- a/include/asm-ia64/nodedata.h +++ b/include/asm-ia64/nodedata.h | |||
@@ -46,6 +46,18 @@ struct ia64_node_data { | |||
46 | */ | 46 | */ |
47 | #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) | 47 | #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) |
48 | 48 | ||
49 | /* | ||
50 | * LOCAL_DATA_ADDR - This is to calculate the address of other node's | ||
51 | * "local_node_data" at hot-plug phase. The local_node_data | ||
52 | * is pointed by per_cpu_page. Kernel usually use it for | ||
53 | * just executing cpu. However, when new node is hot-added, | ||
54 | * the addresses of local data for other nodes are necessary | ||
55 | * to update all of them. | ||
56 | */ | ||
57 | #define LOCAL_DATA_ADDR(pgdat) \ | ||
58 | ((struct ia64_node_data *)((u64)(pgdat) + \ | ||
59 | L1_CACHE_ALIGN(sizeof(struct pglist_data)))) | ||
60 | |||
49 | #endif /* CONFIG_NUMA */ | 61 | #endif /* CONFIG_NUMA */ |
50 | 62 | ||
51 | #endif /* _ASM_IA64_NODEDATA_H */ | 63 | #endif /* _ASM_IA64_NODEDATA_H */ |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index e5392c4d30c6..8bc9869e5765 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -27,6 +27,7 @@ struct thread_info { | |||
27 | __u32 flags; /* thread_info flags (see TIF_*) */ | 27 | __u32 flags; /* thread_info flags (see TIF_*) */ |
28 | __u32 cpu; /* current CPU */ | 28 | __u32 cpu; /* current CPU */ |
29 | __u32 last_cpu; /* Last CPU thread ran on */ | 29 | __u32 last_cpu; /* Last CPU thread ran on */ |
30 | __u32 status; /* Thread synchronous flags */ | ||
30 | mm_segment_t addr_limit; /* user-level address space limit */ | 31 | mm_segment_t addr_limit; /* user-level address space limit */ |
31 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ | 32 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ |
32 | struct restart_block restart_block; | 33 | struct restart_block restart_block; |
@@ -103,4 +104,8 @@ struct thread_info { | |||
103 | /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ | 104 | /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ |
104 | #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) | 105 | #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) |
105 | 106 | ||
107 | #define TS_POLLING 1 /* true if in idle loop and not sleeping */ | ||
108 | |||
109 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | ||
110 | |||
106 | #endif /* _ASM_IA64_THREAD_INFO_H */ | 111 | #endif /* _ASM_IA64_THREAD_INFO_H */ |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 616b5ed2aa72..937c21257523 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -112,6 +112,7 @@ void build_cpu_to_node_map(void); | |||
112 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) | 112 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) |
113 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 113 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) |
114 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 114 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) |
115 | #define smt_capable() (smp_num_siblings > 1) | ||
115 | #endif | 116 | #endif |
116 | 117 | ||
117 | #include <asm-generic/topology.h> | 118 | #include <asm-generic/topology.h> |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index 33567e8bfe6b..66c4742f09e7 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -318,7 +318,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
318 | * does not enforce ordering, since there is no data dependency between | 318 | * does not enforce ordering, since there is no data dependency between |
319 | * the read of "a" and the read of "b". Therefore, on some CPUs, such | 319 | * the read of "a" and the read of "b". Therefore, on some CPUs, such |
320 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() | 320 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() |
321 | * in cases like thiswhere there are no data dependencies. | 321 | * in cases like this where there are no data dependencies. |
322 | **/ | 322 | **/ |
323 | 323 | ||
324 | #define read_barrier_depends() do { } while (0) | 324 | #define read_barrier_depends() do { } while (0) |
diff --git a/include/asm-m68knommu/page_offset.h b/include/asm-m68knommu/page_offset.h index 8ed6d7b7d9d1..d4e73e0ba646 100644 --- a/include/asm-m68knommu/page_offset.h +++ b/include/asm-m68knommu/page_offset.h | |||
@@ -1,46 +1,5 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | /* This handles the memory map.. */ | 3 | /* This handles the memory map.. */ |
4 | 4 | #define PAGE_OFFSET_RAW CONFIG_RAMBASE | |
5 | #ifdef CONFIG_COLDFIRE | ||
6 | #if defined(CONFIG_SMALL) | ||
7 | #define PAGE_OFFSET_RAW 0x30020000 | ||
8 | #elif defined(CONFIG_CFV240) | ||
9 | #define PAGE_OFFSET_RAW 0x02000000 | ||
10 | #else | ||
11 | #define PAGE_OFFSET_RAW 0x00000000 | ||
12 | #endif | ||
13 | #endif | ||
14 | |||
15 | #ifdef CONFIG_M68360 | ||
16 | #define PAGE_OFFSET_RAW 0x00000000 | ||
17 | #endif | ||
18 | |||
19 | #ifdef CONFIG_PILOT | ||
20 | #ifdef CONFIG_M68328 | ||
21 | #define PAGE_OFFSET_RAW 0x10000000 | ||
22 | #endif | ||
23 | #ifdef CONFIG_M68EZ328 | ||
24 | #define PAGE_OFFSET_RAW 0x00000000 | ||
25 | #endif | ||
26 | #endif | ||
27 | #ifdef CONFIG_UCSIMM | ||
28 | #define PAGE_OFFSET_RAW 0x00000000 | ||
29 | #endif | ||
30 | |||
31 | #if defined(CONFIG_UCDIMM) || defined(CONFIG_DRAGEN2) | ||
32 | #ifdef CONFIG_M68VZ328 | ||
33 | #define PAGE_OFFSET_RAW 0x00000000 | ||
34 | #endif /* CONFIG_M68VZ328 */ | ||
35 | #endif /* CONFIG_UCDIMM */ | ||
36 | |||
37 | #ifdef CONFIG_M68EZ328ADS | ||
38 | #define PAGE_OFFSET_RAW 0x00000000 | ||
39 | #endif | ||
40 | #ifdef CONFIG_ALMA_ANS | ||
41 | #define PAGE_OFFSET_RAW 0x00000000 | ||
42 | #endif | ||
43 | #ifdef CONFIG_M68EN302 | ||
44 | #define PAGE_OFFSET_RAW 0x00000000 | ||
45 | #endif | ||
46 | 5 | ||
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h index 1e19c457de7d..47258e86e8c4 100644 --- a/include/asm-m68knommu/ptrace.h +++ b/include/asm-m68knommu/ptrace.h | |||
@@ -46,11 +46,9 @@ struct pt_regs { | |||
46 | #else | 46 | #else |
47 | unsigned short sr; | 47 | unsigned short sr; |
48 | unsigned long pc; | 48 | unsigned long pc; |
49 | #ifndef NO_FORMAT_VEC | ||
50 | unsigned format : 4; /* frame format specifier */ | 49 | unsigned format : 4; /* frame format specifier */ |
51 | unsigned vector : 12; /* vector offset */ | 50 | unsigned vector : 12; /* vector offset */ |
52 | #endif | 51 | #endif |
53 | #endif | ||
54 | }; | 52 | }; |
55 | 53 | ||
56 | /* | 54 | /* |
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-powerpc/topology.h b/include/asm-powerpc/topology.h index 92f3e5507d22..bbc3844b086f 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -93,5 +93,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
93 | 93 | ||
94 | #endif /* CONFIG_NUMA */ | 94 | #endif /* CONFIG_NUMA */ |
95 | 95 | ||
96 | #ifdef CONFIG_SMP | ||
97 | #include <asm/cputable.h> | ||
98 | #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) | ||
99 | #endif | ||
100 | |||
96 | #endif /* __KERNEL__ */ | 101 | #endif /* __KERNEL__ */ |
97 | #endif /* _ASM_POWERPC_TOPOLOGY_H */ | 102 | #endif /* _ASM_POWERPC_TOPOLOGY_H */ |
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h index a42df208d590..cab0b851b8b1 100644 --- a/include/asm-sparc/io.h +++ b/include/asm-sparc/io.h | |||
@@ -249,6 +249,22 @@ extern void __iomem *ioremap(unsigned long offset, unsigned long size); | |||
249 | #define ioremap_nocache(X,Y) ioremap((X),(Y)) | 249 | #define ioremap_nocache(X,Y) ioremap((X),(Y)) |
250 | extern void iounmap(volatile void __iomem *addr); | 250 | extern void iounmap(volatile void __iomem *addr); |
251 | 251 | ||
252 | #define ioread8(X) readb(X) | ||
253 | #define ioread16(X) readw(X) | ||
254 | #define ioread32(X) readl(X) | ||
255 | #define iowrite8(val,X) writeb(val,X) | ||
256 | #define iowrite16(val,X) writew(val,X) | ||
257 | #define iowrite32(val,X) writel(val,X) | ||
258 | |||
259 | /* Create a virtual mapping cookie for an IO port range */ | ||
260 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | ||
261 | extern void ioport_unmap(void __iomem *); | ||
262 | |||
263 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
264 | struct pci_dev; | ||
265 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
266 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | ||
267 | |||
252 | /* | 268 | /* |
253 | * Bus number may be in res->flags... somewhere. | 269 | * Bus number may be in res->flags... somewhere. |
254 | */ | 270 | */ |
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h index c5e3d26eabd3..f9cf44c07164 100644 --- a/include/asm-sparc/prom.h +++ b/include/asm-sparc/prom.h | |||
@@ -35,6 +35,8 @@ struct property { | |||
35 | int length; | 35 | int length; |
36 | void *value; | 36 | void *value; |
37 | struct property *next; | 37 | struct property *next; |
38 | unsigned long _flags; | ||
39 | unsigned int unique_id; | ||
38 | }; | 40 | }; |
39 | 41 | ||
40 | struct device_node { | 42 | struct device_node { |
@@ -58,8 +60,15 @@ struct device_node { | |||
58 | struct kref kref; | 60 | struct kref kref; |
59 | unsigned long _flags; | 61 | unsigned long _flags; |
60 | void *data; | 62 | void *data; |
63 | unsigned int unique_id; | ||
61 | }; | 64 | }; |
62 | 65 | ||
66 | /* flag descriptions */ | ||
67 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
68 | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
71 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
64 | { | 73 | { |
65 | dn->pde = de; | 74 | dn->pde = de; |
@@ -88,6 +97,7 @@ extern struct property *of_find_property(struct device_node *np, | |||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | 97 | extern int of_device_is_compatible(struct device_node *device, const char *); |
89 | extern void *of_get_property(struct device_node *node, const char *name, | 98 | extern void *of_get_property(struct device_node *node, const char *name, |
90 | int *lenp); | 99 | int *lenp); |
100 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | ||
91 | extern int of_getintprop_default(struct device_node *np, | 101 | extern int of_getintprop_default(struct device_node *np, |
92 | const char *name, | 102 | const char *name, |
93 | int def); | 103 | int def); |
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 3c2b5bc8650b..0f5b89c9323b 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -162,4 +162,47 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
162 | 162 | ||
163 | #endif /* PCI */ | 163 | #endif /* PCI */ |
164 | 164 | ||
165 | |||
166 | /* Now for the API extensions over the pci_ one */ | ||
167 | |||
168 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
169 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
170 | #define dma_is_consistent(d) (1) | ||
171 | |||
172 | static inline int | ||
173 | dma_get_cache_alignment(void) | ||
174 | { | ||
175 | /* no easy way to get cache size on all processors, so return | ||
176 | * the maximum possible, to be safe */ | ||
177 | return (1 << INTERNODE_CACHE_SHIFT); | ||
178 | } | ||
179 | |||
180 | static inline void | ||
181 | dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
182 | unsigned long offset, size_t size, | ||
183 | enum dma_data_direction direction) | ||
184 | { | ||
185 | /* just sync everything, that's all the pci API can do */ | ||
186 | dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); | ||
187 | } | ||
188 | |||
189 | static inline void | ||
190 | dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | ||
191 | unsigned long offset, size_t size, | ||
192 | enum dma_data_direction direction) | ||
193 | { | ||
194 | /* just sync everything, that's all the pci API can do */ | ||
195 | dma_sync_single_for_device(dev, dma_handle, offset+size, direction); | ||
196 | } | ||
197 | |||
198 | static inline void | ||
199 | dma_cache_sync(void *vaddr, size_t size, | ||
200 | enum dma_data_direction direction) | ||
201 | { | ||
202 | /* could define this in terms of the dma_cache ... operations, | ||
203 | * but if you get this on a platform, you should convert the platform | ||
204 | * to using the generic device DMA API */ | ||
205 | BUG(); | ||
206 | } | ||
207 | |||
165 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ | 208 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ |
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index f8d57bb5570c..b591d0e8d8f0 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -208,7 +208,55 @@ static void sun_fd_enable_dma(void) | |||
208 | pdma_areasize = pdma_size; | 208 | pdma_areasize = pdma_size; |
209 | } | 209 | } |
210 | 210 | ||
211 | extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); | 211 | irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) |
212 | { | ||
213 | if (likely(doing_pdma)) { | ||
214 | void __iomem *stat = (void __iomem *) fdc_status; | ||
215 | unsigned char *vaddr = pdma_vaddr; | ||
216 | unsigned long size = pdma_size; | ||
217 | u8 val; | ||
218 | |||
219 | while (size) { | ||
220 | val = readb(stat); | ||
221 | if (unlikely(!(val & 0x80))) { | ||
222 | pdma_vaddr = vaddr; | ||
223 | pdma_size = size; | ||
224 | return IRQ_HANDLED; | ||
225 | } | ||
226 | if (unlikely(!(val & 0x20))) { | ||
227 | pdma_vaddr = vaddr; | ||
228 | pdma_size = size; | ||
229 | doing_pdma = 0; | ||
230 | goto main_interrupt; | ||
231 | } | ||
232 | if (val & 0x40) { | ||
233 | /* read */ | ||
234 | *vaddr++ = readb(stat + 1); | ||
235 | } else { | ||
236 | unsigned char data = *vaddr++; | ||
237 | |||
238 | /* write */ | ||
239 | writeb(data, stat + 1); | ||
240 | } | ||
241 | size--; | ||
242 | } | ||
243 | |||
244 | pdma_vaddr = vaddr; | ||
245 | pdma_size = size; | ||
246 | |||
247 | /* Send Terminal Count pulse to floppy controller. */ | ||
248 | val = readb(auxio_register); | ||
249 | val |= AUXIO_AUX1_FTCNT; | ||
250 | writeb(val, auxio_register); | ||
251 | val &= ~AUXIO_AUX1_FTCNT; | ||
252 | writeb(val, auxio_register); | ||
253 | |||
254 | doing_pdma = 0; | ||
255 | } | ||
256 | |||
257 | main_interrupt: | ||
258 | return floppy_interrupt(irq, dev_cookie, regs); | ||
259 | } | ||
212 | 260 | ||
213 | static int sun_fd_request_irq(void) | 261 | static int sun_fd_request_irq(void) |
214 | { | 262 | { |
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-sparc64/prom.h b/include/asm-sparc64/prom.h index 6d1556c0c263..265614d497c4 100644 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/prom.h | |||
@@ -35,6 +35,8 @@ struct property { | |||
35 | int length; | 35 | int length; |
36 | void *value; | 36 | void *value; |
37 | struct property *next; | 37 | struct property *next; |
38 | unsigned long _flags; | ||
39 | unsigned int unique_id; | ||
38 | }; | 40 | }; |
39 | 41 | ||
40 | struct device_node { | 42 | struct device_node { |
@@ -58,8 +60,15 @@ struct device_node { | |||
58 | struct kref kref; | 60 | struct kref kref; |
59 | unsigned long _flags; | 61 | unsigned long _flags; |
60 | void *data; | 62 | void *data; |
63 | unsigned int unique_id; | ||
61 | }; | 64 | }; |
62 | 65 | ||
66 | /* flag descriptions */ | ||
67 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
68 | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
71 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
64 | { | 73 | { |
65 | dn->pde = de; | 74 | dn->pde = de; |
@@ -88,6 +97,7 @@ extern struct property *of_find_property(struct device_node *np, | |||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | 97 | extern int of_device_is_compatible(struct device_node *device, const char *); |
89 | extern void *of_get_property(struct device_node *node, const char *name, | 98 | extern void *of_get_property(struct device_node *node, const char *name, |
90 | int *lenp); | 99 | int *lenp); |
100 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | ||
91 | extern int of_getintprop_default(struct device_node *np, | 101 | extern int of_getintprop_default(struct device_node *np, |
92 | const char *name, | 102 | const char *name, |
93 | int def); | 103 | int def); |
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h index 0e234e201bd6..98a6c613589d 100644 --- a/include/asm-sparc64/topology.h +++ b/include/asm-sparc64/topology.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef _ASM_SPARC64_TOPOLOGY_H | 1 | #ifndef _ASM_SPARC64_TOPOLOGY_H |
2 | #define _ASM_SPARC64_TOPOLOGY_H | 2 | #define _ASM_SPARC64_TOPOLOGY_H |
3 | 3 | ||
4 | #include <asm/spitfire.h> | ||
5 | #define smt_capable() (tlb_type == hypervisor) | ||
6 | |||
4 | #include <asm-generic/topology.h> | 7 | #include <asm-generic/topology.h> |
5 | 8 | ||
6 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ | 9 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ |
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h new file mode 100644 index 000000000000..387c8f66af7d --- /dev/null +++ b/include/asm-x86_64/alternative.h | |||
@@ -0,0 +1,146 @@ | |||
1 | #ifndef _X86_64_ALTERNATIVE_H | ||
2 | #define _X86_64_ALTERNATIVE_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | |||
8 | struct alt_instr { | ||
9 | u8 *instr; /* original instruction */ | ||
10 | u8 *replacement; | ||
11 | u8 cpuid; /* cpuid bit set for replacement */ | ||
12 | u8 instrlen; /* length of original instruction */ | ||
13 | u8 replacementlen; /* length of new instruction, <= instrlen */ | ||
14 | u8 pad[5]; | ||
15 | }; | ||
16 | |||
17 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); | ||
18 | |||
19 | struct module; | ||
20 | extern void alternatives_smp_module_add(struct module *mod, char *name, | ||
21 | void *locks, void *locks_end, | ||
22 | void *text, void *text_end); | ||
23 | extern void alternatives_smp_module_del(struct module *mod); | ||
24 | extern void alternatives_smp_switch(int smp); | ||
25 | |||
26 | #endif | ||
27 | |||
28 | /* | ||
29 | * Alternative instructions for different CPU types or capabilities. | ||
30 | * | ||
31 | * This allows to use optimized instructions even on generic binary | ||
32 | * kernels. | ||
33 | * | ||
34 | * length of oldinstr must be longer or equal the length of newinstr | ||
35 | * It can be padded with nops as needed. | ||
36 | * | ||
37 | * For non barrier like inlines please define new variants | ||
38 | * without volatile and memory clobber. | ||
39 | */ | ||
40 | #define alternative(oldinstr, newinstr, feature) \ | ||
41 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
42 | ".section .altinstructions,\"a\"\n" \ | ||
43 | " .align 8\n" \ | ||
44 | " .quad 661b\n" /* label */ \ | ||
45 | " .quad 663f\n" /* new instruction */ \ | ||
46 | " .byte %c0\n" /* feature bit */ \ | ||
47 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
48 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
49 | ".previous\n" \ | ||
50 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
51 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
52 | ".previous" :: "i" (feature) : "memory") | ||
53 | |||
54 | /* | ||
55 | * Alternative inline assembly with input. | ||
56 | * | ||
57 | * Pecularities: | ||
58 | * No memory clobber here. | ||
59 | * Argument numbers start with 1. | ||
60 | * Best is to use constraints that are fixed size (like (%1) ... "r") | ||
61 | * If you use variable sized constraints like "m" or "g" in the | ||
62 | * replacement make sure to pad to the worst case length. | ||
63 | */ | ||
64 | #define alternative_input(oldinstr, newinstr, feature, input...) \ | ||
65 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
66 | ".section .altinstructions,\"a\"\n" \ | ||
67 | " .align 8\n" \ | ||
68 | " .quad 661b\n" /* label */ \ | ||
69 | " .quad 663f\n" /* new instruction */ \ | ||
70 | " .byte %c0\n" /* feature bit */ \ | ||
71 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
72 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
73 | ".previous\n" \ | ||
74 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
75 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
76 | ".previous" :: "i" (feature), ##input) | ||
77 | |||
78 | /* Like alternative_input, but with a single output argument */ | ||
79 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
80 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
81 | ".section .altinstructions,\"a\"\n" \ | ||
82 | " .align 8\n" \ | ||
83 | " .quad 661b\n" /* label */ \ | ||
84 | " .quad 663f\n" /* new instruction */ \ | ||
85 | " .byte %c[feat]\n" /* feature bit */ \ | ||
86 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
87 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
88 | ".previous\n" \ | ||
89 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
90 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
91 | ".previous" : output : [feat] "i" (feature), ##input) | ||
92 | |||
93 | /* | ||
94 | * Alternative inline assembly for SMP. | ||
95 | * | ||
96 | * alternative_smp() takes two versions (SMP first, UP second) and is | ||
97 | * for more complex stuff such as spinlocks. | ||
98 | * | ||
99 | * The LOCK_PREFIX macro defined here replaces the LOCK and | ||
100 | * LOCK_PREFIX macros used everywhere in the source tree. | ||
101 | * | ||
102 | * SMP alternatives use the same data structures as the other | ||
103 | * alternatives and the X86_FEATURE_UP flag to indicate the case of a | ||
104 | * UP system running a SMP kernel. The existing apply_alternatives() | ||
105 | * works fine for patching a SMP kernel for UP. | ||
106 | * | ||
107 | * The SMP alternative tables can be kept after boot and contain both | ||
108 | * UP and SMP versions of the instructions to allow switching back to | ||
109 | * SMP at runtime, when hotplugging in a new CPU, which is especially | ||
110 | * useful in virtualized environments. | ||
111 | * | ||
112 | * The very common lock prefix is handled as special case in a | ||
113 | * separate table which is a pure address list without replacement ptr | ||
114 | * and size information. That keeps the table sizes small. | ||
115 | */ | ||
116 | |||
117 | #ifdef CONFIG_SMP | ||
118 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
119 | asm volatile ("661:\n\t" smpinstr "\n662:\n" \ | ||
120 | ".section .smp_altinstructions,\"a\"\n" \ | ||
121 | " .align 8\n" \ | ||
122 | " .quad 661b\n" /* label */ \ | ||
123 | " .quad 663f\n" /* new instruction */ \ | ||
124 | " .byte 0x66\n" /* X86_FEATURE_UP */ \ | ||
125 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
126 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
127 | ".previous\n" \ | ||
128 | ".section .smp_altinstr_replacement,\"awx\"\n" \ | ||
129 | "663:\n\t" upinstr "\n" /* replacement */ \ | ||
130 | "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \ | ||
131 | ".previous" : args) | ||
132 | |||
133 | #define LOCK_PREFIX \ | ||
134 | ".section .smp_locks,\"a\"\n" \ | ||
135 | " .align 8\n" \ | ||
136 | " .quad 661f\n" /* address */ \ | ||
137 | ".previous\n" \ | ||
138 | "661:\n\tlock; " | ||
139 | |||
140 | #else /* ! CONFIG_SMP */ | ||
141 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
142 | asm volatile (upinstr : args) | ||
143 | #define LOCK_PREFIX "" | ||
144 | #endif | ||
145 | |||
146 | #endif /* _X86_64_ALTERNATIVE_H */ | ||
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h index a731be2204d2..9c96a0a8d1bd 100644 --- a/include/asm-x86_64/apic.h +++ b/include/asm-x86_64/apic.h | |||
@@ -49,7 +49,8 @@ static __inline unsigned int apic_read(unsigned long reg) | |||
49 | 49 | ||
50 | static __inline__ void apic_wait_icr_idle(void) | 50 | static __inline__ void apic_wait_icr_idle(void) |
51 | { | 51 | { |
52 | while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); | 52 | while (apic_read( APIC_ICR ) & APIC_ICR_BUSY) |
53 | cpu_relax(); | ||
53 | } | 54 | } |
54 | 55 | ||
55 | static inline void ack_APIC_irq(void) | 56 | static inline void ack_APIC_irq(void) |
@@ -79,30 +80,23 @@ extern void init_apic_mappings (void); | |||
79 | extern void smp_local_timer_interrupt (struct pt_regs * regs); | 80 | extern void smp_local_timer_interrupt (struct pt_regs * regs); |
80 | extern void setup_boot_APIC_clock (void); | 81 | extern void setup_boot_APIC_clock (void); |
81 | extern void setup_secondary_APIC_clock (void); | 82 | extern void setup_secondary_APIC_clock (void); |
82 | extern void setup_apic_nmi_watchdog (void); | ||
83 | extern int reserve_lapic_nmi(void); | ||
84 | extern void release_lapic_nmi(void); | ||
85 | extern void disable_timer_nmi_watchdog(void); | ||
86 | extern void enable_timer_nmi_watchdog(void); | ||
87 | extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); | ||
88 | extern int APIC_init_uniprocessor (void); | 83 | extern int APIC_init_uniprocessor (void); |
89 | extern void disable_APIC_timer(void); | 84 | extern void disable_APIC_timer(void); |
90 | extern void enable_APIC_timer(void); | 85 | extern void enable_APIC_timer(void); |
91 | extern void clustered_apic_check(void); | 86 | extern void clustered_apic_check(void); |
92 | 87 | ||
93 | extern void nmi_watchdog_default(void); | 88 | extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector, |
94 | extern int setup_nmi_watchdog(char *); | 89 | unsigned char msg_type, unsigned char mask); |
95 | 90 | ||
96 | extern unsigned int nmi_watchdog; | 91 | #define K8_APIC_EXT_LVT_BASE 0x500 |
97 | #define NMI_DEFAULT -1 | 92 | #define K8_APIC_EXT_INT_MSG_FIX 0x0 |
98 | #define NMI_NONE 0 | 93 | #define K8_APIC_EXT_INT_MSG_SMI 0x2 |
99 | #define NMI_IO_APIC 1 | 94 | #define K8_APIC_EXT_INT_MSG_NMI 0x4 |
100 | #define NMI_LOCAL_APIC 2 | 95 | #define K8_APIC_EXT_INT_MSG_EXT 0x7 |
101 | #define NMI_INVALID 3 | 96 | #define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0 |
102 | 97 | ||
103 | extern int disable_timer_pin_1; | 98 | extern int disable_timer_pin_1; |
104 | 99 | ||
105 | extern void setup_threshold_lvt(unsigned long lvt_off); | ||
106 | 100 | ||
107 | void smp_send_timer_broadcast_ipi(void); | 101 | void smp_send_timer_broadcast_ipi(void); |
108 | void switch_APIC_timer_to_ipi(void *cpumask); | 102 | void switch_APIC_timer_to_ipi(void *cpumask); |
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h index bd3fa67ed835..007e88d6d43f 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86_64/atomic.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ARCH_X86_64_ATOMIC__ | 1 | #ifndef __ARCH_X86_64_ATOMIC__ |
2 | #define __ARCH_X86_64_ATOMIC__ | 2 | #define __ARCH_X86_64_ATOMIC__ |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/alternative.h> |
5 | 5 | ||
6 | /* atomic_t should be 32 bit signed type */ | 6 | /* atomic_t should be 32 bit signed type */ |
7 | 7 | ||
@@ -52,7 +52,7 @@ typedef struct { volatile int counter; } atomic_t; | |||
52 | static __inline__ void atomic_add(int i, atomic_t *v) | 52 | static __inline__ void atomic_add(int i, atomic_t *v) |
53 | { | 53 | { |
54 | __asm__ __volatile__( | 54 | __asm__ __volatile__( |
55 | LOCK "addl %1,%0" | 55 | LOCK_PREFIX "addl %1,%0" |
56 | :"=m" (v->counter) | 56 | :"=m" (v->counter) |
57 | :"ir" (i), "m" (v->counter)); | 57 | :"ir" (i), "m" (v->counter)); |
58 | } | 58 | } |
@@ -67,7 +67,7 @@ static __inline__ void atomic_add(int i, atomic_t *v) | |||
67 | static __inline__ void atomic_sub(int i, atomic_t *v) | 67 | static __inline__ void atomic_sub(int i, atomic_t *v) |
68 | { | 68 | { |
69 | __asm__ __volatile__( | 69 | __asm__ __volatile__( |
70 | LOCK "subl %1,%0" | 70 | LOCK_PREFIX "subl %1,%0" |
71 | :"=m" (v->counter) | 71 | :"=m" (v->counter) |
72 | :"ir" (i), "m" (v->counter)); | 72 | :"ir" (i), "m" (v->counter)); |
73 | } | 73 | } |
@@ -86,7 +86,7 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v) | |||
86 | unsigned char c; | 86 | unsigned char c; |
87 | 87 | ||
88 | __asm__ __volatile__( | 88 | __asm__ __volatile__( |
89 | LOCK "subl %2,%0; sete %1" | 89 | LOCK_PREFIX "subl %2,%0; sete %1" |
90 | :"=m" (v->counter), "=qm" (c) | 90 | :"=m" (v->counter), "=qm" (c) |
91 | :"ir" (i), "m" (v->counter) : "memory"); | 91 | :"ir" (i), "m" (v->counter) : "memory"); |
92 | return c; | 92 | return c; |
@@ -101,7 +101,7 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v) | |||
101 | static __inline__ void atomic_inc(atomic_t *v) | 101 | static __inline__ void atomic_inc(atomic_t *v) |
102 | { | 102 | { |
103 | __asm__ __volatile__( | 103 | __asm__ __volatile__( |
104 | LOCK "incl %0" | 104 | LOCK_PREFIX "incl %0" |
105 | :"=m" (v->counter) | 105 | :"=m" (v->counter) |
106 | :"m" (v->counter)); | 106 | :"m" (v->counter)); |
107 | } | 107 | } |
@@ -115,7 +115,7 @@ static __inline__ void atomic_inc(atomic_t *v) | |||
115 | static __inline__ void atomic_dec(atomic_t *v) | 115 | static __inline__ void atomic_dec(atomic_t *v) |
116 | { | 116 | { |
117 | __asm__ __volatile__( | 117 | __asm__ __volatile__( |
118 | LOCK "decl %0" | 118 | LOCK_PREFIX "decl %0" |
119 | :"=m" (v->counter) | 119 | :"=m" (v->counter) |
120 | :"m" (v->counter)); | 120 | :"m" (v->counter)); |
121 | } | 121 | } |
@@ -133,7 +133,7 @@ static __inline__ int atomic_dec_and_test(atomic_t *v) | |||
133 | unsigned char c; | 133 | unsigned char c; |
134 | 134 | ||
135 | __asm__ __volatile__( | 135 | __asm__ __volatile__( |
136 | LOCK "decl %0; sete %1" | 136 | LOCK_PREFIX "decl %0; sete %1" |
137 | :"=m" (v->counter), "=qm" (c) | 137 | :"=m" (v->counter), "=qm" (c) |
138 | :"m" (v->counter) : "memory"); | 138 | :"m" (v->counter) : "memory"); |
139 | return c != 0; | 139 | return c != 0; |
@@ -152,7 +152,7 @@ static __inline__ int atomic_inc_and_test(atomic_t *v) | |||
152 | unsigned char c; | 152 | unsigned char c; |
153 | 153 | ||
154 | __asm__ __volatile__( | 154 | __asm__ __volatile__( |
155 | LOCK "incl %0; sete %1" | 155 | LOCK_PREFIX "incl %0; sete %1" |
156 | :"=m" (v->counter), "=qm" (c) | 156 | :"=m" (v->counter), "=qm" (c) |
157 | :"m" (v->counter) : "memory"); | 157 | :"m" (v->counter) : "memory"); |
158 | return c != 0; | 158 | return c != 0; |
@@ -172,7 +172,7 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v) | |||
172 | unsigned char c; | 172 | unsigned char c; |
173 | 173 | ||
174 | __asm__ __volatile__( | 174 | __asm__ __volatile__( |
175 | LOCK "addl %2,%0; sets %1" | 175 | LOCK_PREFIX "addl %2,%0; sets %1" |
176 | :"=m" (v->counter), "=qm" (c) | 176 | :"=m" (v->counter), "=qm" (c) |
177 | :"ir" (i), "m" (v->counter) : "memory"); | 177 | :"ir" (i), "m" (v->counter) : "memory"); |
178 | return c; | 178 | return c; |
@@ -189,7 +189,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
189 | { | 189 | { |
190 | int __i = i; | 190 | int __i = i; |
191 | __asm__ __volatile__( | 191 | __asm__ __volatile__( |
192 | LOCK "xaddl %0, %1;" | 192 | LOCK_PREFIX "xaddl %0, %1;" |
193 | :"=r"(i) | 193 | :"=r"(i) |
194 | :"m"(v->counter), "0"(i)); | 194 | :"m"(v->counter), "0"(i)); |
195 | return i + __i; | 195 | return i + __i; |
@@ -237,7 +237,7 @@ typedef struct { volatile long counter; } atomic64_t; | |||
237 | static __inline__ void atomic64_add(long i, atomic64_t *v) | 237 | static __inline__ void atomic64_add(long i, atomic64_t *v) |
238 | { | 238 | { |
239 | __asm__ __volatile__( | 239 | __asm__ __volatile__( |
240 | LOCK "addq %1,%0" | 240 | LOCK_PREFIX "addq %1,%0" |
241 | :"=m" (v->counter) | 241 | :"=m" (v->counter) |
242 | :"ir" (i), "m" (v->counter)); | 242 | :"ir" (i), "m" (v->counter)); |
243 | } | 243 | } |
@@ -252,7 +252,7 @@ static __inline__ void atomic64_add(long i, atomic64_t *v) | |||
252 | static __inline__ void atomic64_sub(long i, atomic64_t *v) | 252 | static __inline__ void atomic64_sub(long i, atomic64_t *v) |
253 | { | 253 | { |
254 | __asm__ __volatile__( | 254 | __asm__ __volatile__( |
255 | LOCK "subq %1,%0" | 255 | LOCK_PREFIX "subq %1,%0" |
256 | :"=m" (v->counter) | 256 | :"=m" (v->counter) |
257 | :"ir" (i), "m" (v->counter)); | 257 | :"ir" (i), "m" (v->counter)); |
258 | } | 258 | } |
@@ -271,7 +271,7 @@ static __inline__ int atomic64_sub_and_test(long i, atomic64_t *v) | |||
271 | unsigned char c; | 271 | unsigned char c; |
272 | 272 | ||
273 | __asm__ __volatile__( | 273 | __asm__ __volatile__( |
274 | LOCK "subq %2,%0; sete %1" | 274 | LOCK_PREFIX "subq %2,%0; sete %1" |
275 | :"=m" (v->counter), "=qm" (c) | 275 | :"=m" (v->counter), "=qm" (c) |
276 | :"ir" (i), "m" (v->counter) : "memory"); | 276 | :"ir" (i), "m" (v->counter) : "memory"); |
277 | return c; | 277 | return c; |
@@ -286,7 +286,7 @@ static __inline__ int atomic64_sub_and_test(long i, atomic64_t *v) | |||
286 | static __inline__ void atomic64_inc(atomic64_t *v) | 286 | static __inline__ void atomic64_inc(atomic64_t *v) |
287 | { | 287 | { |
288 | __asm__ __volatile__( | 288 | __asm__ __volatile__( |
289 | LOCK "incq %0" | 289 | LOCK_PREFIX "incq %0" |
290 | :"=m" (v->counter) | 290 | :"=m" (v->counter) |
291 | :"m" (v->counter)); | 291 | :"m" (v->counter)); |
292 | } | 292 | } |
@@ -300,7 +300,7 @@ static __inline__ void atomic64_inc(atomic64_t *v) | |||
300 | static __inline__ void atomic64_dec(atomic64_t *v) | 300 | static __inline__ void atomic64_dec(atomic64_t *v) |
301 | { | 301 | { |
302 | __asm__ __volatile__( | 302 | __asm__ __volatile__( |
303 | LOCK "decq %0" | 303 | LOCK_PREFIX "decq %0" |
304 | :"=m" (v->counter) | 304 | :"=m" (v->counter) |
305 | :"m" (v->counter)); | 305 | :"m" (v->counter)); |
306 | } | 306 | } |
@@ -318,7 +318,7 @@ static __inline__ int atomic64_dec_and_test(atomic64_t *v) | |||
318 | unsigned char c; | 318 | unsigned char c; |
319 | 319 | ||
320 | __asm__ __volatile__( | 320 | __asm__ __volatile__( |
321 | LOCK "decq %0; sete %1" | 321 | LOCK_PREFIX "decq %0; sete %1" |
322 | :"=m" (v->counter), "=qm" (c) | 322 | :"=m" (v->counter), "=qm" (c) |
323 | :"m" (v->counter) : "memory"); | 323 | :"m" (v->counter) : "memory"); |
324 | return c != 0; | 324 | return c != 0; |
@@ -337,7 +337,7 @@ static __inline__ int atomic64_inc_and_test(atomic64_t *v) | |||
337 | unsigned char c; | 337 | unsigned char c; |
338 | 338 | ||
339 | __asm__ __volatile__( | 339 | __asm__ __volatile__( |
340 | LOCK "incq %0; sete %1" | 340 | LOCK_PREFIX "incq %0; sete %1" |
341 | :"=m" (v->counter), "=qm" (c) | 341 | :"=m" (v->counter), "=qm" (c) |
342 | :"m" (v->counter) : "memory"); | 342 | :"m" (v->counter) : "memory"); |
343 | return c != 0; | 343 | return c != 0; |
@@ -357,7 +357,7 @@ static __inline__ int atomic64_add_negative(long i, atomic64_t *v) | |||
357 | unsigned char c; | 357 | unsigned char c; |
358 | 358 | ||
359 | __asm__ __volatile__( | 359 | __asm__ __volatile__( |
360 | LOCK "addq %2,%0; sets %1" | 360 | LOCK_PREFIX "addq %2,%0; sets %1" |
361 | :"=m" (v->counter), "=qm" (c) | 361 | :"=m" (v->counter), "=qm" (c) |
362 | :"ir" (i), "m" (v->counter) : "memory"); | 362 | :"ir" (i), "m" (v->counter) : "memory"); |
363 | return c; | 363 | return c; |
@@ -374,7 +374,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t *v) | |||
374 | { | 374 | { |
375 | long __i = i; | 375 | long __i = i; |
376 | __asm__ __volatile__( | 376 | __asm__ __volatile__( |
377 | LOCK "xaddq %0, %1;" | 377 | LOCK_PREFIX "xaddq %0, %1;" |
378 | :"=r"(i) | 378 | :"=r"(i) |
379 | :"m"(v->counter), "0"(i)); | 379 | :"m"(v->counter), "0"(i)); |
380 | return i + __i; | 380 | return i + __i; |
@@ -418,11 +418,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t *v) | |||
418 | 418 | ||
419 | /* These are x86-specific, used by some header files */ | 419 | /* These are x86-specific, used by some header files */ |
420 | #define atomic_clear_mask(mask, addr) \ | 420 | #define atomic_clear_mask(mask, addr) \ |
421 | __asm__ __volatile__(LOCK "andl %0,%1" \ | 421 | __asm__ __volatile__(LOCK_PREFIX "andl %0,%1" \ |
422 | : : "r" (~(mask)),"m" (*addr) : "memory") | 422 | : : "r" (~(mask)),"m" (*addr) : "memory") |
423 | 423 | ||
424 | #define atomic_set_mask(mask, addr) \ | 424 | #define atomic_set_mask(mask, addr) \ |
425 | __asm__ __volatile__(LOCK "orl %0,%1" \ | 425 | __asm__ __volatile__(LOCK_PREFIX "orl %0,%1" \ |
426 | : : "r" ((unsigned)mask),"m" (*(addr)) : "memory") | 426 | : : "r" ((unsigned)mask),"m" (*(addr)) : "memory") |
427 | 427 | ||
428 | /* Atomic operations are already serializing on x86 */ | 428 | /* Atomic operations are already serializing on x86 */ |
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index e9bf933d25d0..f7ba57b1cc08 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h | |||
@@ -5,12 +5,7 @@ | |||
5 | * Copyright 1992, Linus Torvalds. | 5 | * Copyright 1992, Linus Torvalds. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | #include <asm/alternative.h> | |
9 | #ifdef CONFIG_SMP | ||
10 | #define LOCK_PREFIX "lock ; " | ||
11 | #else | ||
12 | #define LOCK_PREFIX "" | ||
13 | #endif | ||
14 | 9 | ||
15 | #define ADDR (*(volatile long *) addr) | 10 | #define ADDR (*(volatile long *) addr) |
16 | 11 | ||
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h new file mode 100644 index 000000000000..6e1654f30986 --- /dev/null +++ b/include/asm-x86_64/calgary.h | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Derived from include/asm-powerpc/iommu.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation | ||
5 | * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef _ASM_X86_64_CALGARY_H | ||
23 | #define _ASM_X86_64_CALGARY_H | ||
24 | |||
25 | #include <linux/config.h> | ||
26 | #include <linux/spinlock.h> | ||
27 | #include <linux/device.h> | ||
28 | #include <linux/dma-mapping.h> | ||
29 | #include <asm/types.h> | ||
30 | |||
31 | struct iommu_table { | ||
32 | unsigned long it_base; /* mapped address of tce table */ | ||
33 | unsigned long it_hint; /* Hint for next alloc */ | ||
34 | unsigned long *it_map; /* A simple allocation bitmap for now */ | ||
35 | spinlock_t it_lock; /* Protects it_map */ | ||
36 | unsigned int it_size; /* Size of iommu table in entries */ | ||
37 | unsigned char it_busno; /* Bus number this table belongs to */ | ||
38 | void __iomem *bbar; | ||
39 | u64 tar_val; | ||
40 | struct timer_list watchdog_timer; | ||
41 | }; | ||
42 | |||
43 | #define TCE_TABLE_SIZE_UNSPECIFIED ~0 | ||
44 | #define TCE_TABLE_SIZE_64K 0 | ||
45 | #define TCE_TABLE_SIZE_128K 1 | ||
46 | #define TCE_TABLE_SIZE_256K 2 | ||
47 | #define TCE_TABLE_SIZE_512K 3 | ||
48 | #define TCE_TABLE_SIZE_1M 4 | ||
49 | #define TCE_TABLE_SIZE_2M 5 | ||
50 | #define TCE_TABLE_SIZE_4M 6 | ||
51 | #define TCE_TABLE_SIZE_8M 7 | ||
52 | |||
53 | #ifdef CONFIG_CALGARY_IOMMU | ||
54 | extern int calgary_iommu_init(void); | ||
55 | extern void detect_calgary(void); | ||
56 | #else | ||
57 | static inline int calgary_iommu_init(void) { return 1; } | ||
58 | static inline void detect_calgary(void) { return; } | ||
59 | #endif | ||
60 | |||
61 | static inline unsigned int bus_to_phb(unsigned char busno) | ||
62 | { | ||
63 | return ((busno % 15 == 0) ? 0 : busno / 2 + 1); | ||
64 | } | ||
65 | |||
66 | #endif /* _ASM_X86_64_CALGARY_H */ | ||
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h index 662964b74e34..ee792faaca01 100644 --- a/include/asm-x86_64/cpufeature.h +++ b/include/asm-x86_64/cpufeature.h | |||
@@ -46,6 +46,7 @@ | |||
46 | #define X86_FEATURE_SYSCALL (1*32+11) /* SYSCALL/SYSRET */ | 46 | #define X86_FEATURE_SYSCALL (1*32+11) /* SYSCALL/SYSRET */ |
47 | #define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ | 47 | #define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ |
48 | #define X86_FEATURE_FXSR_OPT (1*32+25) /* FXSR optimizations */ | 48 | #define X86_FEATURE_FXSR_OPT (1*32+25) /* FXSR optimizations */ |
49 | #define X86_FEATURE_RDTSCP (1*32+27) /* RDTSCP */ | ||
49 | #define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ | 50 | #define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ |
50 | #define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ | 51 | #define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ |
51 | #define X86_FEATURE_3DNOW (1*32+31) /* 3DNow! */ | 52 | #define X86_FEATURE_3DNOW (1*32+31) /* 3DNow! */ |
@@ -65,6 +66,8 @@ | |||
65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ | 66 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ |
66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ | 67 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ |
67 | #define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ | 68 | #define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ |
69 | #define X86_FEATURE_UP (3*32+8) /* SMP kernel running on UP */ | ||
70 | #define X86_FEATURE_ARCH_PERFMON (3*32+9) /* Intel Architectural PerfMon */ | ||
68 | 71 | ||
69 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 72 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
70 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 73 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h index 498f66df36b9..b6da83dcc7a6 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86_64/dma-mapping.h | |||
@@ -55,6 +55,13 @@ extern dma_addr_t bad_dma_address; | |||
55 | extern struct dma_mapping_ops* dma_ops; | 55 | extern struct dma_mapping_ops* dma_ops; |
56 | extern int iommu_merge; | 56 | extern int iommu_merge; |
57 | 57 | ||
58 | static inline int valid_dma_direction(int dma_direction) | ||
59 | { | ||
60 | return ((dma_direction == DMA_BIDIRECTIONAL) || | ||
61 | (dma_direction == DMA_TO_DEVICE) || | ||
62 | (dma_direction == DMA_FROM_DEVICE)); | ||
63 | } | ||
64 | |||
58 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 65 | static inline int dma_mapping_error(dma_addr_t dma_addr) |
59 | { | 66 | { |
60 | if (dma_ops->mapping_error) | 67 | if (dma_ops->mapping_error) |
@@ -72,6 +79,7 @@ static inline dma_addr_t | |||
72 | dma_map_single(struct device *hwdev, void *ptr, size_t size, | 79 | dma_map_single(struct device *hwdev, void *ptr, size_t size, |
73 | int direction) | 80 | int direction) |
74 | { | 81 | { |
82 | BUG_ON(!valid_dma_direction(direction)); | ||
75 | return dma_ops->map_single(hwdev, ptr, size, direction); | 83 | return dma_ops->map_single(hwdev, ptr, size, direction); |
76 | } | 84 | } |
77 | 85 | ||
@@ -79,6 +87,7 @@ static inline void | |||
79 | dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size, | 87 | dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size, |
80 | int direction) | 88 | int direction) |
81 | { | 89 | { |
90 | BUG_ON(!valid_dma_direction(direction)); | ||
82 | dma_ops->unmap_single(dev, addr, size, direction); | 91 | dma_ops->unmap_single(dev, addr, size, direction); |
83 | } | 92 | } |
84 | 93 | ||
@@ -91,6 +100,7 @@ static inline void | |||
91 | dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, | 100 | dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, |
92 | size_t size, int direction) | 101 | size_t size, int direction) |
93 | { | 102 | { |
103 | BUG_ON(!valid_dma_direction(direction)); | ||
94 | if (dma_ops->sync_single_for_cpu) | 104 | if (dma_ops->sync_single_for_cpu) |
95 | dma_ops->sync_single_for_cpu(hwdev, dma_handle, size, | 105 | dma_ops->sync_single_for_cpu(hwdev, dma_handle, size, |
96 | direction); | 106 | direction); |
@@ -101,6 +111,7 @@ static inline void | |||
101 | dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, | 111 | dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, |
102 | size_t size, int direction) | 112 | size_t size, int direction) |
103 | { | 113 | { |
114 | BUG_ON(!valid_dma_direction(direction)); | ||
104 | if (dma_ops->sync_single_for_device) | 115 | if (dma_ops->sync_single_for_device) |
105 | dma_ops->sync_single_for_device(hwdev, dma_handle, size, | 116 | dma_ops->sync_single_for_device(hwdev, dma_handle, size, |
106 | direction); | 117 | direction); |
@@ -111,6 +122,7 @@ static inline void | |||
111 | dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, | 122 | dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, |
112 | unsigned long offset, size_t size, int direction) | 123 | unsigned long offset, size_t size, int direction) |
113 | { | 124 | { |
125 | BUG_ON(!valid_dma_direction(direction)); | ||
114 | if (dma_ops->sync_single_range_for_cpu) { | 126 | if (dma_ops->sync_single_range_for_cpu) { |
115 | dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction); | 127 | dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction); |
116 | } | 128 | } |
@@ -122,6 +134,7 @@ static inline void | |||
122 | dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle, | 134 | dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle, |
123 | unsigned long offset, size_t size, int direction) | 135 | unsigned long offset, size_t size, int direction) |
124 | { | 136 | { |
137 | BUG_ON(!valid_dma_direction(direction)); | ||
125 | if (dma_ops->sync_single_range_for_device) | 138 | if (dma_ops->sync_single_range_for_device) |
126 | dma_ops->sync_single_range_for_device(hwdev, dma_handle, | 139 | dma_ops->sync_single_range_for_device(hwdev, dma_handle, |
127 | offset, size, direction); | 140 | offset, size, direction); |
@@ -133,6 +146,7 @@ static inline void | |||
133 | dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, | 146 | dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, |
134 | int nelems, int direction) | 147 | int nelems, int direction) |
135 | { | 148 | { |
149 | BUG_ON(!valid_dma_direction(direction)); | ||
136 | if (dma_ops->sync_sg_for_cpu) | 150 | if (dma_ops->sync_sg_for_cpu) |
137 | dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); | 151 | dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); |
138 | flush_write_buffers(); | 152 | flush_write_buffers(); |
@@ -142,6 +156,7 @@ static inline void | |||
142 | dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | 156 | dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
143 | int nelems, int direction) | 157 | int nelems, int direction) |
144 | { | 158 | { |
159 | BUG_ON(!valid_dma_direction(direction)); | ||
145 | if (dma_ops->sync_sg_for_device) { | 160 | if (dma_ops->sync_sg_for_device) { |
146 | dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction); | 161 | dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction); |
147 | } | 162 | } |
@@ -152,6 +167,7 @@ dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | |||
152 | static inline int | 167 | static inline int |
153 | dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction) | 168 | dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction) |
154 | { | 169 | { |
170 | BUG_ON(!valid_dma_direction(direction)); | ||
155 | return dma_ops->map_sg(hwdev, sg, nents, direction); | 171 | return dma_ops->map_sg(hwdev, sg, nents, direction); |
156 | } | 172 | } |
157 | 173 | ||
@@ -159,6 +175,7 @@ static inline void | |||
159 | dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 175 | dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
160 | int direction) | 176 | int direction) |
161 | { | 177 | { |
178 | BUG_ON(!valid_dma_direction(direction)); | ||
162 | dma_ops->unmap_sg(hwdev, sg, nents, direction); | 179 | dma_ops->unmap_sg(hwdev, sg, nents, direction); |
163 | } | 180 | } |
164 | 181 | ||
diff --git a/include/asm-x86_64/dma.h b/include/asm-x86_64/dma.h index c556208d3dd7..a37c16f06289 100644 --- a/include/asm-x86_64/dma.h +++ b/include/asm-x86_64/dma.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: dma.h,v 1.1.1.1 2001/04/19 20:00:38 ak Exp $ | 1 | /* |
2 | * linux/include/asm/dma.h: Defines for using and allocating dma channels. | 2 | * linux/include/asm/dma.h: Defines for using and allocating dma channels. |
3 | * Written by Hennus Bergman, 1992. | 3 | * Written by Hennus Bergman, 1992. |
4 | * High DMA channel support & info by Hannu Savolainen | 4 | * High DMA channel support & info by Hannu Savolainen |
diff --git a/include/asm-x86_64/gart-mapping.h b/include/asm-x86_64/gart-mapping.h deleted file mode 100644 index ada497b0b55b..000000000000 --- a/include/asm-x86_64/gart-mapping.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _X8664_GART_MAPPING_H | ||
2 | #define _X8664_GART_MAPPING_H 1 | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/types.h> | ||
6 | |||
7 | struct device; | ||
8 | |||
9 | extern void* | ||
10 | gart_alloc_coherent(struct device *dev, size_t size, | ||
11 | dma_addr_t *dma_handle, gfp_t gfp); | ||
12 | |||
13 | extern int | ||
14 | gart_dma_supported(struct device *hwdev, u64 mask); | ||
15 | |||
16 | #endif /* _X8664_GART_MAPPING_H */ | ||
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h index 18ff7ee9e774..b39098408b69 100644 --- a/include/asm-x86_64/hpet.h +++ b/include/asm-x86_64/hpet.h | |||
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | extern int is_hpet_enabled(void); | 56 | extern int is_hpet_enabled(void); |
57 | extern int hpet_rtc_timer_init(void); | 57 | extern int hpet_rtc_timer_init(void); |
58 | extern int oem_force_hpet_timer(void); | 58 | extern int apic_is_clustered_box(void); |
59 | 59 | ||
60 | extern int hpet_use_timer; | 60 | extern int hpet_use_timer; |
61 | 61 | ||
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 3de96fd86a70..931877462788 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * <tomsoft@informatik.tu-chemnitz.de> | 12 | * <tomsoft@informatik.tu-chemnitz.de> |
13 | * | 13 | * |
14 | * hacked by Andi Kleen for x86-64. | 14 | * hacked by Andi Kleen for x86-64. |
15 | * | ||
16 | * $Id: hw_irq.h,v 1.24 2001/09/14 20:55:03 vojtech Exp $ | ||
17 | */ | 15 | */ |
18 | 16 | ||
19 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
@@ -126,7 +124,7 @@ asmlinkage void IRQ_NAME(nr); \ | |||
126 | __asm__( \ | 124 | __asm__( \ |
127 | "\n.p2align\n" \ | 125 | "\n.p2align\n" \ |
128 | "IRQ" #nr "_interrupt:\n\t" \ | 126 | "IRQ" #nr "_interrupt:\n\t" \ |
129 | "push $" #nr "-256 ; " \ | 127 | "push $~(" #nr ") ; " \ |
130 | "jmp common_interrupt"); | 128 | "jmp common_interrupt"); |
131 | 129 | ||
132 | #if defined(CONFIG_X86_IO_APIC) | 130 | #if defined(CONFIG_X86_IO_APIC) |
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index b4f4b172b15a..5b52ce507338 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h | |||
@@ -4,317 +4,15 @@ | |||
4 | /* | 4 | /* |
5 | * This file contains the system call numbers of the ia32 port, | 5 | * This file contains the system call numbers of the ia32 port, |
6 | * this is for the kernel only. | 6 | * this is for the kernel only. |
7 | * Only add syscalls here where some part of the kernel needs to know | ||
8 | * the number. This should be otherwise in sync with asm-i386/unistd.h. -AK | ||
7 | */ | 9 | */ |
8 | 10 | ||
9 | #define __NR_ia32_restart_syscall 0 | 11 | #define __NR_ia32_restart_syscall 0 |
10 | #define __NR_ia32_exit 1 | 12 | #define __NR_ia32_exit 1 |
11 | #define __NR_ia32_fork 2 | ||
12 | #define __NR_ia32_read 3 | 13 | #define __NR_ia32_read 3 |
13 | #define __NR_ia32_write 4 | 14 | #define __NR_ia32_write 4 |
14 | #define __NR_ia32_open 5 | 15 | #define __NR_ia32_sigreturn 119 |
15 | #define __NR_ia32_close 6 | ||
16 | #define __NR_ia32_waitpid 7 | ||
17 | #define __NR_ia32_creat 8 | ||
18 | #define __NR_ia32_link 9 | ||
19 | #define __NR_ia32_unlink 10 | ||
20 | #define __NR_ia32_execve 11 | ||
21 | #define __NR_ia32_chdir 12 | ||
22 | #define __NR_ia32_time 13 | ||
23 | #define __NR_ia32_mknod 14 | ||
24 | #define __NR_ia32_chmod 15 | ||
25 | #define __NR_ia32_lchown 16 | ||
26 | #define __NR_ia32_break 17 | ||
27 | #define __NR_ia32_oldstat 18 | ||
28 | #define __NR_ia32_lseek 19 | ||
29 | #define __NR_ia32_getpid 20 | ||
30 | #define __NR_ia32_mount 21 | ||
31 | #define __NR_ia32_umount 22 | ||
32 | #define __NR_ia32_setuid 23 | ||
33 | #define __NR_ia32_getuid 24 | ||
34 | #define __NR_ia32_stime 25 | ||
35 | #define __NR_ia32_ptrace 26 | ||
36 | #define __NR_ia32_alarm 27 | ||
37 | #define __NR_ia32_oldfstat 28 | ||
38 | #define __NR_ia32_pause 29 | ||
39 | #define __NR_ia32_utime 30 | ||
40 | #define __NR_ia32_stty 31 | ||
41 | #define __NR_ia32_gtty 32 | ||
42 | #define __NR_ia32_access 33 | ||
43 | #define __NR_ia32_nice 34 | ||
44 | #define __NR_ia32_ftime 35 | ||
45 | #define __NR_ia32_sync 36 | ||
46 | #define __NR_ia32_kill 37 | ||
47 | #define __NR_ia32_rename 38 | ||
48 | #define __NR_ia32_mkdir 39 | ||
49 | #define __NR_ia32_rmdir 40 | ||
50 | #define __NR_ia32_dup 41 | ||
51 | #define __NR_ia32_pipe 42 | ||
52 | #define __NR_ia32_times 43 | ||
53 | #define __NR_ia32_prof 44 | ||
54 | #define __NR_ia32_brk 45 | ||
55 | #define __NR_ia32_setgid 46 | ||
56 | #define __NR_ia32_getgid 47 | ||
57 | #define __NR_ia32_signal 48 | ||
58 | #define __NR_ia32_geteuid 49 | ||
59 | #define __NR_ia32_getegid 50 | ||
60 | #define __NR_ia32_acct 51 | ||
61 | #define __NR_ia32_umount2 52 | ||
62 | #define __NR_ia32_lock 53 | ||
63 | #define __NR_ia32_ioctl 54 | ||
64 | #define __NR_ia32_fcntl 55 | ||
65 | #define __NR_ia32_mpx 56 | ||
66 | #define __NR_ia32_setpgid 57 | ||
67 | #define __NR_ia32_ulimit 58 | ||
68 | #define __NR_ia32_oldolduname 59 | ||
69 | #define __NR_ia32_umask 60 | ||
70 | #define __NR_ia32_chroot 61 | ||
71 | #define __NR_ia32_ustat 62 | ||
72 | #define __NR_ia32_dup2 63 | ||
73 | #define __NR_ia32_getppid 64 | ||
74 | #define __NR_ia32_getpgrp 65 | ||
75 | #define __NR_ia32_setsid 66 | ||
76 | #define __NR_ia32_sigaction 67 | ||
77 | #define __NR_ia32_sgetmask 68 | ||
78 | #define __NR_ia32_ssetmask 69 | ||
79 | #define __NR_ia32_setreuid 70 | ||
80 | #define __NR_ia32_setregid 71 | ||
81 | #define __NR_ia32_sigsuspend 72 | ||
82 | #define __NR_ia32_sigpending 73 | ||
83 | #define __NR_ia32_sethostname 74 | ||
84 | #define __NR_ia32_setrlimit 75 | ||
85 | #define __NR_ia32_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | ||
86 | #define __NR_ia32_getrusage 77 | ||
87 | #define __NR_ia32_gettimeofday 78 | ||
88 | #define __NR_ia32_settimeofday 79 | ||
89 | #define __NR_ia32_getgroups 80 | ||
90 | #define __NR_ia32_setgroups 81 | ||
91 | #define __NR_ia32_select 82 | ||
92 | #define __NR_ia32_symlink 83 | ||
93 | #define __NR_ia32_oldlstat 84 | ||
94 | #define __NR_ia32_readlink 85 | ||
95 | #define __NR_ia32_uselib 86 | ||
96 | #define __NR_ia32_swapon 87 | ||
97 | #define __NR_ia32_reboot 88 | ||
98 | #define __NR_ia32_readdir 89 | ||
99 | #define __NR_ia32_mmap 90 | ||
100 | #define __NR_ia32_munmap 91 | ||
101 | #define __NR_ia32_truncate 92 | ||
102 | #define __NR_ia32_ftruncate 93 | ||
103 | #define __NR_ia32_fchmod 94 | ||
104 | #define __NR_ia32_fchown 95 | ||
105 | #define __NR_ia32_getpriority 96 | ||
106 | #define __NR_ia32_setpriority 97 | ||
107 | #define __NR_ia32_profil 98 | ||
108 | #define __NR_ia32_statfs 99 | ||
109 | #define __NR_ia32_fstatfs 100 | ||
110 | #define __NR_ia32_ioperm 101 | ||
111 | #define __NR_ia32_socketcall 102 | ||
112 | #define __NR_ia32_syslog 103 | ||
113 | #define __NR_ia32_setitimer 104 | ||
114 | #define __NR_ia32_getitimer 105 | ||
115 | #define __NR_ia32_stat 106 | ||
116 | #define __NR_ia32_lstat 107 | ||
117 | #define __NR_ia32_fstat 108 | ||
118 | #define __NR_ia32_olduname 109 | ||
119 | #define __NR_ia32_iopl 110 | ||
120 | #define __NR_ia32_vhangup 111 | ||
121 | #define __NR_ia32_idle 112 | ||
122 | #define __NR_ia32_vm86old 113 | ||
123 | #define __NR_ia32_wait4 114 | ||
124 | #define __NR_ia32_swapoff 115 | ||
125 | #define __NR_ia32_sysinfo 116 | ||
126 | #define __NR_ia32_ipc 117 | ||
127 | #define __NR_ia32_fsync 118 | ||
128 | #define __NR_ia32_sigreturn 119 | ||
129 | #define __NR_ia32_clone 120 | ||
130 | #define __NR_ia32_setdomainname 121 | ||
131 | #define __NR_ia32_uname 122 | ||
132 | #define __NR_ia32_modify_ldt 123 | ||
133 | #define __NR_ia32_adjtimex 124 | ||
134 | #define __NR_ia32_mprotect 125 | ||
135 | #define __NR_ia32_sigprocmask 126 | ||
136 | #define __NR_ia32_create_module 127 | ||
137 | #define __NR_ia32_init_module 128 | ||
138 | #define __NR_ia32_delete_module 129 | ||
139 | #define __NR_ia32_get_kernel_syms 130 | ||
140 | #define __NR_ia32_quotactl 131 | ||
141 | #define __NR_ia32_getpgid 132 | ||
142 | #define __NR_ia32_fchdir 133 | ||
143 | #define __NR_ia32_bdflush 134 | ||
144 | #define __NR_ia32_sysfs 135 | ||
145 | #define __NR_ia32_personality 136 | ||
146 | #define __NR_ia32_afs_syscall 137 /* Syscall for Andrew File System */ | ||
147 | #define __NR_ia32_setfsuid 138 | ||
148 | #define __NR_ia32_setfsgid 139 | ||
149 | #define __NR_ia32__llseek 140 | ||
150 | #define __NR_ia32_getdents 141 | ||
151 | #define __NR_ia32__newselect 142 | ||
152 | #define __NR_ia32_flock 143 | ||
153 | #define __NR_ia32_msync 144 | ||
154 | #define __NR_ia32_readv 145 | ||
155 | #define __NR_ia32_writev 146 | ||
156 | #define __NR_ia32_getsid 147 | ||
157 | #define __NR_ia32_fdatasync 148 | ||
158 | #define __NR_ia32__sysctl 149 | ||
159 | #define __NR_ia32_mlock 150 | ||
160 | #define __NR_ia32_munlock 151 | ||
161 | #define __NR_ia32_mlockall 152 | ||
162 | #define __NR_ia32_munlockall 153 | ||
163 | #define __NR_ia32_sched_setparam 154 | ||
164 | #define __NR_ia32_sched_getparam 155 | ||
165 | #define __NR_ia32_sched_setscheduler 156 | ||
166 | #define __NR_ia32_sched_getscheduler 157 | ||
167 | #define __NR_ia32_sched_yield 158 | ||
168 | #define __NR_ia32_sched_get_priority_max 159 | ||
169 | #define __NR_ia32_sched_get_priority_min 160 | ||
170 | #define __NR_ia32_sched_rr_get_interval 161 | ||
171 | #define __NR_ia32_nanosleep 162 | ||
172 | #define __NR_ia32_mremap 163 | ||
173 | #define __NR_ia32_setresuid 164 | ||
174 | #define __NR_ia32_getresuid 165 | ||
175 | #define __NR_ia32_vm86 166 | ||
176 | #define __NR_ia32_query_module 167 | ||
177 | #define __NR_ia32_poll 168 | ||
178 | #define __NR_ia32_nfsservctl 169 | ||
179 | #define __NR_ia32_setresgid 170 | ||
180 | #define __NR_ia32_getresgid 171 | ||
181 | #define __NR_ia32_prctl 172 | ||
182 | #define __NR_ia32_rt_sigreturn 173 | 16 | #define __NR_ia32_rt_sigreturn 173 |
183 | #define __NR_ia32_rt_sigaction 174 | ||
184 | #define __NR_ia32_rt_sigprocmask 175 | ||
185 | #define __NR_ia32_rt_sigpending 176 | ||
186 | #define __NR_ia32_rt_sigtimedwait 177 | ||
187 | #define __NR_ia32_rt_sigqueueinfo 178 | ||
188 | #define __NR_ia32_rt_sigsuspend 179 | ||
189 | #define __NR_ia32_pread 180 | ||
190 | #define __NR_ia32_pwrite 181 | ||
191 | #define __NR_ia32_chown 182 | ||
192 | #define __NR_ia32_getcwd 183 | ||
193 | #define __NR_ia32_capget 184 | ||
194 | #define __NR_ia32_capset 185 | ||
195 | #define __NR_ia32_sigaltstack 186 | ||
196 | #define __NR_ia32_sendfile 187 | ||
197 | #define __NR_ia32_getpmsg 188 /* some people actually want streams */ | ||
198 | #define __NR_ia32_putpmsg 189 /* some people actually want streams */ | ||
199 | #define __NR_ia32_vfork 190 | ||
200 | #define __NR_ia32_ugetrlimit 191 /* SuS compliant getrlimit */ | ||
201 | #define __NR_ia32_mmap2 192 | ||
202 | #define __NR_ia32_truncate64 193 | ||
203 | #define __NR_ia32_ftruncate64 194 | ||
204 | #define __NR_ia32_stat64 195 | ||
205 | #define __NR_ia32_lstat64 196 | ||
206 | #define __NR_ia32_fstat64 197 | ||
207 | #define __NR_ia32_lchown32 198 | ||
208 | #define __NR_ia32_getuid32 199 | ||
209 | #define __NR_ia32_getgid32 200 | ||
210 | #define __NR_ia32_geteuid32 201 | ||
211 | #define __NR_ia32_getegid32 202 | ||
212 | #define __NR_ia32_setreuid32 203 | ||
213 | #define __NR_ia32_setregid32 204 | ||
214 | #define __NR_ia32_getgroups32 205 | ||
215 | #define __NR_ia32_setgroups32 206 | ||
216 | #define __NR_ia32_fchown32 207 | ||
217 | #define __NR_ia32_setresuid32 208 | ||
218 | #define __NR_ia32_getresuid32 209 | ||
219 | #define __NR_ia32_setresgid32 210 | ||
220 | #define __NR_ia32_getresgid32 211 | ||
221 | #define __NR_ia32_chown32 212 | ||
222 | #define __NR_ia32_setuid32 213 | ||
223 | #define __NR_ia32_setgid32 214 | ||
224 | #define __NR_ia32_setfsuid32 215 | ||
225 | #define __NR_ia32_setfsgid32 216 | ||
226 | #define __NR_ia32_pivot_root 217 | ||
227 | #define __NR_ia32_mincore 218 | ||
228 | #define __NR_ia32_madvise 219 | ||
229 | #define __NR_ia32_madvise1 219 /* delete when C lib stub is removed */ | ||
230 | #define __NR_ia32_getdents64 220 | ||
231 | #define __NR_ia32_fcntl64 221 | ||
232 | #define __NR_ia32_tuxcall 222 | ||
233 | #define __NR_ia32_security 223 | ||
234 | #define __NR_ia32_gettid 224 | ||
235 | #define __NR_ia32_readahead 225 | ||
236 | #define __NR_ia32_setxattr 226 | ||
237 | #define __NR_ia32_lsetxattr 227 | ||
238 | #define __NR_ia32_fsetxattr 228 | ||
239 | #define __NR_ia32_getxattr 229 | ||
240 | #define __NR_ia32_lgetxattr 230 | ||
241 | #define __NR_ia32_fgetxattr 231 | ||
242 | #define __NR_ia32_listxattr 232 | ||
243 | #define __NR_ia32_llistxattr 233 | ||
244 | #define __NR_ia32_flistxattr 234 | ||
245 | #define __NR_ia32_removexattr 235 | ||
246 | #define __NR_ia32_lremovexattr 236 | ||
247 | #define __NR_ia32_fremovexattr 237 | ||
248 | #define __NR_ia32_tkill 238 | ||
249 | #define __NR_ia32_sendfile64 239 | ||
250 | #define __NR_ia32_futex 240 | ||
251 | #define __NR_ia32_sched_setaffinity 241 | ||
252 | #define __NR_ia32_sched_getaffinity 242 | ||
253 | #define __NR_ia32_set_thread_area 243 | ||
254 | #define __NR_ia32_get_thread_area 244 | ||
255 | #define __NR_ia32_io_setup 245 | ||
256 | #define __NR_ia32_io_destroy 246 | ||
257 | #define __NR_ia32_io_getevents 247 | ||
258 | #define __NR_ia32_io_submit 248 | ||
259 | #define __NR_ia32_io_cancel 249 | ||
260 | #define __NR_ia32_exit_group 252 | ||
261 | #define __NR_ia32_lookup_dcookie 253 | ||
262 | #define __NR_ia32_sys_epoll_create 254 | ||
263 | #define __NR_ia32_sys_epoll_ctl 255 | ||
264 | #define __NR_ia32_sys_epoll_wait 256 | ||
265 | #define __NR_ia32_remap_file_pages 257 | ||
266 | #define __NR_ia32_set_tid_address 258 | ||
267 | #define __NR_ia32_timer_create 259 | ||
268 | #define __NR_ia32_timer_settime (__NR_ia32_timer_create+1) | ||
269 | #define __NR_ia32_timer_gettime (__NR_ia32_timer_create+2) | ||
270 | #define __NR_ia32_timer_getoverrun (__NR_ia32_timer_create+3) | ||
271 | #define __NR_ia32_timer_delete (__NR_ia32_timer_create+4) | ||
272 | #define __NR_ia32_clock_settime (__NR_ia32_timer_create+5) | ||
273 | #define __NR_ia32_clock_gettime (__NR_ia32_timer_create+6) | ||
274 | #define __NR_ia32_clock_getres (__NR_ia32_timer_create+7) | ||
275 | #define __NR_ia32_clock_nanosleep (__NR_ia32_timer_create+8) | ||
276 | #define __NR_ia32_statfs64 268 | ||
277 | #define __NR_ia32_fstatfs64 269 | ||
278 | #define __NR_ia32_tgkill 270 | ||
279 | #define __NR_ia32_utimes 271 | ||
280 | #define __NR_ia32_fadvise64_64 272 | ||
281 | #define __NR_ia32_vserver 273 | ||
282 | #define __NR_ia32_mbind 274 | ||
283 | #define __NR_ia32_get_mempolicy 275 | ||
284 | #define __NR_ia32_set_mempolicy 276 | ||
285 | #define __NR_ia32_mq_open 277 | ||
286 | #define __NR_ia32_mq_unlink (__NR_ia32_mq_open+1) | ||
287 | #define __NR_ia32_mq_timedsend (__NR_ia32_mq_open+2) | ||
288 | #define __NR_ia32_mq_timedreceive (__NR_ia32_mq_open+3) | ||
289 | #define __NR_ia32_mq_notify (__NR_ia32_mq_open+4) | ||
290 | #define __NR_ia32_mq_getsetattr (__NR_ia32_mq_open+5) | ||
291 | #define __NR_ia32_kexec 283 | ||
292 | #define __NR_ia32_waitid 284 | ||
293 | /* #define __NR_sys_setaltroot 285 */ | ||
294 | #define __NR_ia32_add_key 286 | ||
295 | #define __NR_ia32_request_key 287 | ||
296 | #define __NR_ia32_keyctl 288 | ||
297 | #define __NR_ia32_ioprio_set 289 | ||
298 | #define __NR_ia32_ioprio_get 290 | ||
299 | #define __NR_ia32_inotify_init 291 | ||
300 | #define __NR_ia32_inotify_add_watch 292 | ||
301 | #define __NR_ia32_inotify_rm_watch 293 | ||
302 | #define __NR_ia32_migrate_pages 294 | ||
303 | #define __NR_ia32_openat 295 | ||
304 | #define __NR_ia32_mkdirat 296 | ||
305 | #define __NR_ia32_mknodat 297 | ||
306 | #define __NR_ia32_fchownat 298 | ||
307 | #define __NR_ia32_futimesat 299 | ||
308 | #define __NR_ia32_fstatat64 300 | ||
309 | #define __NR_ia32_unlinkat 301 | ||
310 | #define __NR_ia32_renameat 302 | ||
311 | #define __NR_ia32_linkat 303 | ||
312 | #define __NR_ia32_symlinkat 304 | ||
313 | #define __NR_ia32_readlinkat 305 | ||
314 | #define __NR_ia32_fchmodat 306 | ||
315 | #define __NR_ia32_faccessat 307 | ||
316 | #define __NR_ia32_pselect6 308 | ||
317 | #define __NR_ia32_ppoll 309 | ||
318 | #define __NR_ia32_unshare 310 | ||
319 | 17 | ||
320 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ | 18 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ |
diff --git a/include/asm-x86_64/intel_arch_perfmon.h b/include/asm-x86_64/intel_arch_perfmon.h new file mode 100644 index 000000000000..59c396431569 --- /dev/null +++ b/include/asm-x86_64/intel_arch_perfmon.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef X86_64_INTEL_ARCH_PERFMON_H | ||
2 | #define X86_64_INTEL_ARCH_PERFMON_H 1 | ||
3 | |||
4 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 | ||
5 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 | ||
6 | |||
7 | #define MSR_ARCH_PERFMON_EVENTSEL0 0x186 | ||
8 | #define MSR_ARCH_PERFMON_EVENTSEL1 0x187 | ||
9 | |||
10 | #define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) | ||
11 | #define ARCH_PERFMON_EVENTSEL_INT (1 << 20) | ||
12 | #define ARCH_PERFMON_EVENTSEL_OS (1 << 17) | ||
13 | #define ARCH_PERFMON_EVENTSEL_USR (1 << 16) | ||
14 | |||
15 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) | ||
16 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) | ||
17 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT (1 << 0) | ||
18 | |||
19 | #endif /* X86_64_INTEL_ARCH_PERFMON_H */ | ||
diff --git a/include/asm-x86_64/k8.h b/include/asm-x86_64/k8.h new file mode 100644 index 000000000000..699dd6961eda --- /dev/null +++ b/include/asm-x86_64/k8.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_K8_H | ||
2 | #define _ASM_K8_H 1 | ||
3 | |||
4 | #include <linux/pci.h> | ||
5 | |||
6 | extern struct pci_device_id k8_nb_ids[]; | ||
7 | |||
8 | extern int early_is_k8_nb(u32 value); | ||
9 | extern struct pci_dev **k8_northbridges; | ||
10 | extern int num_k8_northbridges; | ||
11 | extern int cache_k8_northbridges(void); | ||
12 | extern void k8_flush_garts(void); | ||
13 | |||
14 | #endif | ||
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/asm-x86_64/local.h b/include/asm-x86_64/local.h index cd17945bf218..e769e6200225 100644 --- a/include/asm-x86_64/local.h +++ b/include/asm-x86_64/local.h | |||
@@ -59,12 +59,26 @@ static inline void local_sub(long i, local_t *v) | |||
59 | * This could be done better if we moved the per cpu data directly | 59 | * This could be done better if we moved the per cpu data directly |
60 | * after GS. | 60 | * after GS. |
61 | */ | 61 | */ |
62 | #define cpu_local_read(v) local_read(&__get_cpu_var(v)) | 62 | |
63 | #define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) | 63 | /* Need to disable preemption for the cpu local counters otherwise we could |
64 | #define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) | 64 | still access a variable of a previous CPU in a non atomic way. */ |
65 | #define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) | 65 | #define cpu_local_wrap_v(v) \ |
66 | #define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) | 66 | ({ local_t res__; \ |
67 | #define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) | 67 | preempt_disable(); \ |
68 | res__ = (v); \ | ||
69 | preempt_enable(); \ | ||
70 | res__; }) | ||
71 | #define cpu_local_wrap(v) \ | ||
72 | ({ preempt_disable(); \ | ||
73 | v; \ | ||
74 | preempt_enable(); }) \ | ||
75 | |||
76 | #define cpu_local_read(v) cpu_local_wrap_v(local_read(&__get_cpu_var(v))) | ||
77 | #define cpu_local_set(v, i) cpu_local_wrap(local_set(&__get_cpu_var(v), (i))) | ||
78 | #define cpu_local_inc(v) cpu_local_wrap(local_inc(&__get_cpu_var(v))) | ||
79 | #define cpu_local_dec(v) cpu_local_wrap(local_dec(&__get_cpu_var(v))) | ||
80 | #define cpu_local_add(i, v) cpu_local_wrap(local_add((i), &__get_cpu_var(v))) | ||
81 | #define cpu_local_sub(i, v) cpu_local_wrap(local_sub((i), &__get_cpu_var(v))) | ||
68 | 82 | ||
69 | #define __cpu_local_inc(v) cpu_local_inc(v) | 83 | #define __cpu_local_inc(v) cpu_local_inc(v) |
70 | #define __cpu_local_dec(v) cpu_local_dec(v) | 84 | #define __cpu_local_dec(v) cpu_local_dec(v) |
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h index 7229785094e3..d13687dfd691 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86_64/mce.h | |||
@@ -67,13 +67,22 @@ struct mce_log { | |||
67 | /* Software defined banks */ | 67 | /* Software defined banks */ |
68 | #define MCE_EXTENDED_BANK 128 | 68 | #define MCE_EXTENDED_BANK 128 |
69 | #define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0 | 69 | #define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0 |
70 | #define MCE_THRESHOLD_BASE MCE_EXTENDED_BANK + 1 /* MCE_AMD */ | 70 | |
71 | #define MCE_THRESHOLD_DRAM_ECC MCE_THRESHOLD_BASE + 4 | 71 | #define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */ |
72 | #define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9) | ||
73 | #define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9) | ||
74 | #define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9) | ||
75 | #define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9) | ||
76 | #define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9) | ||
77 | #define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) | ||
78 | #define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) | ||
72 | 79 | ||
73 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
74 | #include <asm/atomic.h> | 81 | #include <asm/atomic.h> |
75 | 82 | ||
76 | void mce_log(struct mce *m); | 83 | void mce_log(struct mce *m); |
84 | DECLARE_PER_CPU(struct sys_device, device_mce); | ||
85 | |||
77 | #ifdef CONFIG_X86_MCE_INTEL | 86 | #ifdef CONFIG_X86_MCE_INTEL |
78 | void mce_intel_feature_init(struct cpuinfo_x86 *c); | 87 | void mce_intel_feature_init(struct cpuinfo_x86 *c); |
79 | #else | 88 | #else |
diff --git a/include/asm-x86_64/mutex.h b/include/asm-x86_64/mutex.h index 11fbee2bd6c0..06fab6de2a88 100644 --- a/include/asm-x86_64/mutex.h +++ b/include/asm-x86_64/mutex.h | |||
@@ -24,7 +24,7 @@ do { \ | |||
24 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ | 24 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ |
25 | \ | 25 | \ |
26 | __asm__ __volatile__( \ | 26 | __asm__ __volatile__( \ |
27 | LOCK " decl (%%rdi) \n" \ | 27 | LOCK_PREFIX " decl (%%rdi) \n" \ |
28 | " js 2f \n" \ | 28 | " js 2f \n" \ |
29 | "1: \n" \ | 29 | "1: \n" \ |
30 | \ | 30 | \ |
@@ -74,7 +74,7 @@ do { \ | |||
74 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ | 74 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ |
75 | \ | 75 | \ |
76 | __asm__ __volatile__( \ | 76 | __asm__ __volatile__( \ |
77 | LOCK " incl (%%rdi) \n" \ | 77 | LOCK_PREFIX " incl (%%rdi) \n" \ |
78 | " jle 2f \n" \ | 78 | " jle 2f \n" \ |
79 | "1: \n" \ | 79 | "1: \n" \ |
80 | \ | 80 | \ |
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h index d3abfc6a8fd5..efb45c894d76 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86_64/nmi.h | |||
@@ -5,26 +5,27 @@ | |||
5 | #define ASM_NMI_H | 5 | #define ASM_NMI_H |
6 | 6 | ||
7 | #include <linux/pm.h> | 7 | #include <linux/pm.h> |
8 | #include <asm/io.h> | ||
8 | 9 | ||
9 | struct pt_regs; | 10 | struct pt_regs; |
10 | 11 | ||
11 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); | 12 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); |
12 | 13 | ||
13 | /** | 14 | /** |
14 | * set_nmi_callback | 15 | * set_nmi_callback |
15 | * | 16 | * |
16 | * Set a handler for an NMI. Only one handler may be | 17 | * Set a handler for an NMI. Only one handler may be |
17 | * set. Return 1 if the NMI was handled. | 18 | * set. Return 1 if the NMI was handled. |
18 | */ | 19 | */ |
19 | void set_nmi_callback(nmi_callback_t callback); | 20 | void set_nmi_callback(nmi_callback_t callback); |
20 | 21 | ||
21 | /** | 22 | /** |
22 | * unset_nmi_callback | 23 | * unset_nmi_callback |
23 | * | 24 | * |
24 | * Remove the handler previously set. | 25 | * Remove the handler previously set. |
25 | */ | 26 | */ |
26 | void unset_nmi_callback(void); | 27 | void unset_nmi_callback(void); |
27 | 28 | ||
28 | #ifdef CONFIG_PM | 29 | #ifdef CONFIG_PM |
29 | 30 | ||
30 | /** Replace the PM callback routine for NMI. */ | 31 | /** Replace the PM callback routine for NMI. */ |
@@ -56,4 +57,21 @@ extern int unknown_nmi_panic; | |||
56 | 57 | ||
57 | extern int check_nmi_watchdog(void); | 58 | extern int check_nmi_watchdog(void); |
58 | 59 | ||
60 | extern void setup_apic_nmi_watchdog (void); | ||
61 | extern int reserve_lapic_nmi(void); | ||
62 | extern void release_lapic_nmi(void); | ||
63 | extern void disable_timer_nmi_watchdog(void); | ||
64 | extern void enable_timer_nmi_watchdog(void); | ||
65 | extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); | ||
66 | |||
67 | extern void nmi_watchdog_default(void); | ||
68 | extern int setup_nmi_watchdog(char *); | ||
69 | |||
70 | extern unsigned int nmi_watchdog; | ||
71 | #define NMI_DEFAULT -1 | ||
72 | #define NMI_NONE 0 | ||
73 | #define NMI_IO_APIC 1 | ||
74 | #define NMI_LOCAL_APIC 2 | ||
75 | #define NMI_INVALID 3 | ||
76 | |||
59 | #endif /* ASM_NMI_H */ | 77 | #endif /* ASM_NMI_H */ |
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 2db0620d5449..49c5e9280598 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h | |||
@@ -39,8 +39,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | |||
39 | #include <asm/scatterlist.h> | 39 | #include <asm/scatterlist.h> |
40 | #include <linux/string.h> | 40 | #include <linux/string.h> |
41 | #include <asm/page.h> | 41 | #include <asm/page.h> |
42 | #include <linux/dma-mapping.h> /* for have_iommu */ | ||
43 | 42 | ||
43 | extern void pci_iommu_alloc(void); | ||
44 | extern int iommu_setup(char *opt); | 44 | extern int iommu_setup(char *opt); |
45 | 45 | ||
46 | /* The PCI address space does equal the physical memory | 46 | /* The PCI address space does equal the physical memory |
@@ -52,7 +52,7 @@ extern int iommu_setup(char *opt); | |||
52 | */ | 52 | */ |
53 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | 53 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
54 | 54 | ||
55 | #ifdef CONFIG_GART_IOMMU | 55 | #if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU) |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * x86-64 always supports DAC, but sometimes it is useful to force | 58 | * x86-64 always supports DAC, but sometimes it is useful to force |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 31e83c3bd022..a31ab4e68a9b 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -337,14 +337,8 @@ static inline int pmd_large(pmd_t pte) { | |||
337 | /* to find an entry in a page-table-directory. */ | 337 | /* to find an entry in a page-table-directory. */ |
338 | #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | 338 | #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) |
339 | #define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address)) | 339 | #define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address)) |
340 | #define pud_offset_k(pgd, addr) pud_offset(pgd, addr) | ||
341 | #define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT) | 340 | #define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT) |
342 | 341 | ||
343 | static inline pud_t *__pud_offset_k(pud_t *pud, unsigned long address) | ||
344 | { | ||
345 | return pud + pud_index(address); | ||
346 | } | ||
347 | |||
348 | /* PMD - Level 2 access */ | 342 | /* PMD - Level 2 access */ |
349 | #define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK)) | 343 | #define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK)) |
350 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) | 344 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) |
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 3061a38a3b1d..3b3c1217fe61 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h | |||
@@ -69,7 +69,11 @@ struct cpuinfo_x86 { | |||
69 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ | 69 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ |
70 | #endif | 70 | #endif |
71 | __u8 apicid; | 71 | __u8 apicid; |
72 | #ifdef CONFIG_SMP | ||
72 | __u8 booted_cores; /* number of cores as seen by OS */ | 73 | __u8 booted_cores; /* number of cores as seen by OS */ |
74 | __u8 phys_proc_id; /* Physical Processor id. */ | ||
75 | __u8 cpu_core_id; /* Core id. */ | ||
76 | #endif | ||
73 | } ____cacheline_aligned; | 77 | } ____cacheline_aligned; |
74 | 78 | ||
75 | #define X86_VENDOR_INTEL 0 | 79 | #define X86_VENDOR_INTEL 0 |
@@ -96,6 +100,7 @@ extern char ignore_irq13; | |||
96 | extern void identify_cpu(struct cpuinfo_x86 *); | 100 | extern void identify_cpu(struct cpuinfo_x86 *); |
97 | extern void print_cpu_info(struct cpuinfo_x86 *); | 101 | extern void print_cpu_info(struct cpuinfo_x86 *); |
98 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 102 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
103 | extern unsigned short num_cache_leaves; | ||
99 | 104 | ||
100 | /* | 105 | /* |
101 | * EFLAGS bits | 106 | * EFLAGS bits |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index 8abf2a43c944..038fe1f47e6f 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -37,7 +37,6 @@ extern void ia32_sysenter_target(void); | |||
37 | 37 | ||
38 | extern void config_acpi_tables(void); | 38 | extern void config_acpi_tables(void); |
39 | extern void ia32_syscall(void); | 39 | extern void ia32_syscall(void); |
40 | extern void iommu_hole_init(void); | ||
41 | 40 | ||
42 | extern int pmtimer_mark_offset(void); | 41 | extern int pmtimer_mark_offset(void); |
43 | extern void pmtimer_resume(void); | 42 | extern void pmtimer_resume(void); |
@@ -75,7 +74,7 @@ extern void main_timer_handler(struct pt_regs *regs); | |||
75 | 74 | ||
76 | extern unsigned long end_pfn_map; | 75 | extern unsigned long end_pfn_map; |
77 | 76 | ||
78 | extern void show_trace(unsigned long * rsp); | 77 | extern void show_trace(struct task_struct *, struct pt_regs *, unsigned long * rsp); |
79 | extern void show_registers(struct pt_regs *regs); | 78 | extern void show_registers(struct pt_regs *regs); |
80 | 79 | ||
81 | extern void exception_table_check(void); | 80 | extern void exception_table_check(void); |
@@ -101,13 +100,9 @@ extern int unsynchronized_tsc(void); | |||
101 | 100 | ||
102 | extern void select_idle_routine(const struct cpuinfo_x86 *c); | 101 | extern void select_idle_routine(const struct cpuinfo_x86 *c); |
103 | 102 | ||
104 | extern void gart_parse_options(char *); | ||
105 | extern void __init no_iommu_init(void); | ||
106 | |||
107 | extern unsigned long table_start, table_end; | 103 | extern unsigned long table_start, table_end; |
108 | 104 | ||
109 | extern int exception_trace; | 105 | extern int exception_trace; |
110 | extern int force_iommu, no_iommu; | ||
111 | extern int using_apic_timer; | 106 | extern int using_apic_timer; |
112 | extern int disable_apic; | 107 | extern int disable_apic; |
113 | extern unsigned cpu_khz; | 108 | extern unsigned cpu_khz; |
@@ -116,7 +111,13 @@ extern int skip_ioapic_setup; | |||
116 | extern int acpi_ht; | 111 | extern int acpi_ht; |
117 | extern int acpi_disabled; | 112 | extern int acpi_disabled; |
118 | 113 | ||
119 | #ifdef CONFIG_GART_IOMMU | 114 | extern void no_iommu_init(void); |
115 | extern int force_iommu, no_iommu; | ||
116 | extern int iommu_detected; | ||
117 | #ifdef CONFIG_IOMMU | ||
118 | extern void gart_iommu_init(void); | ||
119 | extern void gart_parse_options(char *); | ||
120 | extern void iommu_hole_init(void); | ||
120 | extern int fallback_aper_order; | 121 | extern int fallback_aper_order; |
121 | extern int fallback_aper_force; | 122 | extern int fallback_aper_force; |
122 | extern int iommu_aperture; | 123 | extern int iommu_aperture; |
diff --git a/include/asm-x86_64/rwlock.h b/include/asm-x86_64/rwlock.h index 9942cc393064..dea0e9459264 100644 --- a/include/asm-x86_64/rwlock.h +++ b/include/asm-x86_64/rwlock.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #define RW_LOCK_BIAS_STR "0x01000000" | 24 | #define RW_LOCK_BIAS_STR "0x01000000" |
25 | 25 | ||
26 | #define __build_read_lock_ptr(rw, helper) \ | 26 | #define __build_read_lock_ptr(rw, helper) \ |
27 | asm volatile(LOCK "subl $1,(%0)\n\t" \ | 27 | asm volatile(LOCK_PREFIX "subl $1,(%0)\n\t" \ |
28 | "js 2f\n" \ | 28 | "js 2f\n" \ |
29 | "1:\n" \ | 29 | "1:\n" \ |
30 | LOCK_SECTION_START("") \ | 30 | LOCK_SECTION_START("") \ |
@@ -34,7 +34,7 @@ | |||
34 | ::"a" (rw) : "memory") | 34 | ::"a" (rw) : "memory") |
35 | 35 | ||
36 | #define __build_read_lock_const(rw, helper) \ | 36 | #define __build_read_lock_const(rw, helper) \ |
37 | asm volatile(LOCK "subl $1,%0\n\t" \ | 37 | asm volatile(LOCK_PREFIX "subl $1,%0\n\t" \ |
38 | "js 2f\n" \ | 38 | "js 2f\n" \ |
39 | "1:\n" \ | 39 | "1:\n" \ |
40 | LOCK_SECTION_START("") \ | 40 | LOCK_SECTION_START("") \ |
@@ -54,7 +54,7 @@ | |||
54 | } while (0) | 54 | } while (0) |
55 | 55 | ||
56 | #define __build_write_lock_ptr(rw, helper) \ | 56 | #define __build_write_lock_ptr(rw, helper) \ |
57 | asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ | 57 | asm volatile(LOCK_PREFIX "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ |
58 | "jnz 2f\n" \ | 58 | "jnz 2f\n" \ |
59 | "1:\n" \ | 59 | "1:\n" \ |
60 | LOCK_SECTION_START("") \ | 60 | LOCK_SECTION_START("") \ |
@@ -64,7 +64,7 @@ | |||
64 | ::"a" (rw) : "memory") | 64 | ::"a" (rw) : "memory") |
65 | 65 | ||
66 | #define __build_write_lock_const(rw, helper) \ | 66 | #define __build_write_lock_const(rw, helper) \ |
67 | asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ | 67 | asm volatile(LOCK_PREFIX "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ |
68 | "jnz 2f\n" \ | 68 | "jnz 2f\n" \ |
69 | "1:\n" \ | 69 | "1:\n" \ |
70 | LOCK_SECTION_START("") \ | 70 | LOCK_SECTION_START("") \ |
diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h index a389aa6fe80f..064df08b9a0f 100644 --- a/include/asm-x86_64/semaphore.h +++ b/include/asm-x86_64/semaphore.h | |||
@@ -106,7 +106,7 @@ static inline void down(struct semaphore * sem) | |||
106 | 106 | ||
107 | __asm__ __volatile__( | 107 | __asm__ __volatile__( |
108 | "# atomic down operation\n\t" | 108 | "# atomic down operation\n\t" |
109 | LOCK "decl %0\n\t" /* --sem->count */ | 109 | LOCK_PREFIX "decl %0\n\t" /* --sem->count */ |
110 | "js 2f\n" | 110 | "js 2f\n" |
111 | "1:\n" | 111 | "1:\n" |
112 | LOCK_SECTION_START("") | 112 | LOCK_SECTION_START("") |
@@ -130,7 +130,7 @@ static inline int down_interruptible(struct semaphore * sem) | |||
130 | 130 | ||
131 | __asm__ __volatile__( | 131 | __asm__ __volatile__( |
132 | "# atomic interruptible down operation\n\t" | 132 | "# atomic interruptible down operation\n\t" |
133 | LOCK "decl %1\n\t" /* --sem->count */ | 133 | LOCK_PREFIX "decl %1\n\t" /* --sem->count */ |
134 | "js 2f\n\t" | 134 | "js 2f\n\t" |
135 | "xorl %0,%0\n" | 135 | "xorl %0,%0\n" |
136 | "1:\n" | 136 | "1:\n" |
@@ -154,7 +154,7 @@ static inline int down_trylock(struct semaphore * sem) | |||
154 | 154 | ||
155 | __asm__ __volatile__( | 155 | __asm__ __volatile__( |
156 | "# atomic interruptible down operation\n\t" | 156 | "# atomic interruptible down operation\n\t" |
157 | LOCK "decl %1\n\t" /* --sem->count */ | 157 | LOCK_PREFIX "decl %1\n\t" /* --sem->count */ |
158 | "js 2f\n\t" | 158 | "js 2f\n\t" |
159 | "xorl %0,%0\n" | 159 | "xorl %0,%0\n" |
160 | "1:\n" | 160 | "1:\n" |
@@ -178,7 +178,7 @@ static inline void up(struct semaphore * sem) | |||
178 | { | 178 | { |
179 | __asm__ __volatile__( | 179 | __asm__ __volatile__( |
180 | "# atomic up operation\n\t" | 180 | "# atomic up operation\n\t" |
181 | LOCK "incl %0\n\t" /* ++sem->count */ | 181 | LOCK_PREFIX "incl %0\n\t" /* ++sem->count */ |
182 | "jle 2f\n" | 182 | "jle 2f\n" |
183 | "1:\n" | 183 | "1:\n" |
184 | LOCK_SECTION_START("") | 184 | LOCK_SECTION_START("") |
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 7686b9b25aef..6805e1feb300 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -53,8 +53,6 @@ extern int smp_call_function_single(int cpuid, void (*func) (void *info), | |||
53 | 53 | ||
54 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 54 | extern cpumask_t cpu_sibling_map[NR_CPUS]; |
55 | extern cpumask_t cpu_core_map[NR_CPUS]; | 55 | extern cpumask_t cpu_core_map[NR_CPUS]; |
56 | extern u8 phys_proc_id[NR_CPUS]; | ||
57 | extern u8 cpu_core_id[NR_CPUS]; | ||
58 | extern u8 cpu_llc_id[NR_CPUS]; | 56 | extern u8 cpu_llc_id[NR_CPUS]; |
59 | 57 | ||
60 | #define SMP_TRAMPOLINE_BASE 0x6000 | 58 | #define SMP_TRAMPOLINE_BASE 0x6000 |
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h index 5d8a5e3589ff..8d3421996f94 100644 --- a/include/asm-x86_64/spinlock.h +++ b/include/asm-x86_64/spinlock.h | |||
@@ -31,15 +31,19 @@ | |||
31 | "jmp 1b\n" \ | 31 | "jmp 1b\n" \ |
32 | LOCK_SECTION_END | 32 | LOCK_SECTION_END |
33 | 33 | ||
34 | #define __raw_spin_lock_string_up \ | ||
35 | "\n\tdecl %0" | ||
36 | |||
34 | #define __raw_spin_unlock_string \ | 37 | #define __raw_spin_unlock_string \ |
35 | "movl $1,%0" \ | 38 | "movl $1,%0" \ |
36 | :"=m" (lock->slock) : : "memory" | 39 | :"=m" (lock->slock) : : "memory" |
37 | 40 | ||
38 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 41 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
39 | { | 42 | { |
40 | __asm__ __volatile__( | 43 | alternative_smp( |
41 | __raw_spin_lock_string | 44 | __raw_spin_lock_string, |
42 | :"=m" (lock->slock) : : "memory"); | 45 | __raw_spin_lock_string_up, |
46 | "=m" (lock->slock) : : "memory"); | ||
43 | } | 47 | } |
44 | 48 | ||
45 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 49 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h index ee6bf275349e..9505d9f4bead 100644 --- a/include/asm-x86_64/string.h +++ b/include/asm-x86_64/string.h | |||
@@ -6,7 +6,8 @@ | |||
6 | /* Written 2002 by Andi Kleen */ | 6 | /* Written 2002 by Andi Kleen */ |
7 | 7 | ||
8 | /* Only used for special circumstances. Stolen from i386/string.h */ | 8 | /* Only used for special circumstances. Stolen from i386/string.h */ |
9 | static inline void * __inline_memcpy(void * to, const void * from, size_t n) | 9 | static __always_inline void * |
10 | __inline_memcpy(void * to, const void * from, size_t n) | ||
10 | { | 11 | { |
11 | unsigned long d0, d1, d2; | 12 | unsigned long d0, d1, d2; |
12 | __asm__ __volatile__( | 13 | __asm__ __volatile__( |
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index f48e0dad8b3d..68e559f3631c 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -3,15 +3,10 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <asm/segment.h> | 5 | #include <asm/segment.h> |
6 | #include <asm/alternative.h> | ||
6 | 7 | ||
7 | #ifdef __KERNEL__ | 8 | #ifdef __KERNEL__ |
8 | 9 | ||
9 | #ifdef CONFIG_SMP | ||
10 | #define LOCK_PREFIX "lock ; " | ||
11 | #else | ||
12 | #define LOCK_PREFIX "" | ||
13 | #endif | ||
14 | |||
15 | #define __STR(x) #x | 10 | #define __STR(x) #x |
16 | #define STR(x) __STR(x) | 11 | #define STR(x) __STR(x) |
17 | 12 | ||
@@ -34,7 +29,7 @@ | |||
34 | "thread_return:\n\t" \ | 29 | "thread_return:\n\t" \ |
35 | "movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \ | 30 | "movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \ |
36 | "movq %P[thread_info](%%rsi),%%r8\n\t" \ | 31 | "movq %P[thread_info](%%rsi),%%r8\n\t" \ |
37 | LOCK "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \ | 32 | LOCK_PREFIX "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \ |
38 | "movq %%rax,%%rdi\n\t" \ | 33 | "movq %%rax,%%rdi\n\t" \ |
39 | "jc ret_from_fork\n\t" \ | 34 | "jc ret_from_fork\n\t" \ |
40 | RESTORE_CONTEXT \ | 35 | RESTORE_CONTEXT \ |
@@ -69,82 +64,6 @@ extern void load_gs_index(unsigned); | |||
69 | ".previous" \ | 64 | ".previous" \ |
70 | : :"r" (value), "r" (0)) | 65 | : :"r" (value), "r" (0)) |
71 | 66 | ||
72 | #ifdef __KERNEL__ | ||
73 | struct alt_instr { | ||
74 | __u8 *instr; /* original instruction */ | ||
75 | __u8 *replacement; | ||
76 | __u8 cpuid; /* cpuid bit set for replacement */ | ||
77 | __u8 instrlen; /* length of original instruction */ | ||
78 | __u8 replacementlen; /* length of new instruction, <= instrlen */ | ||
79 | __u8 pad[5]; | ||
80 | }; | ||
81 | #endif | ||
82 | |||
83 | /* | ||
84 | * Alternative instructions for different CPU types or capabilities. | ||
85 | * | ||
86 | * This allows to use optimized instructions even on generic binary | ||
87 | * kernels. | ||
88 | * | ||
89 | * length of oldinstr must be longer or equal the length of newinstr | ||
90 | * It can be padded with nops as needed. | ||
91 | * | ||
92 | * For non barrier like inlines please define new variants | ||
93 | * without volatile and memory clobber. | ||
94 | */ | ||
95 | #define alternative(oldinstr, newinstr, feature) \ | ||
96 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
97 | ".section .altinstructions,\"a\"\n" \ | ||
98 | " .align 8\n" \ | ||
99 | " .quad 661b\n" /* label */ \ | ||
100 | " .quad 663f\n" /* new instruction */ \ | ||
101 | " .byte %c0\n" /* feature bit */ \ | ||
102 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
103 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
104 | ".previous\n" \ | ||
105 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
106 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
107 | ".previous" :: "i" (feature) : "memory") | ||
108 | |||
109 | /* | ||
110 | * Alternative inline assembly with input. | ||
111 | * | ||
112 | * Peculiarities: | ||
113 | * No memory clobber here. | ||
114 | * Argument numbers start with 1. | ||
115 | * Best is to use constraints that are fixed size (like (%1) ... "r") | ||
116 | * If you use variable sized constraints like "m" or "g" in the | ||
117 | * replacement make sure to pad to the worst case length. | ||
118 | */ | ||
119 | #define alternative_input(oldinstr, newinstr, feature, input...) \ | ||
120 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
121 | ".section .altinstructions,\"a\"\n" \ | ||
122 | " .align 8\n" \ | ||
123 | " .quad 661b\n" /* label */ \ | ||
124 | " .quad 663f\n" /* new instruction */ \ | ||
125 | " .byte %c0\n" /* feature bit */ \ | ||
126 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
127 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
128 | ".previous\n" \ | ||
129 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
130 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
131 | ".previous" :: "i" (feature), ##input) | ||
132 | |||
133 | /* Like alternative_input, but with a single output argument */ | ||
134 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
135 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
136 | ".section .altinstructions,\"a\"\n" \ | ||
137 | " .align 8\n" \ | ||
138 | " .quad 661b\n" /* label */ \ | ||
139 | " .quad 663f\n" /* new instruction */ \ | ||
140 | " .byte %c[feat]\n" /* feature bit */ \ | ||
141 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
142 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
143 | ".previous\n" \ | ||
144 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
145 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
146 | ".previous" : output : [feat] "i" (feature), ##input) | ||
147 | |||
148 | /* | 67 | /* |
149 | * Clear and set 'TS' bit respectively | 68 | * Clear and set 'TS' bit respectively |
150 | */ | 69 | */ |
@@ -366,5 +285,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
366 | void cpu_idle_wait(void); | 285 | void cpu_idle_wait(void); |
367 | 286 | ||
368 | extern unsigned long arch_align_stack(unsigned long sp); | 287 | extern unsigned long arch_align_stack(unsigned long sp); |
288 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | ||
369 | 289 | ||
370 | #endif | 290 | #endif |
diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h new file mode 100644 index 000000000000..ee51d31528d6 --- /dev/null +++ b/include/asm-x86_64/tce.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation | ||
3 | * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation | ||
4 | * | ||
5 | * This file is derived from asm-powerpc/tce.h. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef _ASM_X86_64_TCE_H | ||
23 | #define _ASM_X86_64_TCE_H | ||
24 | |||
25 | extern void* tce_table_kva[]; | ||
26 | extern unsigned int specified_table_size; | ||
27 | struct iommu_table; | ||
28 | |||
29 | #define TCE_ENTRY_SIZE 8 /* in bytes */ | ||
30 | |||
31 | #define TCE_READ_SHIFT 0 | ||
32 | #define TCE_WRITE_SHIFT 1 | ||
33 | #define TCE_HUBID_SHIFT 2 /* unused */ | ||
34 | #define TCE_RSVD_SHIFT 8 /* unused */ | ||
35 | #define TCE_RPN_SHIFT 12 | ||
36 | #define TCE_UNUSED_SHIFT 48 /* unused */ | ||
37 | |||
38 | #define TCE_RPN_MASK 0x0000fffffffff000ULL | ||
39 | |||
40 | extern void tce_build(struct iommu_table *tbl, unsigned long index, | ||
41 | unsigned int npages, unsigned long uaddr, int direction); | ||
42 | extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages); | ||
43 | extern void* alloc_tce_table(void); | ||
44 | extern void free_tce_table(void *tbl); | ||
45 | extern int build_tce_table(struct pci_dev *dev, void __iomem *bbar); | ||
46 | |||
47 | #endif /* _ASM_X86_64_TCE_H */ | ||
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h index 4ac0e0a36934..2029b00351f3 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86_64/thread_info.h | |||
@@ -73,8 +73,21 @@ static inline struct thread_info *stack_thread_info(void) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* thread information allocation */ | 75 | /* thread information allocation */ |
76 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
77 | #define alloc_thread_info(tsk) \ | ||
78 | ({ \ | ||
79 | struct thread_info *ret; \ | ||
80 | \ | ||
81 | ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \ | ||
82 | if (ret) \ | ||
83 | memset(ret, 0, THREAD_SIZE); \ | ||
84 | ret; \ | ||
85 | }) | ||
86 | #else | ||
76 | #define alloc_thread_info(tsk) \ | 87 | #define alloc_thread_info(tsk) \ |
77 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) | 88 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) |
89 | #endif | ||
90 | |||
78 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) | 91 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) |
79 | 92 | ||
80 | #else /* !__ASSEMBLY__ */ | 93 | #else /* !__ASSEMBLY__ */ |
@@ -101,7 +114,7 @@ static inline struct thread_info *stack_thread_info(void) | |||
101 | #define TIF_IRET 5 /* force IRET */ | 114 | #define TIF_IRET 5 /* force IRET */ |
102 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 115 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
103 | #define TIF_SECCOMP 8 /* secure computing */ | 116 | #define TIF_SECCOMP 8 /* secure computing */ |
104 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 117 | /* 16 free */ |
105 | #define TIF_IA32 17 /* 32bit process */ | 118 | #define TIF_IA32 17 /* 32bit process */ |
106 | #define TIF_FORK 18 /* ret_from_fork */ | 119 | #define TIF_FORK 18 /* ret_from_fork */ |
107 | #define TIF_ABI_PENDING 19 | 120 | #define TIF_ABI_PENDING 19 |
@@ -115,7 +128,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
115 | #define _TIF_IRET (1<<TIF_IRET) | 128 | #define _TIF_IRET (1<<TIF_IRET) |
116 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 129 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
117 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 130 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
118 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
119 | #define _TIF_IA32 (1<<TIF_IA32) | 131 | #define _TIF_IA32 (1<<TIF_IA32) |
120 | #define _TIF_FORK (1<<TIF_FORK) | 132 | #define _TIF_FORK (1<<TIF_FORK) |
121 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 133 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
@@ -137,6 +149,9 @@ static inline struct thread_info *stack_thread_info(void) | |||
137 | */ | 149 | */ |
138 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 150 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
139 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ | 151 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ |
152 | #define TS_POLLING 0x0004 /* true if in idle loop and not sleeping */ | ||
153 | |||
154 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | ||
140 | 155 | ||
141 | #endif /* __KERNEL__ */ | 156 | #endif /* __KERNEL__ */ |
142 | 157 | ||
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 80c4e44d011c..6e7a2e976b04 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h | |||
@@ -7,8 +7,6 @@ | |||
7 | #include <asm/mpspec.h> | 7 | #include <asm/mpspec.h> |
8 | #include <asm/bitops.h> | 8 | #include <asm/bitops.h> |
9 | 9 | ||
10 | /* Map the K8 CPU local memory controllers to a simple 1:1 CPU:NODE topology */ | ||
11 | |||
12 | extern cpumask_t cpu_online_map; | 10 | extern cpumask_t cpu_online_map; |
13 | 11 | ||
14 | extern unsigned char cpu_to_node[]; | 12 | extern unsigned char cpu_to_node[]; |
@@ -57,12 +55,12 @@ extern int __node_distance(int, int); | |||
57 | #endif | 55 | #endif |
58 | 56 | ||
59 | #ifdef CONFIG_SMP | 57 | #ifdef CONFIG_SMP |
60 | #define topology_physical_package_id(cpu) \ | 58 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) |
61 | (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) | 59 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) |
62 | #define topology_core_id(cpu) \ | ||
63 | (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu]) | ||
64 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 60 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) |
65 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 61 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) |
62 | #define mc_capable() (boot_cpu_data.x86_max_cores > 1) | ||
63 | #define smt_capable() (smp_num_siblings > 1) | ||
66 | #endif | 64 | #endif |
67 | 65 | ||
68 | #include <asm-generic/topology.h> | 66 | #include <asm-generic/topology.h> |
diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86_64/unwind.h new file mode 100644 index 000000000000..f3e7124effe3 --- /dev/null +++ b/include/asm-x86_64/unwind.h | |||
@@ -0,0 +1,106 @@ | |||
1 | #ifndef _ASM_X86_64_UNWIND_H | ||
2 | #define _ASM_X86_64_UNWIND_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
6 | * Jan Beulich <jbeulich@novell.com> | ||
7 | * This code is released under version 2 of the GNU GPL. | ||
8 | */ | ||
9 | |||
10 | #ifdef CONFIG_STACK_UNWIND | ||
11 | |||
12 | #include <linux/sched.h> | ||
13 | #include <asm/ptrace.h> | ||
14 | #include <asm/uaccess.h> | ||
15 | #include <asm/vsyscall.h> | ||
16 | |||
17 | struct unwind_frame_info | ||
18 | { | ||
19 | struct pt_regs regs; | ||
20 | struct task_struct *task; | ||
21 | }; | ||
22 | |||
23 | #define UNW_PC(frame) (frame)->regs.rip | ||
24 | #define UNW_SP(frame) (frame)->regs.rsp | ||
25 | #ifdef CONFIG_FRAME_POINTER | ||
26 | #define UNW_FP(frame) (frame)->regs.rbp | ||
27 | #define FRAME_RETADDR_OFFSET 8 | ||
28 | #define FRAME_LINK_OFFSET 0 | ||
29 | #define STACK_BOTTOM(tsk) (((tsk)->thread.rsp0 - 1) & ~(THREAD_SIZE - 1)) | ||
30 | #define STACK_TOP(tsk) ((tsk)->thread.rsp0) | ||
31 | #endif | ||
32 | /* Might need to account for the special exception and interrupt handling | ||
33 | stacks here, since normally | ||
34 | EXCEPTION_STACK_ORDER < THREAD_ORDER < IRQSTACK_ORDER, | ||
35 | but the construct is needed only for getting across the stack switch to | ||
36 | the interrupt stack - thus considering the IRQ stack itself is unnecessary, | ||
37 | and the overhead of comparing against all exception handling stacks seems | ||
38 | not desirable. */ | ||
39 | #define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1)) | ||
40 | |||
41 | #define UNW_REGISTER_INFO \ | ||
42 | PTREGS_INFO(rax), \ | ||
43 | PTREGS_INFO(rdx), \ | ||
44 | PTREGS_INFO(rcx), \ | ||
45 | PTREGS_INFO(rbx), \ | ||
46 | PTREGS_INFO(rsi), \ | ||
47 | PTREGS_INFO(rdi), \ | ||
48 | PTREGS_INFO(rbp), \ | ||
49 | PTREGS_INFO(rsp), \ | ||
50 | PTREGS_INFO(r8), \ | ||
51 | PTREGS_INFO(r9), \ | ||
52 | PTREGS_INFO(r10), \ | ||
53 | PTREGS_INFO(r11), \ | ||
54 | PTREGS_INFO(r12), \ | ||
55 | PTREGS_INFO(r13), \ | ||
56 | PTREGS_INFO(r14), \ | ||
57 | PTREGS_INFO(r15), \ | ||
58 | PTREGS_INFO(rip) | ||
59 | |||
60 | static inline void arch_unw_init_frame_info(struct unwind_frame_info *info, | ||
61 | /*const*/ struct pt_regs *regs) | ||
62 | { | ||
63 | info->regs = *regs; | ||
64 | } | ||
65 | |||
66 | static inline void arch_unw_init_blocked(struct unwind_frame_info *info) | ||
67 | { | ||
68 | extern const char thread_return[]; | ||
69 | |||
70 | memset(&info->regs, 0, sizeof(info->regs)); | ||
71 | info->regs.rip = (unsigned long)thread_return; | ||
72 | info->regs.cs = __KERNEL_CS; | ||
73 | __get_user(info->regs.rbp, (unsigned long *)info->task->thread.rsp); | ||
74 | info->regs.rsp = info->task->thread.rsp; | ||
75 | info->regs.ss = __KERNEL_DS; | ||
76 | } | ||
77 | |||
78 | extern int arch_unwind_init_running(struct unwind_frame_info *, | ||
79 | int (*callback)(struct unwind_frame_info *, | ||
80 | void *arg), | ||
81 | void *arg); | ||
82 | |||
83 | static inline int arch_unw_user_mode(const struct unwind_frame_info *info) | ||
84 | { | ||
85 | #if 0 /* This can only work when selector register saves/restores | ||
86 | are properly annotated (and tracked in UNW_REGISTER_INFO). */ | ||
87 | return user_mode(&info->regs); | ||
88 | #else | ||
89 | return (long)info->regs.rip >= 0 | ||
90 | || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END) | ||
91 | || (long)info->regs.rsp >= 0; | ||
92 | #endif | ||
93 | } | ||
94 | |||
95 | #else | ||
96 | |||
97 | #define UNW_PC(frame) ((void)(frame), 0) | ||
98 | |||
99 | static inline int arch_unw_user_mode(const void *info) | ||
100 | { | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | #endif | ||
105 | |||
106 | #endif /* _ASM_X86_64_UNWIND_H */ | ||
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/acpi.h b/include/linux/acpi.h index 90d6df1551ed..88b5dfd8ee12 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -528,12 +528,18 @@ static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; } | |||
528 | 528 | ||
529 | #ifdef CONFIG_ACPI_NUMA | 529 | #ifdef CONFIG_ACPI_NUMA |
530 | int acpi_get_pxm(acpi_handle handle); | 530 | int acpi_get_pxm(acpi_handle handle); |
531 | int acpi_get_node(acpi_handle *handle); | ||
531 | #else | 532 | #else |
532 | static inline int acpi_get_pxm(acpi_handle handle) | 533 | static inline int acpi_get_pxm(acpi_handle handle) |
533 | { | 534 | { |
534 | return 0; | 535 | return 0; |
535 | } | 536 | } |
537 | static inline int acpi_get_node(acpi_handle *handle) | ||
538 | { | ||
539 | return 0; | ||
540 | } | ||
536 | #endif | 541 | #endif |
542 | extern int acpi_paddr_to_node(u64 start_addr, u64 size); | ||
537 | 543 | ||
538 | extern int pnpacpi_disabled; | 544 | extern int pnpacpi_disabled; |
539 | 545 | ||
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index d9ed27969855..dcc5de7cc487 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -24,6 +24,9 @@ | |||
24 | * The available bitmap operations and their rough meaning in the | 24 | * The available bitmap operations and their rough meaning in the |
25 | * case that the bitmap is a single unsigned long are thus: | 25 | * case that the bitmap is a single unsigned long are thus: |
26 | * | 26 | * |
27 | * Note that nbits should be always a compile time evaluable constant. | ||
28 | * Otherwise many inlines will generate horrible code. | ||
29 | * | ||
27 | * bitmap_zero(dst, nbits) *dst = 0UL | 30 | * bitmap_zero(dst, nbits) *dst = 0UL |
28 | * bitmap_fill(dst, nbits) *dst = ~0UL | 31 | * bitmap_fill(dst, nbits) *dst = ~0UL |
29 | * bitmap_copy(dst, src, nbits) *dst = *src | 32 | * bitmap_copy(dst, src, nbits) *dst = *src |
@@ -244,6 +247,8 @@ static inline int bitmap_full(const unsigned long *src, int nbits) | |||
244 | 247 | ||
245 | static inline int bitmap_weight(const unsigned long *src, int nbits) | 248 | static inline int bitmap_weight(const unsigned long *src, int nbits) |
246 | { | 249 | { |
250 | if (nbits <= BITS_PER_LONG) | ||
251 | return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); | ||
247 | return __bitmap_weight(src, nbits); | 252 | return __bitmap_weight(src, nbits); |
248 | } | 253 | } |
249 | 254 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index fb7e9b7ccbe3..737e407d0cd1 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -149,7 +149,6 @@ void create_empty_buffers(struct page *, unsigned long, | |||
149 | unsigned long b_state); | 149 | unsigned long b_state); |
150 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); | 150 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); |
151 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); | 151 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); |
152 | void end_buffer_async_write(struct buffer_head *bh, int uptodate); | ||
153 | 152 | ||
154 | /* Things to do with buffers at mapping->private_list */ | 153 | /* Things to do with buffers at mapping->private_list */ |
155 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); | 154 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); |
@@ -214,6 +213,7 @@ int nobh_truncate_page(struct address_space *, loff_t); | |||
214 | int nobh_writepage(struct page *page, get_block_t *get_block, | 213 | int nobh_writepage(struct page *page, get_block_t *get_block, |
215 | struct writeback_control *wbc); | 214 | struct writeback_control *wbc); |
216 | 215 | ||
216 | void buffer_init(void); | ||
217 | 217 | ||
218 | /* | 218 | /* |
219 | * inline definitions | 219 | * inline definitions |
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.h b/include/linux/compat.h index dda1697ec753..9760753e662b 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -226,5 +226,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, | |||
226 | 226 | ||
227 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 227 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
228 | 228 | ||
229 | extern int compat_printk(const char *fmt, ...); | ||
230 | |||
229 | #endif /* CONFIG_COMPAT */ | 231 | #endif /* CONFIG_COMPAT */ |
230 | #endif /* _LINUX_COMPAT_H */ | 232 | #endif /* _LINUX_COMPAT_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/cpu.h b/include/linux/cpu.h index 08d50c53aab4..a3caf6866bae 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -31,17 +31,23 @@ struct cpu { | |||
31 | struct sys_device sysdev; | 31 | struct sys_device sysdev; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *cpu, int num); |
35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); | 35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
36 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
37 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *cpu); |
38 | #endif | 38 | #endif |
39 | struct notifier_block; | 39 | struct notifier_block; |
40 | 40 | ||
41 | #ifdef CONFIG_SMP | 41 | #ifdef CONFIG_SMP |
42 | /* Need to know about CPUs going up/down? */ | 42 | /* Need to know about CPUs going up/down? */ |
43 | extern int register_cpu_notifier(struct notifier_block *nb); | 43 | extern int register_cpu_notifier(struct notifier_block *nb); |
44 | #ifdef CONFIG_HOTPLUG_CPU | ||
44 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 45 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
46 | #else | ||
47 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | ||
48 | { | ||
49 | } | ||
50 | #endif | ||
45 | extern int current_in_cpu_hotplug(void); | 51 | extern int current_in_cpu_hotplug(void); |
46 | 52 | ||
47 | int cpu_up(unsigned int cpu); | 53 | int cpu_up(unsigned int cpu); |
@@ -73,6 +79,8 @@ extern int lock_cpu_hotplug_interruptible(void); | |||
73 | { .notifier_call = fn, .priority = pri }; \ | 79 | { .notifier_call = fn, .priority = pri }; \ |
74 | register_cpu_notifier(&fn##_nb); \ | 80 | register_cpu_notifier(&fn##_nb); \ |
75 | } | 81 | } |
82 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | ||
83 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | ||
76 | int cpu_down(unsigned int cpu); | 84 | int cpu_down(unsigned int cpu); |
77 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 85 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
78 | #else | 86 | #else |
@@ -80,6 +88,8 @@ int cpu_down(unsigned int cpu); | |||
80 | #define unlock_cpu_hotplug() do { } while (0) | 88 | #define unlock_cpu_hotplug() do { } while (0) |
81 | #define lock_cpu_hotplug_interruptible() 0 | 89 | #define lock_cpu_hotplug_interruptible() 0 |
82 | #define hotcpu_notifier(fn, pri) | 90 | #define hotcpu_notifier(fn, pri) |
91 | #define register_hotcpu_notifier(nb) | ||
92 | #define unregister_hotcpu_notifier(nb) | ||
83 | 93 | ||
84 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ | 94 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ |
85 | static inline int cpu_is_offline(int cpu) { return 0; } | 95 | static inline int cpu_is_offline(int cpu) { return 0; } |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 5a0470e36111..7f946241b879 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -66,7 +66,7 @@ struct crypto_tfm; | |||
66 | 66 | ||
67 | struct cipher_desc { | 67 | struct cipher_desc { |
68 | struct crypto_tfm *tfm; | 68 | struct crypto_tfm *tfm; |
69 | void (*crfn)(void *ctx, u8 *dst, const u8 *src); | 69 | void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
70 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, | 70 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, |
71 | const u8 *src, unsigned int nbytes); | 71 | const u8 *src, unsigned int nbytes); |
72 | void *info; | 72 | void *info; |
@@ -79,10 +79,10 @@ struct cipher_desc { | |||
79 | struct cipher_alg { | 79 | struct cipher_alg { |
80 | unsigned int cia_min_keysize; | 80 | unsigned int cia_min_keysize; |
81 | unsigned int cia_max_keysize; | 81 | unsigned int cia_max_keysize; |
82 | int (*cia_setkey)(void *ctx, const u8 *key, | 82 | int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, |
83 | unsigned int keylen, u32 *flags); | 83 | unsigned int keylen, u32 *flags); |
84 | void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); | 84 | void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
85 | void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); | 85 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
86 | 86 | ||
87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, | 87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, |
88 | u8 *dst, const u8 *src, | 88 | u8 *dst, const u8 *src, |
@@ -100,20 +100,19 @@ struct cipher_alg { | |||
100 | 100 | ||
101 | struct digest_alg { | 101 | struct digest_alg { |
102 | unsigned int dia_digestsize; | 102 | unsigned int dia_digestsize; |
103 | void (*dia_init)(void *ctx); | 103 | void (*dia_init)(struct crypto_tfm *tfm); |
104 | void (*dia_update)(void *ctx, const u8 *data, unsigned int len); | 104 | void (*dia_update)(struct crypto_tfm *tfm, const u8 *data, |
105 | void (*dia_final)(void *ctx, u8 *out); | 105 | unsigned int len); |
106 | int (*dia_setkey)(void *ctx, const u8 *key, | 106 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); |
107 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
107 | unsigned int keylen, u32 *flags); | 108 | unsigned int keylen, u32 *flags); |
108 | }; | 109 | }; |
109 | 110 | ||
110 | struct compress_alg { | 111 | struct compress_alg { |
111 | int (*coa_init)(void *ctx); | 112 | int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, |
112 | void (*coa_exit)(void *ctx); | 113 | unsigned int slen, u8 *dst, unsigned int *dlen); |
113 | int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, | 114 | int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src, |
114 | u8 *dst, unsigned int *dlen); | 115 | unsigned int slen, u8 *dst, unsigned int *dlen); |
115 | int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, | ||
116 | u8 *dst, unsigned int *dlen); | ||
117 | }; | 116 | }; |
118 | 117 | ||
119 | #define cra_cipher cra_u.cipher | 118 | #define cra_cipher cra_u.cipher |
@@ -129,14 +128,17 @@ struct crypto_alg { | |||
129 | 128 | ||
130 | int cra_priority; | 129 | int cra_priority; |
131 | 130 | ||
132 | const char cra_name[CRYPTO_MAX_ALG_NAME]; | 131 | char cra_name[CRYPTO_MAX_ALG_NAME]; |
133 | const char cra_driver_name[CRYPTO_MAX_ALG_NAME]; | 132 | char cra_driver_name[CRYPTO_MAX_ALG_NAME]; |
134 | 133 | ||
135 | union { | 134 | union { |
136 | struct cipher_alg cipher; | 135 | struct cipher_alg cipher; |
137 | struct digest_alg digest; | 136 | struct digest_alg digest; |
138 | struct compress_alg compress; | 137 | struct compress_alg compress; |
139 | } cra_u; | 138 | } cra_u; |
139 | |||
140 | int (*cra_init)(struct crypto_tfm *tfm); | ||
141 | void (*cra_exit)(struct crypto_tfm *tfm); | ||
140 | 142 | ||
141 | struct module *cra_module; | 143 | struct module *cra_module; |
142 | }; | 144 | }; |
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/dmaengine.h b/include/linux/dmaengine.h index 78b236ca04f8..272010a6078a 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | #ifndef DMAENGINE_H | 21 | #ifndef DMAENGINE_H |
22 | #define DMAENGINE_H | 22 | #define DMAENGINE_H |
23 | #include <linux/config.h> | 23 | |
24 | #ifdef CONFIG_DMA_ENGINE | 24 | #ifdef CONFIG_DMA_ENGINE |
25 | 25 | ||
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
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/futex.h b/include/linux/futex.h index 966a5b3da439..34c3a215f2cd 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -12,6 +12,9 @@ | |||
12 | #define FUTEX_REQUEUE 3 | 12 | #define FUTEX_REQUEUE 3 |
13 | #define FUTEX_CMP_REQUEUE 4 | 13 | #define FUTEX_CMP_REQUEUE 4 |
14 | #define FUTEX_WAKE_OP 5 | 14 | #define FUTEX_WAKE_OP 5 |
15 | #define FUTEX_LOCK_PI 6 | ||
16 | #define FUTEX_UNLOCK_PI 7 | ||
17 | #define FUTEX_TRYLOCK_PI 8 | ||
15 | 18 | ||
16 | /* | 19 | /* |
17 | * Support for robust futexes: the kernel cleans up held futexes at | 20 | * Support for robust futexes: the kernel cleans up held futexes at |
@@ -90,18 +93,21 @@ struct robust_list_head { | |||
90 | */ | 93 | */ |
91 | #define ROBUST_LIST_LIMIT 2048 | 94 | #define ROBUST_LIST_LIMIT 2048 |
92 | 95 | ||
93 | long do_futex(unsigned long uaddr, int op, int val, | 96 | long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, |
94 | unsigned long timeout, unsigned long uaddr2, int val2, | 97 | u32 __user *uaddr2, u32 val2, u32 val3); |
95 | int val3); | ||
96 | 98 | ||
97 | extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); | 99 | extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); |
98 | 100 | ||
99 | #ifdef CONFIG_FUTEX | 101 | #ifdef CONFIG_FUTEX |
100 | extern void exit_robust_list(struct task_struct *curr); | 102 | extern void exit_robust_list(struct task_struct *curr); |
103 | extern void exit_pi_state_list(struct task_struct *curr); | ||
101 | #else | 104 | #else |
102 | static inline void exit_robust_list(struct task_struct *curr) | 105 | static inline void exit_robust_list(struct task_struct *curr) |
103 | { | 106 | { |
104 | } | 107 | } |
108 | static inline void exit_pi_state_list(struct task_struct *curr) | ||
109 | { | ||
110 | } | ||
105 | #endif | 111 | #endif |
106 | 112 | ||
107 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ | 113 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ |
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..3a256957fb56 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -87,6 +87,7 @@ extern struct group_info init_groups; | |||
87 | .lock_depth = -1, \ | 87 | .lock_depth = -1, \ |
88 | .prio = MAX_PRIO-20, \ | 88 | .prio = MAX_PRIO-20, \ |
89 | .static_prio = MAX_PRIO-20, \ | 89 | .static_prio = MAX_PRIO-20, \ |
90 | .normal_prio = MAX_PRIO-20, \ | ||
90 | .policy = SCHED_NORMAL, \ | 91 | .policy = SCHED_NORMAL, \ |
91 | .cpus_allowed = CPU_MASK_ALL, \ | 92 | .cpus_allowed = CPU_MASK_ALL, \ |
92 | .mm = NULL, \ | 93 | .mm = NULL, \ |
@@ -119,10 +120,11 @@ extern struct group_info init_groups; | |||
119 | .signal = {{0}}}, \ | 120 | .signal = {{0}}}, \ |
120 | .blocked = {{0}}, \ | 121 | .blocked = {{0}}, \ |
121 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ | 122 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ |
122 | .proc_lock = SPIN_LOCK_UNLOCKED, \ | ||
123 | .journal_info = NULL, \ | 123 | .journal_info = NULL, \ |
124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
125 | .fs_excl = ATOMIC_INIT(0), \ | 125 | .fs_excl = ATOMIC_INIT(0), \ |
126 | .pi_lock = SPIN_LOCK_UNLOCKED, \ | ||
127 | INIT_RT_MUTEXES(tsk) \ | ||
126 | } | 128 | } |
127 | 129 | ||
128 | 130 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index b32c2b6e53f6..56f1e0e1e598 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -232,7 +232,8 @@ struct input_absinfo { | |||
232 | #define KEY_PAUSE 119 | 232 | #define KEY_PAUSE 119 |
233 | 233 | ||
234 | #define KEY_KPCOMMA 121 | 234 | #define KEY_KPCOMMA 121 |
235 | #define KEY_HANGUEL 122 | 235 | #define KEY_HANGEUL 122 |
236 | #define KEY_HANGUEL KEY_HANGEUL | ||
236 | #define KEY_HANJA 123 | 237 | #define KEY_HANJA 123 |
237 | #define KEY_YEN 124 | 238 | #define KEY_YEN 124 |
238 | #define KEY_LEFTMETA 125 | 239 | #define KEY_LEFTMETA 125 |
@@ -1005,6 +1006,7 @@ static inline void init_input_dev(struct input_dev *dev) | |||
1005 | } | 1006 | } |
1006 | 1007 | ||
1007 | struct input_dev *input_allocate_device(void); | 1008 | struct input_dev *input_allocate_device(void); |
1009 | void input_free_device(struct input_dev *dev); | ||
1008 | 1010 | ||
1009 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1011 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
1010 | { | 1012 | { |
@@ -1016,12 +1018,6 @@ static inline void input_put_device(struct input_dev *dev) | |||
1016 | class_device_put(&dev->cdev); | 1018 | class_device_put(&dev->cdev); |
1017 | } | 1019 | } |
1018 | 1020 | ||
1019 | static inline void input_free_device(struct input_dev *dev) | ||
1020 | { | ||
1021 | if (dev) | ||
1022 | input_put_device(dev); | ||
1023 | } | ||
1024 | |||
1025 | int input_register_device(struct input_dev *); | 1021 | int input_register_device(struct input_dev *); |
1026 | void input_unregister_device(struct input_dev *); | 1022 | void input_unregister_device(struct input_dev *); |
1027 | 1023 | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index cd6bd001ba4e..edfc733b1575 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -105,6 +105,9 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
105 | int adjust_resource(struct resource *res, unsigned long start, | 105 | int adjust_resource(struct resource *res, unsigned long start, |
106 | unsigned long size); | 106 | unsigned long size); |
107 | 107 | ||
108 | /* get registered SYSTEM_RAM resources in specified area */ | ||
109 | extern int find_next_system_ram(struct resource *res); | ||
110 | |||
108 | /* Convenience shorthand with allocation */ | 111 | /* Convenience shorthand with allocation */ |
109 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 112 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
110 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 113 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 5653b2f23b6a..d09fbeabf1dc 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -210,11 +210,7 @@ struct kernel_ipmi_msg | |||
210 | #include <linux/list.h> | 210 | #include <linux/list.h> |
211 | #include <linux/module.h> | 211 | #include <linux/module.h> |
212 | #include <linux/device.h> | 212 | #include <linux/device.h> |
213 | |||
214 | #ifdef CONFIG_PROC_FS | ||
215 | #include <linux/proc_fs.h> | 213 | #include <linux/proc_fs.h> |
216 | extern struct proc_dir_entry *proc_ipmi_root; | ||
217 | #endif /* CONFIG_PROC_FS */ | ||
218 | 214 | ||
219 | /* Opaque type for a IPMI message user. One of these is needed to | 215 | /* Opaque type for a IPMI message user. One of these is needed to |
220 | send and receive messages. */ | 216 | send and receive messages. */ |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index c6f70660b371..c9c760700bc3 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -186,6 +186,7 @@ struct jffs2_raw_xref | |||
186 | jint32_t hdr_crc; | 186 | jint32_t hdr_crc; |
187 | jint32_t ino; /* inode number */ | 187 | jint32_t ino; /* inode number */ |
188 | jint32_t xid; /* XATTR identifier number */ | 188 | jint32_t xid; /* XATTR identifier number */ |
189 | jint32_t xseqno; /* xref sequencial number */ | ||
189 | jint32_t node_crc; | 190 | jint32_t node_crc; |
190 | } __attribute__((packed)); | 191 | } __attribute__((packed)); |
191 | 192 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3c5e4c2e517d..5c1ec1f84eab 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -32,6 +32,7 @@ extern const char linux_banner[]; | |||
32 | 32 | ||
33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) | 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) |
35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | ||
35 | 36 | ||
36 | #define KERN_EMERG "<0>" /* system is unusable */ | 37 | #define KERN_EMERG "<0>" /* system is unusable */ |
37 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 38 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
@@ -336,6 +337,12 @@ struct sysinfo { | |||
336 | /* Force a compilation error if condition is true */ | 337 | /* Force a compilation error if condition is true */ |
337 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 338 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
338 | 339 | ||
340 | /* Force a compilation error if condition is true, but also produce a | ||
341 | result (of value 0 and type size_t), so the expression can be used | ||
342 | e.g. in a structure initializer (or where-ever else comma expressions | ||
343 | aren't permitted). */ | ||
344 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | ||
345 | |||
339 | /* Trap pasters of __FUNCTION__ at compile-time */ | 346 | /* Trap pasters of __FUNCTION__ at compile-time */ |
340 | #define __FUNCTION__ (__func__) | 347 | #define __FUNCTION__ (__func__) |
341 | 348 | ||
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/libata.h b/include/linux/libata.h index 20b1cf527c60..f4284bf89758 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <asm/scatterlist.h> | ||
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
34 | #include <linux/ata.h> | 35 | #include <linux/ata.h> |
35 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
@@ -887,6 +888,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag) | |||
887 | return tag == ATA_MAX_QUEUE - 1; | 888 | return tag == ATA_MAX_QUEUE - 1; |
888 | } | 889 | } |
889 | 890 | ||
891 | /* | ||
892 | * device helpers | ||
893 | */ | ||
890 | static inline unsigned int ata_class_enabled(unsigned int class) | 894 | static inline unsigned int ata_class_enabled(unsigned int class) |
891 | { | 895 | { |
892 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | 896 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; |
@@ -917,6 +921,17 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev) | |||
917 | return ata_class_absent(dev->class); | 921 | return ata_class_absent(dev->class); |
918 | } | 922 | } |
919 | 923 | ||
924 | /* | ||
925 | * port helpers | ||
926 | */ | ||
927 | static inline int ata_port_max_devices(const struct ata_port *ap) | ||
928 | { | ||
929 | if (ap->flags & ATA_FLAG_SLAVE_POSS) | ||
930 | return 2; | ||
931 | return 1; | ||
932 | } | ||
933 | |||
934 | |||
920 | static inline u8 ata_chk_status(struct ata_port *ap) | 935 | static inline u8 ata_chk_status(struct ata_port *ap) |
921 | { | 936 | { |
922 | return ap->ops->check_status(ap); | 937 | return ap->ops->check_status(ap); |
diff --git a/include/linux/license.h b/include/linux/license.h new file mode 100644 index 000000000000..decdbf43cb5c --- /dev/null +++ b/include/linux/license.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __LICENSE_H | ||
2 | #define __LICENSE_H | ||
3 | |||
4 | static inline int license_is_gpl_compatible(const char *license) | ||
5 | { | ||
6 | return (strcmp(license, "GPL") == 0 | ||
7 | || strcmp(license, "GPL v2") == 0 | ||
8 | || strcmp(license, "GPL and additional rights") == 0 | ||
9 | || strcmp(license, "Dual BSD/GPL") == 0 | ||
10 | || strcmp(license, "Dual MIT/GPL") == 0 | ||
11 | || strcmp(license, "Dual MPL/GPL") == 0); | ||
12 | } | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 37ca31b21bb7..6b74adf5297f 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -4,18 +4,11 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
7 | #include <linux/poison.h> | ||
7 | #include <linux/prefetch.h> | 8 | #include <linux/prefetch.h> |
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
10 | /* | 11 | /* |
11 | * These are non-NULL pointers that will result in page faults | ||
12 | * under normal circumstances, used to verify that nobody uses | ||
13 | * non-initialized list entries. | ||
14 | */ | ||
15 | #define LIST_POISON1 ((void *) 0x00100100) | ||
16 | #define LIST_POISON2 ((void *) 0x00200200) | ||
17 | |||
18 | /* | ||
19 | * Simple doubly linked list implementation. | 12 | * Simple doubly linked list implementation. |
20 | * | 13 | * |
21 | * Some of the internal functions ("__xxx") are useful when | 14 | * Some of the internal functions ("__xxx") are useful when |
diff --git a/include/linux/loop.h b/include/linux/loop.h index bf3d2345ce99..e76c7611d6cc 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -59,7 +59,7 @@ struct loop_device { | |||
59 | struct bio *lo_bio; | 59 | struct bio *lo_bio; |
60 | struct bio *lo_biotail; | 60 | struct bio *lo_biotail; |
61 | int lo_state; | 61 | int lo_state; |
62 | struct task_struct *lo_thread; | 62 | struct completion lo_done; |
63 | struct completion lo_bh_done; | 63 | struct completion lo_bh_done; |
64 | struct mutex lo_ctl_mutex; | 64 | struct mutex lo_ctl_mutex; |
65 | int lo_pending; | 65 | int lo_pending; |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 911206386171..218501cfaeb9 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -63,6 +63,76 @@ extern int online_pages(unsigned long, unsigned long); | |||
63 | /* reasonably generic interface to expand the physical pages in a zone */ | 63 | /* reasonably generic interface to expand the physical pages in a zone */ |
64 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | 64 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, |
65 | unsigned long nr_pages); | 65 | unsigned long nr_pages); |
66 | |||
67 | #ifdef CONFIG_NUMA | ||
68 | extern int memory_add_physaddr_to_nid(u64 start); | ||
69 | #else | ||
70 | static inline int memory_add_physaddr_to_nid(u64 start) | ||
71 | { | ||
72 | return 0; | ||
73 | } | ||
74 | #endif | ||
75 | |||
76 | #ifdef CONFIG_HAVE_ARCH_NODEDATA_EXTENSION | ||
77 | /* | ||
78 | * For supporting node-hotadd, we have to allocate a new pgdat. | ||
79 | * | ||
80 | * If an arch has generic style NODE_DATA(), | ||
81 | * node_data[nid] = kzalloc() works well. But it depends on the architecture. | ||
82 | * | ||
83 | * In general, generic_alloc_nodedata() is used. | ||
84 | * Now, arch_free_nodedata() is just defined for error path of node_hot_add. | ||
85 | * | ||
86 | */ | ||
87 | extern pg_data_t *arch_alloc_nodedata(int nid); | ||
88 | extern void arch_free_nodedata(pg_data_t *pgdat); | ||
89 | extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat); | ||
90 | |||
91 | #else /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | ||
92 | |||
93 | #define arch_alloc_nodedata(nid) generic_alloc_nodedata(nid) | ||
94 | #define arch_free_nodedata(pgdat) generic_free_nodedata(pgdat) | ||
95 | |||
96 | #ifdef CONFIG_NUMA | ||
97 | /* | ||
98 | * If ARCH_HAS_NODEDATA_EXTENSION=n, this func is used to allocate pgdat. | ||
99 | * XXX: kmalloc_node() can't work well to get new node's memory at this time. | ||
100 | * Because, pgdat for the new node is not allocated/initialized yet itself. | ||
101 | * To use new node's memory, more consideration will be necessary. | ||
102 | */ | ||
103 | #define generic_alloc_nodedata(nid) \ | ||
104 | ({ \ | ||
105 | kzalloc(sizeof(pg_data_t), GFP_KERNEL); \ | ||
106 | }) | ||
107 | /* | ||
108 | * This definition is just for error path in node hotadd. | ||
109 | * For node hotremove, we have to replace this. | ||
110 | */ | ||
111 | #define generic_free_nodedata(pgdat) kfree(pgdat) | ||
112 | |||
113 | extern pg_data_t *node_data[]; | ||
114 | static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | ||
115 | { | ||
116 | node_data[nid] = pgdat; | ||
117 | } | ||
118 | |||
119 | #else /* !CONFIG_NUMA */ | ||
120 | |||
121 | /* never called */ | ||
122 | static inline pg_data_t *generic_alloc_nodedata(int nid) | ||
123 | { | ||
124 | BUG(); | ||
125 | return NULL; | ||
126 | } | ||
127 | static inline void generic_free_nodedata(pg_data_t *pgdat) | ||
128 | { | ||
129 | } | ||
130 | static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | ||
131 | { | ||
132 | } | ||
133 | #endif /* CONFIG_NUMA */ | ||
134 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | ||
135 | |||
66 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | 136 | #else /* ! CONFIG_MEMORY_HOTPLUG */ |
67 | /* | 137 | /* |
68 | * Stub functions for when hotplug is off | 138 | * Stub functions for when hotplug is off |
@@ -99,7 +169,8 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
99 | return -ENOSYS; | 169 | return -ENOSYS; |
100 | } | 170 | } |
101 | 171 | ||
102 | extern int add_memory(u64 start, u64 size); | 172 | extern int add_memory(int nid, u64 start, u64 size); |
173 | extern int arch_add_memory(int nid, u64 start, u64 size); | ||
103 | extern int remove_memory(u64 start, u64 size); | 174 | extern int remove_memory(u64 start, u64 size); |
104 | 175 | ||
105 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 176 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index a929ea197e48..c41a1299b8cf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1030,13 +1030,20 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
1030 | } | 1030 | } |
1031 | #endif /* CONFIG_PROC_FS */ | 1031 | #endif /* CONFIG_PROC_FS */ |
1032 | 1032 | ||
1033 | static inline void | ||
1034 | debug_check_no_locks_freed(const void *from, unsigned long len) | ||
1035 | { | ||
1036 | mutex_debug_check_no_locks_freed(from, len); | ||
1037 | rt_mutex_debug_check_no_locks_freed(from, len); | ||
1038 | } | ||
1039 | |||
1033 | #ifndef CONFIG_DEBUG_PAGEALLOC | 1040 | #ifndef CONFIG_DEBUG_PAGEALLOC |
1034 | static inline void | 1041 | static inline void |
1035 | kernel_map_pages(struct page *page, int numpages, int enable) | 1042 | kernel_map_pages(struct page *page, int numpages, int enable) |
1036 | { | 1043 | { |
1037 | if (!PageHighMem(page) && !enable) | 1044 | if (!PageHighMem(page) && !enable) |
1038 | mutex_debug_check_no_locks_freed(page_address(page), | 1045 | debug_check_no_locks_freed(page_address(page), |
1039 | numpages * PAGE_SIZE); | 1046 | numpages * PAGE_SIZE); |
1040 | } | 1047 | } |
1041 | #endif | 1048 | #endif |
1042 | 1049 | ||
@@ -1065,5 +1072,7 @@ void drop_slab(void); | |||
1065 | extern int randomize_va_space; | 1072 | extern int randomize_va_space; |
1066 | #endif | 1073 | #endif |
1067 | 1074 | ||
1075 | const char *arch_vma_name(struct vm_area_struct *vma); | ||
1076 | |||
1068 | #endif /* __KERNEL__ */ | 1077 | #endif /* __KERNEL__ */ |
1069 | #endif /* _LINUX_MM_H */ | 1078 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 2d366098eab5..9ebbb74b7b72 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -285,6 +285,9 @@ struct module | |||
285 | /* The size of the executable code in each section. */ | 285 | /* The size of the executable code in each section. */ |
286 | unsigned long init_text_size, core_text_size; | 286 | unsigned long init_text_size, core_text_size; |
287 | 287 | ||
288 | /* The handle returned from unwind_add_table. */ | ||
289 | void *unwind_info; | ||
290 | |||
288 | /* Arch-specific module values */ | 291 | /* Arch-specific module values */ |
289 | struct mod_arch_specific arch; | 292 | struct mod_arch_specific arch; |
290 | 293 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bc747e5d7138..03cd7551a7a1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -699,7 +699,6 @@ extern int dev_hard_start_xmit(struct sk_buff *skb, | |||
699 | 699 | ||
700 | extern void dev_init(void); | 700 | extern void dev_init(void); |
701 | 701 | ||
702 | extern int netdev_nit; | ||
703 | extern int netdev_budget; | 702 | extern int netdev_budget; |
704 | 703 | ||
705 | /* Called by rtnetlink.c:rtnl_unlock() */ | 704 | /* Called by rtnetlink.c:rtnl_unlock() */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index ca5a8733000f..1efe60c5c00c 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -31,6 +31,7 @@ struct netpoll_info { | |||
31 | int rx_flags; | 31 | int rx_flags; |
32 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
34 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | void netpoll_poll(struct netpoll *np); | 37 | void netpoll_poll(struct netpoll *np); |
diff --git a/include/linux/node.h b/include/linux/node.h index 254dc3de650b..81dcec84cd8f 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -26,8 +26,25 @@ struct node { | |||
26 | struct sys_device sysdev; | 26 | struct sys_device sysdev; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | extern struct node node_devices[]; | ||
30 | |||
29 | extern int register_node(struct node *, int, struct node *); | 31 | extern int register_node(struct node *, int, struct node *); |
30 | extern void unregister_node(struct node *node); | 32 | extern void unregister_node(struct node *node); |
33 | extern int register_one_node(int nid); | ||
34 | extern void unregister_one_node(int nid); | ||
35 | #ifdef CONFIG_NUMA | ||
36 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); | ||
37 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | ||
38 | #else | ||
39 | static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | #endif | ||
31 | 48 | ||
32 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 49 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
33 | 50 | ||
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h new file mode 100644 index 000000000000..135742cfada5 --- /dev/null +++ b/include/linux/nsc_gpio.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /** | ||
2 | nsc_gpio.c | ||
3 | |||
4 | National Semiconductor GPIO common access methods. | ||
5 | |||
6 | struct nsc_gpio_ops abstracts the low-level access | ||
7 | operations for the GPIO units on 2 NSC chip families; the GEODE | ||
8 | integrated CPU, and the PC-8736[03456] integrated PC-peripheral | ||
9 | chips. | ||
10 | |||
11 | The GPIO units on these chips have the same pin architecture, but | ||
12 | the access methods differ. Thus, scx200_gpio and pc8736x_gpio | ||
13 | implement their own versions of these routines; and use the common | ||
14 | file-operations routines implemented in nsc_gpio module. | ||
15 | |||
16 | Copyright (c) 2005 Jim Cromie <jim.cromie@gmail.com> | ||
17 | |||
18 | NB: this work was tested on the Geode SC-1100 and PC-87366 chips. | ||
19 | NSC sold the GEODE line to AMD, and the PC-8736x line to Winbond. | ||
20 | */ | ||
21 | |||
22 | struct nsc_gpio_ops { | ||
23 | struct module* owner; | ||
24 | u32 (*gpio_config) (unsigned iminor, u32 mask, u32 bits); | ||
25 | void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); | ||
26 | int (*gpio_get) (unsigned iminor); | ||
27 | void (*gpio_set) (unsigned iminor, int state); | ||
28 | void (*gpio_set_high)(unsigned iminor); | ||
29 | void (*gpio_set_low) (unsigned iminor); | ||
30 | void (*gpio_change) (unsigned iminor); | ||
31 | int (*gpio_current) (unsigned iminor); | ||
32 | struct device* dev; /* for dev_dbg() support, set in init */ | ||
33 | }; | ||
34 | |||
35 | extern ssize_t nsc_gpio_write(struct file *file, const char __user *data, | ||
36 | size_t len, loff_t *ppos); | ||
37 | |||
38 | extern ssize_t nsc_gpio_read(struct file *file, char __user *buf, | ||
39 | size_t len, loff_t *ppos); | ||
40 | |||
41 | extern void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index); | ||
42 | |||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c2fd2d19938b..9ae6b1a75366 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1202,6 +1202,7 @@ | |||
1202 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF | 1202 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF |
1203 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 | 1203 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 |
1204 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 | 1204 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 |
1205 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 | ||
1205 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 | 1206 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 |
1206 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | 1207 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 |
1207 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 | 1208 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 |
@@ -2170,7 +2171,6 @@ | |||
2170 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 | 2171 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 |
2171 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e | 2172 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e |
2172 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 | 2173 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 |
2173 | #define PCI_DEVICE_ID_INTEL_GD31244 0x3200 | ||
2174 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2174 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2175 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2175 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2176 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2176 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
diff --git a/include/linux/plist.h b/include/linux/plist.h new file mode 100644 index 000000000000..3404faef542c --- /dev/null +++ b/include/linux/plist.h | |||
@@ -0,0 +1,247 @@ | |||
1 | /* | ||
2 | * Descending-priority-sorted double-linked list | ||
3 | * | ||
4 | * (C) 2002-2003 Intel Corp | ||
5 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>. | ||
6 | * | ||
7 | * 2001-2005 (c) MontaVista Software, Inc. | ||
8 | * Daniel Walker <dwalker@mvista.com> | ||
9 | * | ||
10 | * (C) 2005 Thomas Gleixner <tglx@linutronix.de> | ||
11 | * | ||
12 | * Simplifications of the original code by | ||
13 | * Oleg Nesterov <oleg@tv-sign.ru> | ||
14 | * | ||
15 | * Licensed under the FSF's GNU Public License v2 or later. | ||
16 | * | ||
17 | * Based on simple lists (include/linux/list.h). | ||
18 | * | ||
19 | * This is a priority-sorted list of nodes; each node has a | ||
20 | * priority from INT_MIN (highest) to INT_MAX (lowest). | ||
21 | * | ||
22 | * Addition is O(K), removal is O(1), change of priority of a node is | ||
23 | * O(K) and K is the number of RT priority levels used in the system. | ||
24 | * (1 <= K <= 99) | ||
25 | * | ||
26 | * This list is really a list of lists: | ||
27 | * | ||
28 | * - The tier 1 list is the prio_list, different priority nodes. | ||
29 | * | ||
30 | * - The tier 2 list is the node_list, serialized nodes. | ||
31 | * | ||
32 | * Simple ASCII art explanation: | ||
33 | * | ||
34 | * |HEAD | | ||
35 | * | | | ||
36 | * |prio_list.prev|<------------------------------------| | ||
37 | * |prio_list.next|<->|pl|<->|pl|<--------------->|pl|<-| | ||
38 | * |10 | |10| |21| |21| |21| |40| (prio) | ||
39 | * | | | | | | | | | | | | | ||
40 | * | | | | | | | | | | | | | ||
41 | * |node_list.next|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-| | ||
42 | * |node_list.prev|<------------------------------------| | ||
43 | * | ||
44 | * The nodes on the prio_list list are sorted by priority to simplify | ||
45 | * the insertion of new nodes. There are no nodes with duplicate | ||
46 | * priorites on the list. | ||
47 | * | ||
48 | * The nodes on the node_list is ordered by priority and can contain | ||
49 | * entries which have the same priority. Those entries are ordered | ||
50 | * FIFO | ||
51 | * | ||
52 | * Addition means: look for the prio_list node in the prio_list | ||
53 | * for the priority of the node and insert it before the node_list | ||
54 | * entry of the next prio_list node. If it is the first node of | ||
55 | * that priority, add it to the prio_list in the right position and | ||
56 | * insert it into the serialized node_list list | ||
57 | * | ||
58 | * Removal means remove it from the node_list and remove it from | ||
59 | * the prio_list if the node_list list_head is non empty. In case | ||
60 | * of removal from the prio_list it must be checked whether other | ||
61 | * entries of the same priority are on the list or not. If there | ||
62 | * is another entry of the same priority then this entry has to | ||
63 | * replace the removed entry on the prio_list. If the entry which | ||
64 | * is removed is the only entry of this priority then a simple | ||
65 | * remove from both list is sufficient. | ||
66 | * | ||
67 | * INT_MIN is the highest priority, 0 is the medium highest, INT_MAX | ||
68 | * is lowest priority. | ||
69 | * | ||
70 | * No locking is done, up to the caller. | ||
71 | * | ||
72 | */ | ||
73 | #ifndef _LINUX_PLIST_H_ | ||
74 | #define _LINUX_PLIST_H_ | ||
75 | |||
76 | #include <linux/list.h> | ||
77 | #include <linux/spinlock_types.h> | ||
78 | |||
79 | struct plist_head { | ||
80 | struct list_head prio_list; | ||
81 | struct list_head node_list; | ||
82 | #ifdef CONFIG_DEBUG_PI_LIST | ||
83 | spinlock_t *lock; | ||
84 | #endif | ||
85 | }; | ||
86 | |||
87 | struct plist_node { | ||
88 | int prio; | ||
89 | struct plist_head plist; | ||
90 | }; | ||
91 | |||
92 | #ifdef CONFIG_DEBUG_PI_LIST | ||
93 | # define PLIST_HEAD_LOCK_INIT(_lock) .lock = _lock | ||
94 | #else | ||
95 | # define PLIST_HEAD_LOCK_INIT(_lock) | ||
96 | #endif | ||
97 | |||
98 | /** | ||
99 | * #PLIST_HEAD_INIT - static struct plist_head initializer | ||
100 | * | ||
101 | * @head: struct plist_head variable name | ||
102 | */ | ||
103 | #define PLIST_HEAD_INIT(head, _lock) \ | ||
104 | { \ | ||
105 | .prio_list = LIST_HEAD_INIT((head).prio_list), \ | ||
106 | .node_list = LIST_HEAD_INIT((head).node_list), \ | ||
107 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ | ||
108 | } | ||
109 | |||
110 | /** | ||
111 | * #PLIST_NODE_INIT - static struct plist_node initializer | ||
112 | * | ||
113 | * @node: struct plist_node variable name | ||
114 | * @__prio: initial node priority | ||
115 | */ | ||
116 | #define PLIST_NODE_INIT(node, __prio) \ | ||
117 | { \ | ||
118 | .prio = (__prio), \ | ||
119 | .plist = PLIST_HEAD_INIT((node).plist, NULL), \ | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * plist_head_init - dynamic struct plist_head initializer | ||
124 | * | ||
125 | * @head: &struct plist_head pointer | ||
126 | */ | ||
127 | static inline void | ||
128 | plist_head_init(struct plist_head *head, spinlock_t *lock) | ||
129 | { | ||
130 | INIT_LIST_HEAD(&head->prio_list); | ||
131 | INIT_LIST_HEAD(&head->node_list); | ||
132 | #ifdef CONFIG_DEBUG_PI_LIST | ||
133 | head->lock = lock; | ||
134 | #endif | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * plist_node_init - Dynamic struct plist_node initializer | ||
139 | * | ||
140 | * @node: &struct plist_node pointer | ||
141 | * @prio: initial node priority | ||
142 | */ | ||
143 | static inline void plist_node_init(struct plist_node *node, int prio) | ||
144 | { | ||
145 | node->prio = prio; | ||
146 | plist_head_init(&node->plist, NULL); | ||
147 | } | ||
148 | |||
149 | extern void plist_add(struct plist_node *node, struct plist_head *head); | ||
150 | extern void plist_del(struct plist_node *node, struct plist_head *head); | ||
151 | |||
152 | /** | ||
153 | * plist_for_each - iterate over the plist | ||
154 | * | ||
155 | * @pos1: the type * to use as a loop counter. | ||
156 | * @head: the head for your list. | ||
157 | */ | ||
158 | #define plist_for_each(pos, head) \ | ||
159 | list_for_each_entry(pos, &(head)->node_list, plist.node_list) | ||
160 | |||
161 | /** | ||
162 | * plist_for_each_entry_safe - iterate over a plist of given type safe | ||
163 | * against removal of list entry | ||
164 | * | ||
165 | * @pos1: the type * to use as a loop counter. | ||
166 | * @n1: another type * to use as temporary storage | ||
167 | * @head: the head for your list. | ||
168 | */ | ||
169 | #define plist_for_each_safe(pos, n, head) \ | ||
170 | list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list) | ||
171 | |||
172 | /** | ||
173 | * plist_for_each_entry - iterate over list of given type | ||
174 | * | ||
175 | * @pos: the type * to use as a loop counter. | ||
176 | * @head: the head for your list. | ||
177 | * @member: the name of the list_struct within the struct. | ||
178 | */ | ||
179 | #define plist_for_each_entry(pos, head, mem) \ | ||
180 | list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list) | ||
181 | |||
182 | /** | ||
183 | * plist_for_each_entry_safe - iterate over list of given type safe against | ||
184 | * removal of list entry | ||
185 | * | ||
186 | * @pos: the type * to use as a loop counter. | ||
187 | * @n: another type * to use as temporary storage | ||
188 | * @head: the head for your list. | ||
189 | * @m: the name of the list_struct within the struct. | ||
190 | */ | ||
191 | #define plist_for_each_entry_safe(pos, n, head, m) \ | ||
192 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list) | ||
193 | |||
194 | /** | ||
195 | * plist_head_empty - return !0 if a plist_head is empty | ||
196 | * | ||
197 | * @head: &struct plist_head pointer | ||
198 | */ | ||
199 | static inline int plist_head_empty(const struct plist_head *head) | ||
200 | { | ||
201 | return list_empty(&head->node_list); | ||
202 | } | ||
203 | |||
204 | /** | ||
205 | * plist_node_empty - return !0 if plist_node is not on a list | ||
206 | * | ||
207 | * @node: &struct plist_node pointer | ||
208 | */ | ||
209 | static inline int plist_node_empty(const struct plist_node *node) | ||
210 | { | ||
211 | return plist_head_empty(&node->plist); | ||
212 | } | ||
213 | |||
214 | /* All functions below assume the plist_head is not empty. */ | ||
215 | |||
216 | /** | ||
217 | * plist_first_entry - get the struct for the first entry | ||
218 | * | ||
219 | * @ptr: the &struct plist_head pointer. | ||
220 | * @type: the type of the struct this is embedded in. | ||
221 | * @member: the name of the list_struct within the struct. | ||
222 | */ | ||
223 | #ifdef CONFIG_DEBUG_PI_LIST | ||
224 | # define plist_first_entry(head, type, member) \ | ||
225 | ({ \ | ||
226 | WARN_ON(plist_head_empty(head)); \ | ||
227 | container_of(plist_first(head), type, member); \ | ||
228 | }) | ||
229 | #else | ||
230 | # define plist_first_entry(head, type, member) \ | ||
231 | container_of(plist_first(head), type, member) | ||
232 | #endif | ||
233 | |||
234 | /** | ||
235 | * plist_first - return the first node (and thus, highest priority) | ||
236 | * | ||
237 | * @head: the &struct plist_head pointer | ||
238 | * | ||
239 | * Assumes the plist is _not_ empty. | ||
240 | */ | ||
241 | static inline struct plist_node* plist_first(const struct plist_head *head) | ||
242 | { | ||
243 | return list_entry(head->node_list.next, | ||
244 | struct plist_node, plist.node_list); | ||
245 | } | ||
246 | |||
247 | #endif | ||
diff --git a/include/linux/poison.h b/include/linux/poison.h new file mode 100644 index 000000000000..a5347c02432e --- /dev/null +++ b/include/linux/poison.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _LINUX_POISON_H | ||
2 | #define _LINUX_POISON_H | ||
3 | |||
4 | /********** include/linux/list.h **********/ | ||
5 | /* | ||
6 | * These are non-NULL pointers that will result in page faults | ||
7 | * under normal circumstances, used to verify that nobody uses | ||
8 | * non-initialized list entries. | ||
9 | */ | ||
10 | #define LIST_POISON1 ((void *) 0x00100100) | ||
11 | #define LIST_POISON2 ((void *) 0x00200200) | ||
12 | |||
13 | /********** mm/slab.c **********/ | ||
14 | /* | ||
15 | * Magic nums for obj red zoning. | ||
16 | * Placed in the first word before and the first word after an obj. | ||
17 | */ | ||
18 | #define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */ | ||
19 | #define RED_ACTIVE 0x170FC2A5UL /* when obj is active */ | ||
20 | |||
21 | /* ...and for poisoning */ | ||
22 | #define POISON_INUSE 0x5a /* for use-uninitialised poisoning */ | ||
23 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | ||
24 | #define POISON_END 0xa5 /* end-byte of poisoning */ | ||
25 | |||
26 | /********** arch/$ARCH/mm/init.c **********/ | ||
27 | #define POISON_FREE_INITMEM 0xcc | ||
28 | |||
29 | /********** arch/x86_64/mm/init.c **********/ | ||
30 | #define POISON_FREE_INITDATA 0xba | ||
31 | |||
32 | /********** arch/ia64/hp/common/sba_iommu.c **********/ | ||
33 | /* | ||
34 | * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a | ||
35 | * value of "SBAIOMMU POISON\0" for spill-over poisoning. | ||
36 | */ | ||
37 | |||
38 | /********** fs/jbd/journal.c **********/ | ||
39 | #define JBD_POISON_FREE 0x5b | ||
40 | |||
41 | /********** drivers/base/dmapool.c **********/ | ||
42 | #define POOL_POISON_FREED 0xa7 /* !inuse */ | ||
43 | #define POOL_POISON_ALLOCATED 0xa9 /* !initted */ | ||
44 | |||
45 | /********** drivers/atm/ **********/ | ||
46 | #define ATM_POISON_FREE 0x12 | ||
47 | |||
48 | /********** kernel/mutexes **********/ | ||
49 | #define MUTEX_DEBUG_INIT 0x11 | ||
50 | #define MUTEX_DEBUG_FREE 0x22 | ||
51 | |||
52 | /********** security/ **********/ | ||
53 | #define KEY_DESTROY 0xbd | ||
54 | |||
55 | /********** sound/oss/ **********/ | ||
56 | #define OSS_POISON_FREE 0xAB | ||
57 | |||
58 | #endif | ||
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/rcupdate.h b/include/linux/rcupdate.h index 6312758393b6..48dfe00070c7 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -258,6 +258,7 @@ extern void rcu_init(void); | |||
258 | extern void rcu_check_callbacks(int cpu, int user); | 258 | extern void rcu_check_callbacks(int cpu, int user); |
259 | extern void rcu_restart_cpu(int cpu); | 259 | extern void rcu_restart_cpu(int cpu); |
260 | extern long rcu_batches_completed(void); | 260 | extern long rcu_batches_completed(void); |
261 | extern long rcu_batches_completed_bh(void); | ||
261 | 262 | ||
262 | /* Exported interfaces */ | 263 | /* Exported interfaces */ |
263 | extern void FASTCALL(call_rcu(struct rcu_head *head, | 264 | extern void FASTCALL(call_rcu(struct rcu_head *head, |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h new file mode 100644 index 000000000000..fa4a3b82ba70 --- /dev/null +++ b/include/linux/rtmutex.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | * RT Mutexes: blocking mutual exclusion locks with PI support | ||
3 | * | ||
4 | * started by Ingo Molnar and Thomas Gleixner: | ||
5 | * | ||
6 | * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> | ||
7 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> | ||
8 | * | ||
9 | * This file contains the public data structure and API definitions. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_RT_MUTEX_H | ||
13 | #define __LINUX_RT_MUTEX_H | ||
14 | |||
15 | #include <linux/linkage.h> | ||
16 | #include <linux/plist.h> | ||
17 | #include <linux/spinlock_types.h> | ||
18 | |||
19 | /* | ||
20 | * The rt_mutex structure | ||
21 | * | ||
22 | * @wait_lock: spinlock to protect the structure | ||
23 | * @wait_list: pilist head to enqueue waiters in priority order | ||
24 | * @owner: the mutex owner | ||
25 | */ | ||
26 | struct rt_mutex { | ||
27 | spinlock_t wait_lock; | ||
28 | struct plist_head wait_list; | ||
29 | struct task_struct *owner; | ||
30 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
31 | int save_state; | ||
32 | struct list_head held_list_entry; | ||
33 | unsigned long acquire_ip; | ||
34 | const char *name, *file; | ||
35 | int line; | ||
36 | void *magic; | ||
37 | #endif | ||
38 | }; | ||
39 | |||
40 | struct rt_mutex_waiter; | ||
41 | struct hrtimer_sleeper; | ||
42 | |||
43 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
44 | extern int rt_mutex_debug_check_no_locks_freed(const void *from, | ||
45 | unsigned long len); | ||
46 | extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task); | ||
47 | #else | ||
48 | static inline int rt_mutex_debug_check_no_locks_freed(const void *from, | ||
49 | unsigned long len) | ||
50 | { | ||
51 | return 0; | ||
52 | } | ||
53 | # define rt_mutex_debug_check_no_locks_held(task) do { } while (0) | ||
54 | #endif | ||
55 | |||
56 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
57 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ | ||
58 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ | ||
59 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__) | ||
60 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); | ||
61 | #else | ||
62 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) | ||
63 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL) | ||
64 | # define rt_mutex_debug_task_free(t) do { } while (0) | ||
65 | #endif | ||
66 | |||
67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | ||
68 | { .wait_lock = SPIN_LOCK_UNLOCKED \ | ||
69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ | ||
70 | , .owner = NULL \ | ||
71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | ||
72 | |||
73 | #define DEFINE_RT_MUTEX(mutexname) \ | ||
74 | struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) | ||
75 | |||
76 | /*** | ||
77 | * rt_mutex_is_locked - is the mutex locked | ||
78 | * @lock: the mutex to be queried | ||
79 | * | ||
80 | * Returns 1 if the mutex is locked, 0 if unlocked. | ||
81 | */ | ||
82 | static inline int rt_mutex_is_locked(struct rt_mutex *lock) | ||
83 | { | ||
84 | return lock->owner != NULL; | ||
85 | } | ||
86 | |||
87 | extern void __rt_mutex_init(struct rt_mutex *lock, const char *name); | ||
88 | extern void rt_mutex_destroy(struct rt_mutex *lock); | ||
89 | |||
90 | extern void rt_mutex_lock(struct rt_mutex *lock); | ||
91 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock, | ||
92 | int detect_deadlock); | ||
93 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, | ||
94 | struct hrtimer_sleeper *timeout, | ||
95 | int detect_deadlock); | ||
96 | |||
97 | extern int rt_mutex_trylock(struct rt_mutex *lock); | ||
98 | |||
99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | ||
100 | |||
101 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
102 | # define INIT_RT_MUTEX_DEBUG(tsk) \ | ||
103 | .held_list_head = LIST_HEAD_INIT(tsk.held_list_head), \ | ||
104 | .held_list_lock = SPIN_LOCK_UNLOCKED | ||
105 | #else | ||
106 | # define INIT_RT_MUTEX_DEBUG(tsk) | ||
107 | #endif | ||
108 | |||
109 | #ifdef CONFIG_RT_MUTEXES | ||
110 | # define INIT_RT_MUTEXES(tsk) \ | ||
111 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ | ||
112 | INIT_RT_MUTEX_DEBUG(tsk) | ||
113 | #else | ||
114 | # define INIT_RT_MUTEXES(tsk) | ||
115 | #endif | ||
116 | |||
117 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8d11d9310db0..821f0481ebe1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -73,6 +73,7 @@ struct sched_param { | |||
73 | #include <linux/seccomp.h> | 73 | #include <linux/seccomp.h> |
74 | #include <linux/rcupdate.h> | 74 | #include <linux/rcupdate.h> |
75 | #include <linux/futex.h> | 75 | #include <linux/futex.h> |
76 | #include <linux/rtmutex.h> | ||
76 | 77 | ||
77 | #include <linux/time.h> | 78 | #include <linux/time.h> |
78 | #include <linux/param.h> | 79 | #include <linux/param.h> |
@@ -83,6 +84,7 @@ struct sched_param { | |||
83 | #include <asm/processor.h> | 84 | #include <asm/processor.h> |
84 | 85 | ||
85 | struct exec_domain; | 86 | struct exec_domain; |
87 | struct futex_pi_state; | ||
86 | 88 | ||
87 | /* | 89 | /* |
88 | * List of flags we want to share for kernel threads, | 90 | * List of flags we want to share for kernel threads, |
@@ -123,6 +125,7 @@ extern unsigned long nr_running(void); | |||
123 | extern unsigned long nr_uninterruptible(void); | 125 | extern unsigned long nr_uninterruptible(void); |
124 | extern unsigned long nr_active(void); | 126 | extern unsigned long nr_active(void); |
125 | extern unsigned long nr_iowait(void); | 127 | extern unsigned long nr_iowait(void); |
128 | extern unsigned long weighted_cpuload(const int cpu); | ||
126 | 129 | ||
127 | 130 | ||
128 | /* | 131 | /* |
@@ -494,8 +497,11 @@ struct signal_struct { | |||
494 | 497 | ||
495 | #define MAX_PRIO (MAX_RT_PRIO + 40) | 498 | #define MAX_PRIO (MAX_RT_PRIO + 40) |
496 | 499 | ||
497 | #define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) | 500 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) |
501 | #define rt_task(p) rt_prio((p)->prio) | ||
498 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | 502 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) |
503 | #define has_rt_policy(p) \ | ||
504 | unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) | ||
499 | 505 | ||
500 | /* | 506 | /* |
501 | * Some day this will be a full-fledged user tracking system.. | 507 | * Some day this will be a full-fledged user tracking system.. |
@@ -558,9 +564,9 @@ enum idle_type | |||
558 | /* | 564 | /* |
559 | * sched-domains (multiprocessor balancing) declarations: | 565 | * sched-domains (multiprocessor balancing) declarations: |
560 | */ | 566 | */ |
561 | #ifdef CONFIG_SMP | ||
562 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ | 567 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ |
563 | 568 | ||
569 | #ifdef CONFIG_SMP | ||
564 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 570 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ |
565 | #define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ | 571 | #define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ |
566 | #define SD_BALANCE_EXEC 4 /* Balance on exec */ | 572 | #define SD_BALANCE_EXEC 4 /* Balance on exec */ |
@@ -569,6 +575,11 @@ enum idle_type | |||
569 | #define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ | 575 | #define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ |
570 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ | 576 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ |
571 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 577 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ |
578 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | ||
579 | |||
580 | #define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ | ||
581 | ? SD_POWERSAVINGS_BALANCE : 0) | ||
582 | |||
572 | 583 | ||
573 | struct sched_group { | 584 | struct sched_group { |
574 | struct sched_group *next; /* Must be a circular list */ | 585 | struct sched_group *next; /* Must be a circular list */ |
@@ -638,7 +649,7 @@ struct sched_domain { | |||
638 | #endif | 649 | #endif |
639 | }; | 650 | }; |
640 | 651 | ||
641 | extern void partition_sched_domains(cpumask_t *partition1, | 652 | extern int partition_sched_domains(cpumask_t *partition1, |
642 | cpumask_t *partition2); | 653 | cpumask_t *partition2); |
643 | 654 | ||
644 | /* | 655 | /* |
@@ -713,10 +724,13 @@ struct task_struct { | |||
713 | 724 | ||
714 | int lock_depth; /* BKL lock depth */ | 725 | int lock_depth; /* BKL lock depth */ |
715 | 726 | ||
716 | #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) | 727 | #ifdef CONFIG_SMP |
728 | #ifdef __ARCH_WANT_UNLOCKED_CTXSW | ||
717 | int oncpu; | 729 | int oncpu; |
718 | #endif | 730 | #endif |
719 | int prio, static_prio; | 731 | #endif |
732 | int load_weight; /* for niceness load balancing purposes */ | ||
733 | int prio, static_prio, normal_prio; | ||
720 | struct list_head run_list; | 734 | struct list_head run_list; |
721 | prio_array_t *array; | 735 | prio_array_t *array; |
722 | 736 | ||
@@ -842,8 +856,20 @@ struct task_struct { | |||
842 | u32 self_exec_id; | 856 | u32 self_exec_id; |
843 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 857 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ |
844 | spinlock_t alloc_lock; | 858 | spinlock_t alloc_lock; |
845 | /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ | 859 | |
846 | spinlock_t proc_lock; | 860 | /* Protection of the PI data structures: */ |
861 | spinlock_t pi_lock; | ||
862 | |||
863 | #ifdef CONFIG_RT_MUTEXES | ||
864 | /* PI waiters blocked on a rt_mutex held by this task */ | ||
865 | struct plist_head pi_waiters; | ||
866 | /* Deadlock detection and priority inheritance handling */ | ||
867 | struct rt_mutex_waiter *pi_blocked_on; | ||
868 | # ifdef CONFIG_DEBUG_RT_MUTEXES | ||
869 | spinlock_t held_list_lock; | ||
870 | struct list_head held_list_head; | ||
871 | # endif | ||
872 | #endif | ||
847 | 873 | ||
848 | #ifdef CONFIG_DEBUG_MUTEXES | 874 | #ifdef CONFIG_DEBUG_MUTEXES |
849 | /* mutex deadlock detection */ | 875 | /* mutex deadlock detection */ |
@@ -856,7 +882,6 @@ struct task_struct { | |||
856 | /* VM state */ | 882 | /* VM state */ |
857 | struct reclaim_state *reclaim_state; | 883 | struct reclaim_state *reclaim_state; |
858 | 884 | ||
859 | struct dentry *proc_dentry; | ||
860 | struct backing_dev_info *backing_dev_info; | 885 | struct backing_dev_info *backing_dev_info; |
861 | 886 | ||
862 | struct io_context *io_context; | 887 | struct io_context *io_context; |
@@ -891,6 +916,8 @@ struct task_struct { | |||
891 | #ifdef CONFIG_COMPAT | 916 | #ifdef CONFIG_COMPAT |
892 | struct compat_robust_list_head __user *compat_robust_list; | 917 | struct compat_robust_list_head __user *compat_robust_list; |
893 | #endif | 918 | #endif |
919 | struct list_head pi_state_list; | ||
920 | struct futex_pi_state *pi_state_cache; | ||
894 | 921 | ||
895 | atomic_t fs_excl; /* holding fs exclusive resources */ | 922 | atomic_t fs_excl; /* holding fs exclusive resources */ |
896 | struct rcu_head rcu; | 923 | struct rcu_head rcu; |
@@ -958,6 +985,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
958 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 985 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
959 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | 986 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
960 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 987 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
988 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | ||
961 | 989 | ||
962 | /* | 990 | /* |
963 | * Only the _current_ task can read/write to tsk->flags, but other | 991 | * Only the _current_ task can read/write to tsk->flags, but other |
@@ -1012,6 +1040,19 @@ static inline void idle_task_exit(void) {} | |||
1012 | #endif | 1040 | #endif |
1013 | 1041 | ||
1014 | extern void sched_idle_next(void); | 1042 | extern void sched_idle_next(void); |
1043 | |||
1044 | #ifdef CONFIG_RT_MUTEXES | ||
1045 | extern int rt_mutex_getprio(task_t *p); | ||
1046 | extern void rt_mutex_setprio(task_t *p, int prio); | ||
1047 | extern void rt_mutex_adjust_pi(task_t *p); | ||
1048 | #else | ||
1049 | static inline int rt_mutex_getprio(task_t *p) | ||
1050 | { | ||
1051 | return p->normal_prio; | ||
1052 | } | ||
1053 | # define rt_mutex_adjust_pi(p) do { } while (0) | ||
1054 | #endif | ||
1055 | |||
1015 | extern void set_user_nice(task_t *p, long nice); | 1056 | extern void set_user_nice(task_t *p, long nice); |
1016 | extern int task_prio(const task_t *p); | 1057 | extern int task_prio(const task_t *p); |
1017 | extern int task_nice(const task_t *p); | 1058 | extern int task_nice(const task_t *p); |
@@ -1411,6 +1452,11 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) | |||
1411 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); | 1452 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); |
1412 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 1453 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); |
1413 | 1454 | ||
1455 | #include <linux/sysdev.h> | ||
1456 | extern int sched_mc_power_savings, sched_smt_power_savings; | ||
1457 | extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings; | ||
1458 | extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | ||
1459 | |||
1414 | extern void normalize_rt_tasks(void); | 1460 | extern void normalize_rt_tasks(void); |
1415 | 1461 | ||
1416 | #ifdef CONFIG_PM | 1462 | #ifdef CONFIG_PM |
diff --git a/include/linux/scx200.h b/include/linux/scx200.h index a22f9e173ad2..693c0557e70b 100644 --- a/include/linux/scx200.h +++ b/include/linux/scx200.h | |||
@@ -49,10 +49,3 @@ extern unsigned scx200_cb_base; | |||
49 | #define SCx200_REV 0x3d /* Revision Register */ | 49 | #define SCx200_REV 0x3d /* Revision Register */ |
50 | #define SCx200_CBA 0x3e /* Configuration Base Address Register */ | 50 | #define SCx200_CBA 0x3e /* Configuration Base Address Register */ |
51 | #define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ | 51 | #define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ |
52 | |||
53 | /* | ||
54 | Local variables: | ||
55 | compile-command: "make -C ../.. bzImage modules" | ||
56 | c-basic-offset: 8 | ||
57 | End: | ||
58 | */ | ||
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 30cdd648ba79..90dd069cc145 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <linux/spinlock.h> | 1 | #include <linux/spinlock.h> |
2 | 2 | ||
3 | u32 scx200_gpio_configure(int index, u32 set, u32 clear); | 3 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); |
4 | 4 | ||
5 | extern unsigned scx200_gpio_base; | 5 | extern unsigned scx200_gpio_base; |
6 | extern long scx200_gpio_shadow[2]; | 6 | extern long scx200_gpio_shadow[2]; |
@@ -17,7 +17,7 @@ extern long scx200_gpio_shadow[2]; | |||
17 | 17 | ||
18 | /* returns the value of the GPIO pin */ | 18 | /* returns the value of the GPIO pin */ |
19 | 19 | ||
20 | static inline int scx200_gpio_get(int index) { | 20 | static inline int scx200_gpio_get(unsigned index) { |
21 | __SCx200_GPIO_BANK; | 21 | __SCx200_GPIO_BANK; |
22 | __SCx200_GPIO_IOADDR + 0x04; | 22 | __SCx200_GPIO_IOADDR + 0x04; |
23 | __SCx200_GPIO_INDEX; | 23 | __SCx200_GPIO_INDEX; |
@@ -29,7 +29,7 @@ static inline int scx200_gpio_get(int index) { | |||
29 | driven if the GPIO is configured as an output, it might not be the | 29 | driven if the GPIO is configured as an output, it might not be the |
30 | state of the GPIO right now if the GPIO is configured as an input) */ | 30 | state of the GPIO right now if the GPIO is configured as an input) */ |
31 | 31 | ||
32 | static inline int scx200_gpio_current(int index) { | 32 | static inline int scx200_gpio_current(unsigned index) { |
33 | __SCx200_GPIO_BANK; | 33 | __SCx200_GPIO_BANK; |
34 | __SCx200_GPIO_INDEX; | 34 | __SCx200_GPIO_INDEX; |
35 | 35 | ||
@@ -38,7 +38,7 @@ static inline int scx200_gpio_current(int index) { | |||
38 | 38 | ||
39 | /* drive the GPIO signal high */ | 39 | /* drive the GPIO signal high */ |
40 | 40 | ||
41 | static inline void scx200_gpio_set_high(int index) { | 41 | static inline void scx200_gpio_set_high(unsigned index) { |
42 | __SCx200_GPIO_BANK; | 42 | __SCx200_GPIO_BANK; |
43 | __SCx200_GPIO_IOADDR; | 43 | __SCx200_GPIO_IOADDR; |
44 | __SCx200_GPIO_SHADOW; | 44 | __SCx200_GPIO_SHADOW; |
@@ -49,7 +49,7 @@ static inline void scx200_gpio_set_high(int index) { | |||
49 | 49 | ||
50 | /* drive the GPIO signal low */ | 50 | /* drive the GPIO signal low */ |
51 | 51 | ||
52 | static inline void scx200_gpio_set_low(int index) { | 52 | static inline void scx200_gpio_set_low(unsigned index) { |
53 | __SCx200_GPIO_BANK; | 53 | __SCx200_GPIO_BANK; |
54 | __SCx200_GPIO_IOADDR; | 54 | __SCx200_GPIO_IOADDR; |
55 | __SCx200_GPIO_SHADOW; | 55 | __SCx200_GPIO_SHADOW; |
@@ -60,7 +60,7 @@ static inline void scx200_gpio_set_low(int index) { | |||
60 | 60 | ||
61 | /* drive the GPIO signal to state */ | 61 | /* drive the GPIO signal to state */ |
62 | 62 | ||
63 | static inline void scx200_gpio_set(int index, int state) { | 63 | static inline void scx200_gpio_set(unsigned index, int state) { |
64 | __SCx200_GPIO_BANK; | 64 | __SCx200_GPIO_BANK; |
65 | __SCx200_GPIO_IOADDR; | 65 | __SCx200_GPIO_IOADDR; |
66 | __SCx200_GPIO_SHADOW; | 66 | __SCx200_GPIO_SHADOW; |
@@ -73,7 +73,7 @@ static inline void scx200_gpio_set(int index, int state) { | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* toggle the GPIO signal */ | 75 | /* toggle the GPIO signal */ |
76 | static inline void scx200_gpio_change(int index) { | 76 | static inline void scx200_gpio_change(unsigned index) { |
77 | __SCx200_GPIO_BANK; | 77 | __SCx200_GPIO_BANK; |
78 | __SCx200_GPIO_IOADDR; | 78 | __SCx200_GPIO_IOADDR; |
79 | __SCx200_GPIO_SHADOW; | 79 | __SCx200_GPIO_SHADOW; |
@@ -87,10 +87,3 @@ static inline void scx200_gpio_change(int index) { | |||
87 | #undef __SCx200_GPIO_SHADOW | 87 | #undef __SCx200_GPIO_SHADOW |
88 | #undef __SCx200_GPIO_INDEX | 88 | #undef __SCx200_GPIO_INDEX |
89 | #undef __SCx200_GPIO_OUT | 89 | #undef __SCx200_GPIO_OUT |
90 | |||
91 | /* | ||
92 | Local variables: | ||
93 | compile-command: "make -C ../.. bzImage modules" | ||
94 | c-basic-offset: 8 | ||
95 | End: | ||
96 | */ | ||
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/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 9b8bcf125c18..6e112cc5cdda 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -126,7 +126,7 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | |||
126 | /* Just increments the mechanism's reference count and returns its input: */ | 126 | /* Just increments the mechanism's reference count and returns its input: */ |
127 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | 127 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); |
128 | 128 | ||
129 | /* For every succesful gss_mech_get or gss_mech_get_by_* call there must be a | 129 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a |
130 | * corresponding call to gss_mech_put. */ | 130 | * corresponding call to gss_mech_put. */ |
131 | void gss_mech_put(struct gss_api_mech *); | 131 | void gss_mech_put(struct gss_api_mech *); |
132 | 132 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index dc3f3aa0c83e..c41e2d6d1acc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -199,6 +199,8 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
199 | } | 199 | } |
200 | #endif | 200 | #endif |
201 | 201 | ||
202 | extern int kswapd_run(int nid); | ||
203 | |||
202 | #ifdef CONFIG_MMU | 204 | #ifdef CONFIG_MMU |
203 | /* linux/mm/shmem.c */ | 205 | /* linux/mm/shmem.c */ |
204 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 206 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 33785b79d548..008f04c56737 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -174,9 +174,9 @@ asmlinkage long sys_waitid(int which, pid_t pid, | |||
174 | int options, struct rusage __user *ru); | 174 | int options, struct rusage __user *ru); |
175 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options); | 175 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options); |
176 | asmlinkage long sys_set_tid_address(int __user *tidptr); | 176 | asmlinkage long sys_set_tid_address(int __user *tidptr); |
177 | asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, | 177 | asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, |
178 | struct timespec __user *utime, u32 __user *uaddr2, | 178 | struct timespec __user *utime, u32 __user *uaddr2, |
179 | int val3); | 179 | u32 val3); |
180 | 180 | ||
181 | asmlinkage long sys_init_module(void __user *umod, unsigned long len, | 181 | asmlinkage long sys_init_module(void __user *umod, unsigned long len, |
182 | const char __user *uargs); | 182 | const char __user *uargs); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 6a60770984e9..46e4d8f2771f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -148,9 +148,12 @@ enum | |||
148 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ | 148 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ |
149 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ | 149 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ |
150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | ||
152 | KERN_MAX_LOCK_DEPTH=74, | ||
151 | }; | 153 | }; |
152 | 154 | ||
153 | 155 | ||
156 | |||
154 | /* CTL_VM names: */ | 157 | /* CTL_VM names: */ |
155 | enum | 158 | enum |
156 | { | 159 | { |
@@ -187,6 +190,7 @@ enum | |||
187 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ | 190 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ |
188 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ | 191 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ |
189 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | 192 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ |
193 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ | ||
190 | }; | 194 | }; |
191 | 195 | ||
192 | 196 | ||
diff --git a/include/linux/time.h b/include/linux/time.h index 0cd696cee998..c05f8bb9a323 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -28,10 +28,13 @@ struct timezone { | |||
28 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
29 | 29 | ||
30 | /* Parameters used to convert the timespec values: */ | 30 | /* Parameters used to convert the timespec values: */ |
31 | #define MSEC_PER_SEC 1000L | 31 | #define MSEC_PER_SEC 1000L |
32 | #define USEC_PER_SEC 1000000L | 32 | #define USEC_PER_MSEC 1000L |
33 | #define NSEC_PER_SEC 1000000000L | 33 | #define NSEC_PER_USEC 1000L |
34 | #define NSEC_PER_USEC 1000L | 34 | #define NSEC_PER_MSEC 1000000L |
35 | #define USEC_PER_SEC 1000000L | ||
36 | #define NSEC_PER_SEC 1000000000L | ||
37 | #define FSEC_PER_SEC 1000000000000000L | ||
35 | 38 | ||
36 | static inline int timespec_equal(struct timespec *a, struct timespec *b) | 39 | static inline int timespec_equal(struct timespec *a, struct timespec *b) |
37 | { | 40 | { |
@@ -77,6 +80,8 @@ extern struct timespec xtime; | |||
77 | extern struct timespec wall_to_monotonic; | 80 | extern struct timespec wall_to_monotonic; |
78 | extern seqlock_t xtime_lock; | 81 | extern seqlock_t xtime_lock; |
79 | 82 | ||
83 | void timekeeping_init(void); | ||
84 | |||
80 | static inline unsigned long get_seconds(void) | 85 | static inline unsigned long get_seconds(void) |
81 | { | 86 | { |
82 | return xtime.tv_sec; | 87 | return xtime.tv_sec; |
@@ -100,6 +105,7 @@ extern int do_getitimer(int which, struct itimerval *value); | |||
100 | extern void getnstimeofday(struct timespec *tv); | 105 | extern void getnstimeofday(struct timespec *tv); |
101 | 106 | ||
102 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 107 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
108 | extern int timekeeping_is_continuous(void); | ||
103 | 109 | ||
104 | /** | 110 | /** |
105 | * timespec_to_ns - Convert timespec to nanoseconds | 111 | * timespec_to_ns - Convert timespec to nanoseconds |
@@ -142,6 +148,20 @@ extern struct timespec ns_to_timespec(const s64 nsec); | |||
142 | */ | 148 | */ |
143 | extern struct timeval ns_to_timeval(const s64 nsec); | 149 | extern struct timeval ns_to_timeval(const s64 nsec); |
144 | 150 | ||
151 | /** | ||
152 | * timespec_add_ns - Adds nanoseconds to a timespec | ||
153 | * @a: pointer to timespec to be incremented | ||
154 | * @ns: unsigned nanoseconds value to be added | ||
155 | */ | ||
156 | static inline void timespec_add_ns(struct timespec *a, u64 ns) | ||
157 | { | ||
158 | ns += a->tv_nsec; | ||
159 | while(unlikely(ns >= NSEC_PER_SEC)) { | ||
160 | ns -= NSEC_PER_SEC; | ||
161 | a->tv_sec++; | ||
162 | } | ||
163 | a->tv_nsec = ns; | ||
164 | } | ||
145 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
146 | 166 | ||
147 | #define NFDBITS __NFDBITS | 167 | #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 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index a305ae2e44b6..ec1eca85290a 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -134,7 +134,8 @@ | |||
134 | .flags = SD_LOAD_BALANCE \ | 134 | .flags = SD_LOAD_BALANCE \ |
135 | | SD_BALANCE_NEWIDLE \ | 135 | | SD_BALANCE_NEWIDLE \ |
136 | | SD_BALANCE_EXEC \ | 136 | | SD_BALANCE_EXEC \ |
137 | | SD_WAKE_AFFINE, \ | 137 | | SD_WAKE_AFFINE \ |
138 | | BALANCE_FOR_POWER, \ | ||
138 | .last_balance = jiffies, \ | 139 | .last_balance = jiffies, \ |
139 | .balance_interval = 1, \ | 140 | .balance_interval = 1, \ |
140 | .nr_balance_failed = 0, \ | 141 | .nr_balance_failed = 0, \ |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h new file mode 100644 index 000000000000..ce48e2cd37a2 --- /dev/null +++ b/include/linux/unwind.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef _LINUX_UNWIND_H | ||
2 | #define _LINUX_UNWIND_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
6 | * Jan Beulich <jbeulich@novell.com> | ||
7 | * This code is released under version 2 of the GNU GPL. | ||
8 | * | ||
9 | * A simple API for unwinding kernel stacks. This is used for | ||
10 | * debugging and error reporting purposes. The kernel doesn't need | ||
11 | * full-blown stack unwinding with all the bells and whistles, so there | ||
12 | * is not much point in implementing the full Dwarf2 unwind API. | ||
13 | */ | ||
14 | |||
15 | #include <linux/config.h> | ||
16 | |||
17 | struct module; | ||
18 | |||
19 | #ifdef CONFIG_STACK_UNWIND | ||
20 | |||
21 | #include <asm/unwind.h> | ||
22 | |||
23 | #ifndef ARCH_UNWIND_SECTION_NAME | ||
24 | #define ARCH_UNWIND_SECTION_NAME ".eh_frame" | ||
25 | #endif | ||
26 | |||
27 | /* | ||
28 | * Initialize unwind support. | ||
29 | */ | ||
30 | extern void unwind_init(void); | ||
31 | |||
32 | #ifdef CONFIG_MODULES | ||
33 | |||
34 | extern void *unwind_add_table(struct module *, | ||
35 | const void *table_start, | ||
36 | unsigned long table_size); | ||
37 | |||
38 | extern void unwind_remove_table(void *handle, int init_only); | ||
39 | |||
40 | #endif | ||
41 | |||
42 | extern int unwind_init_frame_info(struct unwind_frame_info *, | ||
43 | struct task_struct *, | ||
44 | /*const*/ struct pt_regs *); | ||
45 | |||
46 | /* | ||
47 | * Prepare to unwind a blocked task. | ||
48 | */ | ||
49 | extern int unwind_init_blocked(struct unwind_frame_info *, | ||
50 | struct task_struct *); | ||
51 | |||
52 | /* | ||
53 | * Prepare to unwind the currently running thread. | ||
54 | */ | ||
55 | extern int unwind_init_running(struct unwind_frame_info *, | ||
56 | asmlinkage int (*callback)(struct unwind_frame_info *, | ||
57 | void *arg), | ||
58 | void *arg); | ||
59 | |||
60 | /* | ||
61 | * Unwind to previous to frame. Returns 0 if successful, negative | ||
62 | * number in case of an error. | ||
63 | */ | ||
64 | extern int unwind(struct unwind_frame_info *); | ||
65 | |||
66 | /* | ||
67 | * Unwind until the return pointer is in user-land (or until an error | ||
68 | * occurs). Returns 0 if successful, negative number in case of | ||
69 | * error. | ||
70 | */ | ||
71 | extern int unwind_to_user(struct unwind_frame_info *); | ||
72 | |||
73 | #else | ||
74 | |||
75 | struct unwind_frame_info {}; | ||
76 | |||
77 | static inline void unwind_init(void) {} | ||
78 | |||
79 | #ifdef CONFIG_MODULES | ||
80 | |||
81 | static inline void *unwind_add_table(struct module *mod, | ||
82 | const void *table_start, | ||
83 | unsigned long table_size) | ||
84 | { | ||
85 | return NULL; | ||
86 | } | ||
87 | |||
88 | #endif | ||
89 | |||
90 | static inline void unwind_remove_table(void *handle, int init_only) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline int unwind_init_frame_info(struct unwind_frame_info *info, | ||
95 | struct task_struct *tsk, | ||
96 | const struct pt_regs *regs) | ||
97 | { | ||
98 | return -ENOSYS; | ||
99 | } | ||
100 | |||
101 | static inline int unwind_init_blocked(struct unwind_frame_info *info, | ||
102 | struct task_struct *tsk) | ||
103 | { | ||
104 | return -ENOSYS; | ||
105 | } | ||
106 | |||
107 | static inline int unwind_init_running(struct unwind_frame_info *info, | ||
108 | asmlinkage int (*cb)(struct unwind_frame_info *, | ||
109 | void *arg), | ||
110 | void *arg) | ||
111 | { | ||
112 | return -ENOSYS; | ||
113 | } | ||
114 | |||
115 | static inline int unwind(struct unwind_frame_info *info) | ||
116 | { | ||
117 | return -ENOSYS; | ||
118 | } | ||
119 | |||
120 | static inline int unwind_to_user(struct unwind_frame_info *info) | ||
121 | { | ||
122 | return -ENOSYS; | ||
123 | } | ||
124 | |||
125 | #endif | ||
126 | |||
127 | #endif /* _LINUX_UNWIND_H */ | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4f428547ec09..a62673dad76e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -245,6 +245,7 @@ struct v4l2_pix_format | |||
245 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ | 245 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ |
246 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ | 246 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ |
247 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ | 247 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ |
248 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:1:1 16x16 macroblocks */ | ||
248 | 249 | ||
249 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 250 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
250 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 251 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ |
@@ -821,6 +822,11 @@ enum v4l2_mpeg_stream_type { | |||
821 | #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) | 822 | #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) |
822 | #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) | 823 | #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) |
823 | #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) | 824 | #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) |
825 | #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) | ||
826 | enum v4l2_mpeg_stream_vbi_fmt { | ||
827 | V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ | ||
828 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ | ||
829 | }; | ||
824 | 830 | ||
825 | /* MPEG audio */ | 831 | /* MPEG audio */ |
826 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) | 832 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) |
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 51fb06b4c394..d91d88f93c8b 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -25,8 +25,13 @@ enum cx2341x_port { | |||
25 | CX2341X_PORT_SERIAL = 2 | 25 | CX2341X_PORT_SERIAL = 2 |
26 | }; | 26 | }; |
27 | 27 | ||
28 | enum cx2341x_cap { | ||
29 | CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, | ||
30 | }; | ||
31 | |||
28 | struct cx2341x_mpeg_params { | 32 | struct cx2341x_mpeg_params { |
29 | /* misc */ | 33 | /* misc */ |
34 | u32 capabilities; | ||
30 | enum cx2341x_port port; | 35 | enum cx2341x_port port; |
31 | u16 width; | 36 | u16 width; |
32 | u16 height; | 37 | u16 height; |
@@ -34,6 +39,7 @@ struct cx2341x_mpeg_params { | |||
34 | 39 | ||
35 | /* stream */ | 40 | /* stream */ |
36 | enum v4l2_mpeg_stream_type stream_type; | 41 | enum v4l2_mpeg_stream_type stream_type; |
42 | enum v4l2_mpeg_stream_vbi_fmt stream_vbi_fmt; | ||
37 | 43 | ||
38 | /* audio */ | 44 | /* audio */ |
39 | enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; | 45 | enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; |
@@ -83,9 +89,9 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, | |||
83 | struct v4l2_queryctrl *qctrl); | 89 | struct v4l2_queryctrl *qctrl); |
84 | const char **cx2341x_ctrl_get_menu(u32 id); | 90 | const char **cx2341x_ctrl_get_menu(u32 id); |
85 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, | 91 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, |
86 | struct v4l2_ext_controls *ctrls, int cmd); | 92 | struct v4l2_ext_controls *ctrls, unsigned int cmd); |
87 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); | 93 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); |
88 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); | 94 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); |
89 | 95 | ||
90 | /* Firmware names */ | 96 | /* Firmware names */ |
91 | #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" | 97 | #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" |
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h index 098607cd4b78..e07136d74c2f 100644 --- a/include/net/tipc/tipc_bearer.h +++ b/include/net/tipc/tipc_bearer.h | |||
@@ -49,10 +49,18 @@ | |||
49 | 49 | ||
50 | #define TIPC_MEDIA_TYPE_ETH 1 | 50 | #define TIPC_MEDIA_TYPE_ETH 1 |
51 | 51 | ||
52 | /* | ||
53 | * Destination address structure used by TIPC bearers when sending messages | ||
54 | * | ||
55 | * IMPORTANT: The fields of this structure MUST be stored using the specified | ||
56 | * byte order indicated below, as the structure is exchanged between nodes | ||
57 | * as part of a link setup process. | ||
58 | */ | ||
59 | |||
52 | struct tipc_media_addr { | 60 | struct tipc_media_addr { |
53 | __u32 type; | 61 | __u32 type; /* bearer type (network byte order) */ |
54 | union { | 62 | union { |
55 | __u8 eth_addr[6]; /* Ethernet bearer */ | 63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ |
56 | #if 0 | 64 | #if 0 |
57 | /* Prototypes for other possible bearer types */ | 65 | /* Prototypes for other possible bearer types */ |
58 | 66 | ||