diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
commit | 28b4d5cc17c20786848cdc07b7ea237a309776bb (patch) | |
tree | bae406a4b17229dcce7c11be5073f7a67665e477 /include/linux | |
parent | d29cecda036f251aee4947f47eea0fe9ed8cc931 (diff) | |
parent | 96fa2b508d2d3fe040cf4ef2fffb955f0a537ea1 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/ray_cs.c
Diffstat (limited to 'include/linux')
33 files changed, 387 insertions, 137 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 1feed71551c9..5a5385749e16 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -330,6 +330,7 @@ unifdef-y += scc.h | |||
330 | unifdef-y += sched.h | 330 | unifdef-y += sched.h |
331 | unifdef-y += screen_info.h | 331 | unifdef-y += screen_info.h |
332 | unifdef-y += sdla.h | 332 | unifdef-y += sdla.h |
333 | unifdef-y += securebits.h | ||
333 | unifdef-y += selinux_netlink.h | 334 | unifdef-y += selinux_netlink.h |
334 | unifdef-y += sem.h | 335 | unifdef-y += sem.h |
335 | unifdef-y += serial_core.h | 336 | unifdef-y += serial_core.h |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index dd97fb8408a8..b10ec49ee2dd 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
53 | unsigned long addr, | 53 | unsigned long addr, |
54 | unsigned long size); | 54 | unsigned long size); |
55 | extern void free_bootmem(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem(unsigned long addr, unsigned long size); |
56 | extern void free_bootmem_late(unsigned long addr, unsigned long size); | ||
56 | 57 | ||
57 | /* | 58 | /* |
58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 59 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
diff --git a/include/linux/capability.h b/include/linux/capability.h index c8f2a5f70ed5..39e5ff512fbe 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -92,9 +92,7 @@ struct vfs_cap_data { | |||
92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 | 92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 |
93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 | 93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 |
94 | 94 | ||
95 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
96 | extern int file_caps_enabled; | 95 | extern int file_caps_enabled; |
97 | #endif | ||
98 | 96 | ||
99 | typedef struct kernel_cap_struct { | 97 | typedef struct kernel_cap_struct { |
100 | __u32 cap[_KERNEL_CAPABILITY_U32S]; | 98 | __u32 cap[_KERNEL_CAPABILITY_U32S]; |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index a3ed7cb8ca34..73dcf804bc94 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -79,6 +79,7 @@ | |||
79 | #define noinline __attribute__((noinline)) | 79 | #define noinline __attribute__((noinline)) |
80 | #define __attribute_const__ __attribute__((__const__)) | 80 | #define __attribute_const__ __attribute__((__const__)) |
81 | #define __maybe_unused __attribute__((unused)) | 81 | #define __maybe_unused __attribute__((unused)) |
82 | #define __always_unused __attribute__((unused)) | ||
82 | 83 | ||
83 | #define __gcc_header(x) #x | 84 | #define __gcc_header(x) #x |
84 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | 85 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 450fa597c94d..ab3af40a53c6 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -36,4 +36,18 @@ | |||
36 | the kernel context */ | 36 | the kernel context */ |
37 | #define __cold __attribute__((__cold__)) | 37 | #define __cold __attribute__((__cold__)) |
38 | 38 | ||
39 | |||
40 | #if __GNUC_MINOR__ >= 5 | ||
41 | /* | ||
42 | * Mark a position in code as unreachable. This can be used to | ||
43 | * suppress control flow warnings after asm blocks that transfer | ||
44 | * control elsewhere. | ||
45 | * | ||
46 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
47 | * this in the preprocessor, but we can live with this because they're | ||
48 | * unreleased. Really, we need to have autoconf for the kernel. | ||
49 | */ | ||
50 | #define unreachable() __builtin_unreachable() | ||
51 | #endif | ||
52 | |||
39 | #endif | 53 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 04fb5135b4e1..acbd654cc850 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
144 | # define barrier() __memory_barrier() | 144 | # define barrier() __memory_barrier() |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | /* Unreachable code */ | ||
148 | #ifndef unreachable | ||
149 | # define unreachable() do { } while (1) | ||
150 | #endif | ||
151 | |||
147 | #ifndef RELOC_HIDE | 152 | #ifndef RELOC_HIDE |
148 | # define RELOC_HIDE(ptr, off) \ | 153 | # define RELOC_HIDE(ptr, off) \ |
149 | ({ unsigned long __ptr; \ | 154 | ({ unsigned long __ptr; \ |
@@ -213,6 +218,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
213 | # define __maybe_unused /* unimplemented */ | 218 | # define __maybe_unused /* unimplemented */ |
214 | #endif | 219 | #endif |
215 | 220 | ||
221 | #ifndef __always_unused | ||
222 | # define __always_unused /* unimplemented */ | ||
223 | #endif | ||
224 | |||
216 | #ifndef noinline | 225 | #ifndef noinline |
217 | #define noinline | 226 | #define noinline |
218 | #endif | 227 | #endif |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 4a2b162c256a..5de4c9e5856d 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -208,16 +208,9 @@ struct dmar_atsr_unit { | |||
208 | u8 include_all:1; /* include all ports */ | 208 | u8 include_all:1; /* include all ports */ |
209 | }; | 209 | }; |
210 | 210 | ||
211 | /* Intel DMAR initialization functions */ | ||
212 | extern int intel_iommu_init(void); | 211 | extern int intel_iommu_init(void); |
213 | #else | 212 | #else /* !CONFIG_DMAR: */ |
214 | static inline int intel_iommu_init(void) | 213 | static inline int intel_iommu_init(void) { return -ENODEV; } |
215 | { | 214 | #endif /* CONFIG_DMAR */ |
216 | #ifdef CONFIG_INTR_REMAP | 215 | |
217 | return dmar_dev_scope_init(); | ||
218 | #else | ||
219 | return -ENODEV; | ||
220 | #endif | ||
221 | } | ||
222 | #endif /* !CONFIG_DMAR */ | ||
223 | #endif /* __DMAR_H__ */ | 216 | #endif /* __DMAR_H__ */ |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index b80c88dedbbb..81f90a59cda6 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -81,7 +81,11 @@ struct gfs2_meta_header { | |||
81 | __be32 mh_type; | 81 | __be32 mh_type; |
82 | __be64 __pad0; /* Was generation number in gfs1 */ | 82 | __be64 __pad0; /* Was generation number in gfs1 */ |
83 | __be32 mh_format; | 83 | __be32 mh_format; |
84 | __be32 __pad1; /* Was incarnation number in gfs1 */ | 84 | /* This union is to keep userspace happy */ |
85 | union { | ||
86 | __be32 mh_jid; /* Was incarnation number in gfs1 */ | ||
87 | __be32 __pad1; | ||
88 | }; | ||
85 | }; | 89 | }; |
86 | 90 | ||
87 | /* | 91 | /* |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 6d527ee82b2b..d5b387669dab 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #if defined(CONFIG_NO_HZ) | 141 | #if defined(CONFIG_NO_HZ) |
142 | #if defined(CONFIG_TINY_RCU) | ||
143 | extern void rcu_enter_nohz(void); | ||
144 | extern void rcu_exit_nohz(void); | ||
145 | |||
146 | static inline void rcu_irq_enter(void) | ||
147 | { | ||
148 | rcu_exit_nohz(); | ||
149 | } | ||
150 | |||
151 | static inline void rcu_irq_exit(void) | ||
152 | { | ||
153 | rcu_enter_nohz(); | ||
154 | } | ||
155 | |||
156 | static inline void rcu_nmi_enter(void) | ||
157 | { | ||
158 | } | ||
159 | |||
160 | static inline void rcu_nmi_exit(void) | ||
161 | { | ||
162 | } | ||
163 | |||
164 | #else | ||
142 | extern void rcu_irq_enter(void); | 165 | extern void rcu_irq_enter(void); |
143 | extern void rcu_irq_exit(void); | 166 | extern void rcu_irq_exit(void); |
144 | extern void rcu_nmi_enter(void); | 167 | extern void rcu_nmi_enter(void); |
145 | extern void rcu_nmi_exit(void); | 168 | extern void rcu_nmi_exit(void); |
169 | #endif | ||
146 | #else | 170 | #else |
147 | # define rcu_irq_enter() do { } while (0) | 171 | # define rcu_irq_enter() do { } while (0) |
148 | # define rcu_irq_exit() do { } while (0) | 172 | # define rcu_irq_exit() do { } while (0) |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 21a6f5d9af22..8d10aa7fd4c9 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -83,16 +83,12 @@ extern struct group_info init_groups; | |||
83 | #define INIT_IDS | 83 | #define INIT_IDS |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
87 | /* | 86 | /* |
88 | * Because of the reduced scope of CAP_SETPCAP when filesystem | 87 | * Because of the reduced scope of CAP_SETPCAP when filesystem |
89 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | 88 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to |
90 | * be available in the default configuration. | 89 | * be available in the default configuration. |
91 | */ | 90 | */ |
92 | # define CAP_INIT_BSET CAP_FULL_SET | 91 | # define CAP_INIT_BSET CAP_FULL_SET |
93 | #else | ||
94 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | ||
95 | #endif | ||
96 | 92 | ||
97 | #ifdef CONFIG_TREE_PREEMPT_RCU | 93 | #ifdef CONFIG_TREE_PREEMPT_RCU |
98 | #define INIT_TASK_RCU_PREEMPT(tsk) \ | 94 | #define INIT_TASK_RCU_PREEMPT(tsk) \ |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 7ca72b74eec7..75f3f00ac1e5 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -603,12 +603,6 @@ static inline void init_irq_proc(void) | |||
603 | } | 603 | } |
604 | #endif | 604 | #endif |
605 | 605 | ||
606 | #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ) | ||
607 | extern void debug_poll_all_shared_irqs(void); | ||
608 | #else | ||
609 | static inline void debug_poll_all_shared_irqs(void) { } | ||
610 | #endif | ||
611 | |||
612 | struct seq_file; | 606 | struct seq_file; |
613 | int show_interrupts(struct seq_file *p, void *v); | 607 | int show_interrupts(struct seq_file *p, void *v); |
614 | 608 | ||
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index b02a3f1d46a0..006bf45eae30 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
@@ -124,6 +124,6 @@ | |||
124 | typecheck(unsigned long, flags); \ | 124 | typecheck(unsigned long, flags); \ |
125 | raw_irqs_disabled_flags(flags); \ | 125 | raw_irqs_disabled_flags(flags); \ |
126 | }) | 126 | }) |
127 | #endif /* CONFIG_X86 */ | 127 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ |
128 | 128 | ||
129 | #endif | 129 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f4e3184fa054..3fa4c590cf12 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
17 | #include <linux/typecheck.h> | 17 | #include <linux/typecheck.h> |
18 | #include <linux/ratelimit.h> | ||
19 | #include <linux/dynamic_debug.h> | 18 | #include <linux/dynamic_debug.h> |
20 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
21 | #include <asm/bug.h> | 20 | #include <asm/bug.h> |
@@ -241,8 +240,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
241 | asmlinkage int printk(const char * fmt, ...) | 240 | asmlinkage int printk(const char * fmt, ...) |
242 | __attribute__ ((format (printf, 1, 2))) __cold; | 241 | __attribute__ ((format (printf, 1, 2))) __cold; |
243 | 242 | ||
244 | extern struct ratelimit_state printk_ratelimit_state; | 243 | extern int __printk_ratelimit(const char *func); |
245 | extern int printk_ratelimit(void); | 244 | #define printk_ratelimit() __printk_ratelimit(__func__) |
246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 245 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
247 | unsigned int interval_msec); | 246 | unsigned int interval_msec); |
248 | 247 | ||
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 190c37854870..f78f83d7663f 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
@@ -26,14 +26,15 @@ | |||
26 | 26 | ||
27 | /* Auxiliary data to use in generating the audit record. */ | 27 | /* Auxiliary data to use in generating the audit record. */ |
28 | struct common_audit_data { | 28 | struct common_audit_data { |
29 | char type; | 29 | char type; |
30 | #define LSM_AUDIT_DATA_FS 1 | 30 | #define LSM_AUDIT_DATA_FS 1 |
31 | #define LSM_AUDIT_DATA_NET 2 | 31 | #define LSM_AUDIT_DATA_NET 2 |
32 | #define LSM_AUDIT_DATA_CAP 3 | 32 | #define LSM_AUDIT_DATA_CAP 3 |
33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
36 | #define LSM_AUDIT_NO_AUDIT 7 | 36 | #define LSM_AUDIT_NO_AUDIT 7 |
37 | #define LSM_AUDIT_DATA_KMOD 8 | ||
37 | struct task_struct *tsk; | 38 | struct task_struct *tsk; |
38 | union { | 39 | union { |
39 | struct { | 40 | struct { |
@@ -66,6 +67,7 @@ struct common_audit_data { | |||
66 | char *key_desc; | 67 | char *key_desc; |
67 | } key_struct; | 68 | } key_struct; |
68 | #endif | 69 | #endif |
70 | char *kmod_name; | ||
69 | } u; | 71 | } u; |
70 | /* this union contains LSM specific data */ | 72 | /* this union contains LSM specific data */ |
71 | union { | 73 | union { |
diff --git a/include/linux/mfd/wm831x/regulator.h b/include/linux/mfd/wm831x/regulator.h index f95466343fb2..955d30fc6a27 100644 --- a/include/linux/mfd/wm831x/regulator.h +++ b/include/linux/mfd/wm831x/regulator.h | |||
@@ -1212,7 +1212,7 @@ | |||
1212 | #define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ | 1212 | #define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ |
1213 | #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ | 1213 | #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ |
1214 | 1214 | ||
1215 | #define WM831X_ISINK_MAX_ISEL 56 | 1215 | #define WM831X_ISINK_MAX_ISEL 55 |
1216 | extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL]; | 1216 | extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1]; |
1217 | 1217 | ||
1218 | #endif | 1218 | #endif |
diff --git a/include/linux/net.h b/include/linux/net.h index 6ce87663551c..5e8083cacc8b 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -280,6 +280,7 @@ extern int kernel_sock_shutdown(struct socket *sock, | |||
280 | 280 | ||
281 | #ifdef CONFIG_SYSCTL | 281 | #ifdef CONFIG_SYSCTL |
282 | #include <linux/sysctl.h> | 282 | #include <linux/sysctl.h> |
283 | #include <linux/ratelimit.h> | ||
283 | extern struct ratelimit_state net_ratelimit_state; | 284 | extern struct ratelimit_state net_ratelimit_state; |
284 | #endif | 285 | #endif |
285 | 286 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 84cf1f3b7838..daecca3c8300 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1633,6 +1633,8 @@ | |||
1633 | #define PCI_DEVICE_ID_O2_6730 0x673a | 1633 | #define PCI_DEVICE_ID_O2_6730 0x673a |
1634 | #define PCI_DEVICE_ID_O2_6832 0x6832 | 1634 | #define PCI_DEVICE_ID_O2_6832 0x6832 |
1635 | #define PCI_DEVICE_ID_O2_6836 0x6836 | 1635 | #define PCI_DEVICE_ID_O2_6836 0x6836 |
1636 | #define PCI_DEVICE_ID_O2_6812 0x6872 | ||
1637 | #define PCI_DEVICE_ID_O2_6933 0x6933 | ||
1636 | 1638 | ||
1637 | #define PCI_VENDOR_ID_3DFX 0x121a | 1639 | #define PCI_VENDOR_ID_3DFX 0x121a |
1638 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 | 1640 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 065a3652a3ea..67608161df6b 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -147,6 +147,20 @@ static inline void forget_cached_acl(struct inode *inode, int type) | |||
147 | if (old != ACL_NOT_CACHED) | 147 | if (old != ACL_NOT_CACHED) |
148 | posix_acl_release(old); | 148 | posix_acl_release(old); |
149 | } | 149 | } |
150 | |||
151 | static inline void forget_all_cached_acls(struct inode *inode) | ||
152 | { | ||
153 | struct posix_acl *old_access, *old_default; | ||
154 | spin_lock(&inode->i_lock); | ||
155 | old_access = inode->i_acl; | ||
156 | old_default = inode->i_default_acl; | ||
157 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
158 | spin_unlock(&inode->i_lock); | ||
159 | if (old_access != ACL_NOT_CACHED) | ||
160 | posix_acl_release(old_access); | ||
161 | if (old_default != ACL_NOT_CACHED) | ||
162 | posix_acl_release(old_default); | ||
163 | } | ||
150 | #endif | 164 | #endif |
151 | 165 | ||
152 | static inline void cache_no_acl(struct inode *inode) | 166 | static inline void cache_no_acl(struct inode *inode) |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 78c48895b12a..ce9a9b2e5cd4 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -376,6 +376,17 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | |||
376 | return flags >> _DQUOT_STATE_FLAGS; | 376 | return flags >> _DQUOT_STATE_FLAGS; |
377 | } | 377 | } |
378 | 378 | ||
379 | #ifdef CONFIG_QUOTA_NETLINK_INTERFACE | ||
380 | extern void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
381 | const char warntype); | ||
382 | #else | ||
383 | static inline void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
384 | const char warntype) | ||
385 | { | ||
386 | return; | ||
387 | } | ||
388 | #endif /* CONFIG_QUOTA_NETLINK_INTERFACE */ | ||
389 | |||
379 | struct quota_info { | 390 | struct quota_info { |
380 | unsigned int flags; /* Flags for diskquotas on this device */ | 391 | unsigned int flags; /* Flags for diskquotas on this device */ |
381 | struct mutex dqio_mutex; /* lock device while I/O in progress */ | 392 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 00044b856453..668cf1bef030 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -1,20 +1,31 @@ | |||
1 | #ifndef _LINUX_RATELIMIT_H | 1 | #ifndef _LINUX_RATELIMIT_H |
2 | #define _LINUX_RATELIMIT_H | 2 | #define _LINUX_RATELIMIT_H |
3 | |||
3 | #include <linux/param.h> | 4 | #include <linux/param.h> |
5 | #include <linux/spinlock_types.h> | ||
4 | 6 | ||
5 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) | 7 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) |
6 | #define DEFAULT_RATELIMIT_BURST 10 | 8 | #define DEFAULT_RATELIMIT_BURST 10 |
7 | 9 | ||
8 | struct ratelimit_state { | 10 | struct ratelimit_state { |
9 | int interval; | 11 | spinlock_t lock; /* protect the state */ |
10 | int burst; | 12 | |
11 | int printed; | 13 | int interval; |
12 | int missed; | 14 | int burst; |
13 | unsigned long begin; | 15 | int printed; |
16 | int missed; | ||
17 | unsigned long begin; | ||
14 | }; | 18 | }; |
15 | 19 | ||
16 | #define DEFINE_RATELIMIT_STATE(name, interval, burst) \ | 20 | #define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ |
17 | struct ratelimit_state name = {interval, burst,} | 21 | \ |
22 | struct ratelimit_state name = { \ | ||
23 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | ||
24 | .interval = interval_init, \ | ||
25 | .burst = burst_init, \ | ||
26 | } | ||
27 | |||
28 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | ||
29 | #define __ratelimit(state) ___ratelimit(state, __func__) | ||
18 | 30 | ||
19 | extern int __ratelimit(struct ratelimit_state *rs); | 31 | #endif /* _LINUX_RATELIMIT_H */ |
20 | #endif | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 3ebd0b7bcb08..24440f4bf476 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -52,11 +52,6 @@ struct rcu_head { | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* Exported common interfaces */ | 54 | /* Exported common interfaces */ |
55 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
56 | extern void synchronize_rcu(void); | ||
57 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
58 | #define synchronize_rcu synchronize_sched | ||
59 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
60 | extern void synchronize_rcu_bh(void); | 55 | extern void synchronize_rcu_bh(void); |
61 | extern void synchronize_sched(void); | 56 | extern void synchronize_sched(void); |
62 | extern void rcu_barrier(void); | 57 | extern void rcu_barrier(void); |
@@ -67,12 +62,11 @@ extern int sched_expedited_torture_stats(char *page); | |||
67 | 62 | ||
68 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
69 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
70 | extern void rcu_scheduler_starting(void); | ||
71 | extern int rcu_needs_cpu(int cpu); | ||
72 | extern int rcu_scheduler_active; | ||
73 | 65 | ||
74 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
75 | #include <linux/rcutree.h> | 67 | #include <linux/rcutree.h> |
68 | #elif defined(CONFIG_TINY_RCU) | ||
69 | #include <linux/rcutiny.h> | ||
76 | #else | 70 | #else |
77 | #error "Unknown RCU implementation specified to kernel configuration" | 71 | #error "Unknown RCU implementation specified to kernel configuration" |
78 | #endif | 72 | #endif |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h new file mode 100644 index 000000000000..c4ba9a78721e --- /dev/null +++ b/include/linux/rcutiny.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * Copyright IBM Corporation, 2008 | ||
19 | * | ||
20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
21 | * | ||
22 | * For detailed explanation of Read-Copy Update mechanism see - | ||
23 | * Documentation/RCU | ||
24 | */ | ||
25 | #ifndef __LINUX_TINY_H | ||
26 | #define __LINUX_TINY_H | ||
27 | |||
28 | #include <linux/cache.h> | ||
29 | |||
30 | void rcu_sched_qs(int cpu); | ||
31 | void rcu_bh_qs(int cpu); | ||
32 | |||
33 | #define __rcu_read_lock() preempt_disable() | ||
34 | #define __rcu_read_unlock() preempt_enable() | ||
35 | #define __rcu_read_lock_bh() local_bh_disable() | ||
36 | #define __rcu_read_unlock_bh() local_bh_enable() | ||
37 | #define call_rcu_sched call_rcu | ||
38 | |||
39 | #define rcu_init_sched() do { } while (0) | ||
40 | extern void rcu_check_callbacks(int cpu, int user); | ||
41 | |||
42 | static inline int rcu_needs_cpu(int cpu) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * Return the number of grace periods. | ||
49 | */ | ||
50 | static inline long rcu_batches_completed(void) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | /* | ||
56 | * Return the number of bottom-half grace periods. | ||
57 | */ | ||
58 | static inline long rcu_batches_completed_bh(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | extern int rcu_expedited_torture_stats(char *page); | ||
64 | |||
65 | #define synchronize_rcu synchronize_sched | ||
66 | |||
67 | static inline void synchronize_rcu_expedited(void) | ||
68 | { | ||
69 | synchronize_sched(); | ||
70 | } | ||
71 | |||
72 | static inline void synchronize_rcu_bh_expedited(void) | ||
73 | { | ||
74 | synchronize_sched(); | ||
75 | } | ||
76 | |||
77 | struct notifier_block; | ||
78 | |||
79 | #ifdef CONFIG_NO_HZ | ||
80 | |||
81 | extern void rcu_enter_nohz(void); | ||
82 | extern void rcu_exit_nohz(void); | ||
83 | |||
84 | #else /* #ifdef CONFIG_NO_HZ */ | ||
85 | |||
86 | static inline void rcu_enter_nohz(void) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void rcu_exit_nohz(void) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
95 | |||
96 | static inline void rcu_scheduler_starting(void) | ||
97 | { | ||
98 | } | ||
99 | |||
100 | static inline void exit_rcu(void) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | #endif /* __LINUX_RCUTINY_H */ | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 9642c6bcb399..c93eee5911b0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -34,15 +34,15 @@ struct notifier_block; | |||
34 | 34 | ||
35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
37 | extern int rcu_cpu_notify(struct notifier_block *self, | ||
38 | unsigned long action, void *hcpu); | ||
39 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
38 | extern void rcu_scheduler_starting(void); | ||
40 | extern int rcu_expedited_torture_stats(char *page); | 39 | extern int rcu_expedited_torture_stats(char *page); |
41 | 40 | ||
42 | #ifdef CONFIG_TREE_PREEMPT_RCU | 41 | #ifdef CONFIG_TREE_PREEMPT_RCU |
43 | 42 | ||
44 | extern void __rcu_read_lock(void); | 43 | extern void __rcu_read_lock(void); |
45 | extern void __rcu_read_unlock(void); | 44 | extern void __rcu_read_unlock(void); |
45 | extern void synchronize_rcu(void); | ||
46 | extern void exit_rcu(void); | 46 | extern void exit_rcu(void); |
47 | 47 | ||
48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
@@ -57,7 +57,7 @@ static inline void __rcu_read_unlock(void) | |||
57 | preempt_enable(); | 57 | preempt_enable(); |
58 | } | 58 | } |
59 | 59 | ||
60 | #define __synchronize_sched() synchronize_rcu() | 60 | #define synchronize_rcu synchronize_sched |
61 | 61 | ||
62 | static inline void exit_rcu(void) | 62 | static inline void exit_rcu(void) |
63 | { | 63 | { |
@@ -83,7 +83,6 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
83 | synchronize_sched_expedited(); | 83 | synchronize_sched_expedited(); |
84 | } | 84 | } |
85 | 85 | ||
86 | extern void __rcu_init(void); | ||
87 | extern void rcu_check_callbacks(int cpu, int user); | 86 | extern void rcu_check_callbacks(int cpu, int user); |
88 | 87 | ||
89 | extern long rcu_batches_completed(void); | 88 | extern long rcu_batches_completed(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 75e6e60bf583..882dc48163b4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1421,17 +1421,17 @@ struct task_struct { | |||
1421 | #endif | 1421 | #endif |
1422 | #ifdef CONFIG_TRACE_IRQFLAGS | 1422 | #ifdef CONFIG_TRACE_IRQFLAGS |
1423 | unsigned int irq_events; | 1423 | unsigned int irq_events; |
1424 | int hardirqs_enabled; | ||
1425 | unsigned long hardirq_enable_ip; | 1424 | unsigned long hardirq_enable_ip; |
1426 | unsigned int hardirq_enable_event; | ||
1427 | unsigned long hardirq_disable_ip; | 1425 | unsigned long hardirq_disable_ip; |
1426 | unsigned int hardirq_enable_event; | ||
1428 | unsigned int hardirq_disable_event; | 1427 | unsigned int hardirq_disable_event; |
1429 | int softirqs_enabled; | 1428 | int hardirqs_enabled; |
1429 | int hardirq_context; | ||
1430 | unsigned long softirq_disable_ip; | 1430 | unsigned long softirq_disable_ip; |
1431 | unsigned int softirq_disable_event; | ||
1432 | unsigned long softirq_enable_ip; | 1431 | unsigned long softirq_enable_ip; |
1432 | unsigned int softirq_disable_event; | ||
1433 | unsigned int softirq_enable_event; | 1433 | unsigned int softirq_enable_event; |
1434 | int hardirq_context; | 1434 | int softirqs_enabled; |
1435 | int softirq_context; | 1435 | int softirq_context; |
1436 | #endif | 1436 | #endif |
1437 | #ifdef CONFIG_LOCKDEP | 1437 | #ifdef CONFIG_LOCKDEP |
@@ -2086,11 +2086,18 @@ static inline int is_si_special(const struct siginfo *info) | |||
2086 | return info <= SEND_SIG_FORCED; | 2086 | return info <= SEND_SIG_FORCED; |
2087 | } | 2087 | } |
2088 | 2088 | ||
2089 | /* True if we are on the alternate signal stack. */ | 2089 | /* |
2090 | 2090 | * True if we are on the alternate signal stack. | |
2091 | */ | ||
2091 | static inline int on_sig_stack(unsigned long sp) | 2092 | static inline int on_sig_stack(unsigned long sp) |
2092 | { | 2093 | { |
2093 | return (sp - current->sas_ss_sp < current->sas_ss_size); | 2094 | #ifdef CONFIG_STACK_GROWSUP |
2095 | return sp >= current->sas_ss_sp && | ||
2096 | sp - current->sas_ss_sp < current->sas_ss_size; | ||
2097 | #else | ||
2098 | return sp > current->sas_ss_sp && | ||
2099 | sp - current->sas_ss_sp <= current->sas_ss_size; | ||
2100 | #endif | ||
2094 | } | 2101 | } |
2095 | 2102 | ||
2096 | static inline int sas_ss_flags(unsigned long sp) | 2103 | static inline int sas_ss_flags(unsigned long sp) |
diff --git a/include/linux/securebits.h b/include/linux/securebits.h index d2c5ed845bcc..33406174cbe8 100644 --- a/include/linux/securebits.h +++ b/include/linux/securebits.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef _LINUX_SECUREBITS_H | 1 | #ifndef _LINUX_SECUREBITS_H |
2 | #define _LINUX_SECUREBITS_H 1 | 2 | #define _LINUX_SECUREBITS_H 1 |
3 | 3 | ||
4 | /* Each securesetting is implemented using two bits. One bit specifies | ||
5 | whether the setting is on or off. The other bit specify whether the | ||
6 | setting is locked or not. A setting which is locked cannot be | ||
7 | changed from user-level. */ | ||
8 | #define issecure_mask(X) (1 << (X)) | ||
9 | #ifdef __KERNEL__ | ||
10 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
11 | #endif | ||
12 | |||
4 | #define SECUREBITS_DEFAULT 0x00000000 | 13 | #define SECUREBITS_DEFAULT 0x00000000 |
5 | 14 | ||
6 | /* When set UID 0 has no special privileges. When unset, we support | 15 | /* When set UID 0 has no special privileges. When unset, we support |
@@ -12,6 +21,9 @@ | |||
12 | #define SECURE_NOROOT 0 | 21 | #define SECURE_NOROOT 0 |
13 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ | 22 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ |
14 | 23 | ||
24 | #define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT)) | ||
25 | #define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED)) | ||
26 | |||
15 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". | 27 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". |
16 | When unset, to provide compatiblility with old programs relying on | 28 | When unset, to provide compatiblility with old programs relying on |
17 | set*uid to gain/lose privilege, transitions to/from uid 0 cause | 29 | set*uid to gain/lose privilege, transitions to/from uid 0 cause |
@@ -19,6 +31,10 @@ | |||
19 | #define SECURE_NO_SETUID_FIXUP 2 | 31 | #define SECURE_NO_SETUID_FIXUP 2 |
20 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ | 32 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ |
21 | 33 | ||
34 | #define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP)) | ||
35 | #define SECBIT_NO_SETUID_FIXUP_LOCKED \ | ||
36 | (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED)) | ||
37 | |||
22 | /* When set, a process can retain its capabilities even after | 38 | /* When set, a process can retain its capabilities even after |
23 | transitioning to a non-root user (the set-uid fixup suppressed by | 39 | transitioning to a non-root user (the set-uid fixup suppressed by |
24 | bit 2). Bit-4 is cleared when a process calls exec(); setting both | 40 | bit 2). Bit-4 is cleared when a process calls exec(); setting both |
@@ -27,12 +43,8 @@ | |||
27 | #define SECURE_KEEP_CAPS 4 | 43 | #define SECURE_KEEP_CAPS 4 |
28 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ | 44 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ |
29 | 45 | ||
30 | /* Each securesetting is implemented using two bits. One bit specifies | 46 | #define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS)) |
31 | whether the setting is on or off. The other bit specify whether the | 47 | #define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED)) |
32 | setting is locked or not. A setting which is locked cannot be | ||
33 | changed from user-level. */ | ||
34 | #define issecure_mask(X) (1 << (X)) | ||
35 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
36 | 48 | ||
37 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | 49 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ |
38 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | 50 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ |
diff --git a/include/linux/security.h b/include/linux/security.h index 239e40d0450b..466cbadbd1ef 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -447,6 +447,22 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
447 | * @new_dir contains the path structure for parent of the new link. | 447 | * @new_dir contains the path structure for parent of the new link. |
448 | * @new_dentry contains the dentry structure of the new link. | 448 | * @new_dentry contains the dentry structure of the new link. |
449 | * Return 0 if permission is granted. | 449 | * Return 0 if permission is granted. |
450 | * @path_chmod: | ||
451 | * Check for permission to change DAC's permission of a file or directory. | ||
452 | * @dentry contains the dentry structure. | ||
453 | * @mnt contains the vfsmnt structure. | ||
454 | * @mode contains DAC's mode. | ||
455 | * Return 0 if permission is granted. | ||
456 | * @path_chown: | ||
457 | * Check for permission to change owner/group of a file or directory. | ||
458 | * @path contains the path structure. | ||
459 | * @uid contains new owner's ID. | ||
460 | * @gid contains new group's ID. | ||
461 | * Return 0 if permission is granted. | ||
462 | * @path_chroot: | ||
463 | * Check for permission to change root directory. | ||
464 | * @path contains the path structure. | ||
465 | * Return 0 if permission is granted. | ||
450 | * @inode_readlink: | 466 | * @inode_readlink: |
451 | * Check the permission to read the symbolic link. | 467 | * Check the permission to read the symbolic link. |
452 | * @dentry contains the dentry structure for the file link. | 468 | * @dentry contains the dentry structure for the file link. |
@@ -690,6 +706,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
690 | * @kernel_module_request: | 706 | * @kernel_module_request: |
691 | * Ability to trigger the kernel to automatically upcall to userspace for | 707 | * Ability to trigger the kernel to automatically upcall to userspace for |
692 | * userspace to load a kernel module with the given name. | 708 | * userspace to load a kernel module with the given name. |
709 | * @kmod_name name of the module requested by the kernel | ||
693 | * Return 0 if successful. | 710 | * Return 0 if successful. |
694 | * @task_setuid: | 711 | * @task_setuid: |
695 | * Check permission before setting one or more of the user identity | 712 | * Check permission before setting one or more of the user identity |
@@ -1488,6 +1505,10 @@ struct security_operations { | |||
1488 | struct dentry *new_dentry); | 1505 | struct dentry *new_dentry); |
1489 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | 1506 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, |
1490 | struct path *new_dir, struct dentry *new_dentry); | 1507 | struct path *new_dir, struct dentry *new_dentry); |
1508 | int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, | ||
1509 | mode_t mode); | ||
1510 | int (*path_chown) (struct path *path, uid_t uid, gid_t gid); | ||
1511 | int (*path_chroot) (struct path *path); | ||
1491 | #endif | 1512 | #endif |
1492 | 1513 | ||
1493 | int (*inode_alloc_security) (struct inode *inode); | 1514 | int (*inode_alloc_security) (struct inode *inode); |
@@ -1557,7 +1578,7 @@ struct security_operations { | |||
1557 | void (*cred_transfer)(struct cred *new, const struct cred *old); | 1578 | void (*cred_transfer)(struct cred *new, const struct cred *old); |
1558 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1579 | int (*kernel_act_as)(struct cred *new, u32 secid); |
1559 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1580 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
1560 | int (*kernel_module_request)(void); | 1581 | int (*kernel_module_request)(char *kmod_name); |
1561 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1582 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
1562 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1583 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
1563 | int flags); | 1584 | int flags); |
@@ -1822,7 +1843,7 @@ void security_commit_creds(struct cred *new, const struct cred *old); | |||
1822 | void security_transfer_creds(struct cred *new, const struct cred *old); | 1843 | void security_transfer_creds(struct cred *new, const struct cred *old); |
1823 | int security_kernel_act_as(struct cred *new, u32 secid); | 1844 | int security_kernel_act_as(struct cred *new, u32 secid); |
1824 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1845 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
1825 | int security_kernel_module_request(void); | 1846 | int security_kernel_module_request(char *kmod_name); |
1826 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1847 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
1827 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1848 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
1828 | int flags); | 1849 | int flags); |
@@ -2387,7 +2408,7 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
2387 | return 0; | 2408 | return 0; |
2388 | } | 2409 | } |
2389 | 2410 | ||
2390 | static inline int security_kernel_module_request(void) | 2411 | static inline int security_kernel_module_request(char *kmod_name) |
2391 | { | 2412 | { |
2392 | return 0; | 2413 | return 0; |
2393 | } | 2414 | } |
@@ -2952,6 +2973,10 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, | |||
2952 | struct dentry *new_dentry); | 2973 | struct dentry *new_dentry); |
2953 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | 2974 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
2954 | struct path *new_dir, struct dentry *new_dentry); | 2975 | struct path *new_dir, struct dentry *new_dentry); |
2976 | int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, | ||
2977 | mode_t mode); | ||
2978 | int security_path_chown(struct path *path, uid_t uid, gid_t gid); | ||
2979 | int security_path_chroot(struct path *path); | ||
2955 | #else /* CONFIG_SECURITY_PATH */ | 2980 | #else /* CONFIG_SECURITY_PATH */ |
2956 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | 2981 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) |
2957 | { | 2982 | { |
@@ -3001,6 +3026,23 @@ static inline int security_path_rename(struct path *old_dir, | |||
3001 | { | 3026 | { |
3002 | return 0; | 3027 | return 0; |
3003 | } | 3028 | } |
3029 | |||
3030 | static inline int security_path_chmod(struct dentry *dentry, | ||
3031 | struct vfsmount *mnt, | ||
3032 | mode_t mode) | ||
3033 | { | ||
3034 | return 0; | ||
3035 | } | ||
3036 | |||
3037 | static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) | ||
3038 | { | ||
3039 | return 0; | ||
3040 | } | ||
3041 | |||
3042 | static inline int security_path_chroot(struct path *path) | ||
3043 | { | ||
3044 | return 0; | ||
3045 | } | ||
3004 | #endif /* CONFIG_SECURITY_PATH */ | 3046 | #endif /* CONFIG_SECURITY_PATH */ |
3005 | 3047 | ||
3006 | #ifdef CONFIG_KEYS | 3048 | #ifdef CONFIG_KEYS |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 39c64bae776d..7a0570e6a596 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -76,6 +76,9 @@ void smp_call_function_many(const struct cpumask *mask, | |||
76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
77 | int wait); | 77 | int wait); |
78 | 78 | ||
79 | int smp_call_function_any(const struct cpumask *mask, | ||
80 | void (*func)(void *info), void *info, int wait); | ||
81 | |||
79 | /* | 82 | /* |
80 | * Generic and arch helpers | 83 | * Generic and arch helpers |
81 | */ | 84 | */ |
@@ -137,9 +140,15 @@ static inline void smp_send_reschedule(int cpu) { } | |||
137 | #define smp_prepare_boot_cpu() do {} while (0) | 140 | #define smp_prepare_boot_cpu() do {} while (0) |
138 | #define smp_call_function_many(mask, func, info, wait) \ | 141 | #define smp_call_function_many(mask, func, info, wait) \ |
139 | (up_smp_call_function(func, info)) | 142 | (up_smp_call_function(func, info)) |
140 | static inline void init_call_single_data(void) | 143 | static inline void init_call_single_data(void) { } |
144 | |||
145 | static inline int | ||
146 | smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | ||
147 | void *info, int wait) | ||
141 | { | 148 | { |
149 | return smp_call_function_single(0, func, info, wait); | ||
142 | } | 150 | } |
151 | |||
143 | #endif /* !SMP */ | 152 | #endif /* !SMP */ |
144 | 153 | ||
145 | /* | 154 | /* |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 813be59bf345..2ea1dd1ba21c 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
@@ -24,8 +24,21 @@ static inline int reacquire_kernel_lock(struct task_struct *task) | |||
24 | return 0; | 24 | return 0; |
25 | } | 25 | } |
26 | 26 | ||
27 | extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); | 27 | extern void __lockfunc |
28 | extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); | 28 | _lock_kernel(const char *func, const char *file, int line) |
29 | __acquires(kernel_lock); | ||
30 | |||
31 | extern void __lockfunc | ||
32 | _unlock_kernel(const char *func, const char *file, int line) | ||
33 | __releases(kernel_lock); | ||
34 | |||
35 | #define lock_kernel() do { \ | ||
36 | _lock_kernel(__func__, __FILE__, __LINE__); \ | ||
37 | } while (0) | ||
38 | |||
39 | #define unlock_kernel() do { \ | ||
40 | _unlock_kernel(__func__, __FILE__, __LINE__); \ | ||
41 | } while (0) | ||
29 | 42 | ||
30 | /* | 43 | /* |
31 | * Various legacy drivers don't really need the BKL in a specific | 44 | * Various legacy drivers don't really need the BKL in a specific |
@@ -41,8 +54,8 @@ static inline void cycle_kernel_lock(void) | |||
41 | 54 | ||
42 | #else | 55 | #else |
43 | 56 | ||
44 | #define lock_kernel() do { } while(0) | 57 | #define lock_kernel() |
45 | #define unlock_kernel() do { } while(0) | 58 | #define unlock_kernel() |
46 | #define release_kernel_lock(task) do { } while(0) | 59 | #define release_kernel_lock(task) do { } while(0) |
47 | #define cycle_kernel_lock() do { } while(0) | 60 | #define cycle_kernel_lock() do { } while(0) |
48 | #define reacquire_kernel_lock(task) 0 | 61 | #define reacquire_kernel_lock(task) 0 |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index f0ca7a7a1757..71dccfeb0d88 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -79,8 +79,6 @@ | |||
79 | */ | 79 | */ |
80 | #include <linux/spinlock_types.h> | 80 | #include <linux/spinlock_types.h> |
81 | 81 | ||
82 | extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | ||
83 | |||
84 | /* | 82 | /* |
85 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): | 83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): |
86 | */ | 84 | */ |
@@ -102,7 +100,7 @@ do { \ | |||
102 | 100 | ||
103 | #else | 101 | #else |
104 | # define spin_lock_init(lock) \ | 102 | # define spin_lock_init(lock) \ |
105 | do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) | 103 | do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0) |
106 | #endif | 104 | #endif |
107 | 105 | ||
108 | #ifdef CONFIG_DEBUG_SPINLOCK | 106 | #ifdef CONFIG_DEBUG_SPINLOCK |
@@ -116,7 +114,7 @@ do { \ | |||
116 | } while (0) | 114 | } while (0) |
117 | #else | 115 | #else |
118 | # define rwlock_init(lock) \ | 116 | # define rwlock_init(lock) \ |
119 | do { *(lock) = RW_LOCK_UNLOCKED; } while (0) | 117 | do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) |
120 | #endif | 118 | #endif |
121 | 119 | ||
122 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) | 120 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 7a7e18fc2415..8264a7f459bc 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -60,137 +60,118 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
61 | __releases(lock); | 61 | __releases(lock); |
62 | 62 | ||
63 | /* | 63 | #ifdef CONFIG_INLINE_SPIN_LOCK |
64 | * We inline the unlock functions in the nondebug case: | ||
65 | */ | ||
66 | #if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT) | ||
67 | #define __always_inline__spin_unlock | ||
68 | #define __always_inline__read_unlock | ||
69 | #define __always_inline__write_unlock | ||
70 | #define __always_inline__spin_unlock_irq | ||
71 | #define __always_inline__read_unlock_irq | ||
72 | #define __always_inline__write_unlock_irq | ||
73 | #endif | ||
74 | |||
75 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
76 | #ifndef CONFIG_GENERIC_LOCKBREAK | ||
77 | |||
78 | #ifdef __always_inline__spin_lock | ||
79 | #define _spin_lock(lock) __spin_lock(lock) | 64 | #define _spin_lock(lock) __spin_lock(lock) |
80 | #endif | 65 | #endif |
81 | 66 | ||
82 | #ifdef __always_inline__read_lock | 67 | #ifdef CONFIG_INLINE_READ_LOCK |
83 | #define _read_lock(lock) __read_lock(lock) | 68 | #define _read_lock(lock) __read_lock(lock) |
84 | #endif | 69 | #endif |
85 | 70 | ||
86 | #ifdef __always_inline__write_lock | 71 | #ifdef CONFIG_INLINE_WRITE_LOCK |
87 | #define _write_lock(lock) __write_lock(lock) | 72 | #define _write_lock(lock) __write_lock(lock) |
88 | #endif | 73 | #endif |
89 | 74 | ||
90 | #ifdef __always_inline__spin_lock_bh | 75 | #ifdef CONFIG_INLINE_SPIN_LOCK_BH |
91 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) | 76 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) |
92 | #endif | 77 | #endif |
93 | 78 | ||
94 | #ifdef __always_inline__read_lock_bh | 79 | #ifdef CONFIG_INLINE_READ_LOCK_BH |
95 | #define _read_lock_bh(lock) __read_lock_bh(lock) | 80 | #define _read_lock_bh(lock) __read_lock_bh(lock) |
96 | #endif | 81 | #endif |
97 | 82 | ||
98 | #ifdef __always_inline__write_lock_bh | 83 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH |
99 | #define _write_lock_bh(lock) __write_lock_bh(lock) | 84 | #define _write_lock_bh(lock) __write_lock_bh(lock) |
100 | #endif | 85 | #endif |
101 | 86 | ||
102 | #ifdef __always_inline__spin_lock_irq | 87 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQ |
103 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) | 88 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) |
104 | #endif | 89 | #endif |
105 | 90 | ||
106 | #ifdef __always_inline__read_lock_irq | 91 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ |
107 | #define _read_lock_irq(lock) __read_lock_irq(lock) | 92 | #define _read_lock_irq(lock) __read_lock_irq(lock) |
108 | #endif | 93 | #endif |
109 | 94 | ||
110 | #ifdef __always_inline__write_lock_irq | 95 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ |
111 | #define _write_lock_irq(lock) __write_lock_irq(lock) | 96 | #define _write_lock_irq(lock) __write_lock_irq(lock) |
112 | #endif | 97 | #endif |
113 | 98 | ||
114 | #ifdef __always_inline__spin_lock_irqsave | 99 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE |
115 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) | 100 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) |
116 | #endif | 101 | #endif |
117 | 102 | ||
118 | #ifdef __always_inline__read_lock_irqsave | 103 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE |
119 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | 104 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) |
120 | #endif | 105 | #endif |
121 | 106 | ||
122 | #ifdef __always_inline__write_lock_irqsave | 107 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE |
123 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | 108 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) |
124 | #endif | 109 | #endif |
125 | 110 | ||
126 | #endif /* !CONFIG_GENERIC_LOCKBREAK */ | 111 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK |
127 | |||
128 | #ifdef __always_inline__spin_trylock | ||
129 | #define _spin_trylock(lock) __spin_trylock(lock) | 112 | #define _spin_trylock(lock) __spin_trylock(lock) |
130 | #endif | 113 | #endif |
131 | 114 | ||
132 | #ifdef __always_inline__read_trylock | 115 | #ifdef CONFIG_INLINE_READ_TRYLOCK |
133 | #define _read_trylock(lock) __read_trylock(lock) | 116 | #define _read_trylock(lock) __read_trylock(lock) |
134 | #endif | 117 | #endif |
135 | 118 | ||
136 | #ifdef __always_inline__write_trylock | 119 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK |
137 | #define _write_trylock(lock) __write_trylock(lock) | 120 | #define _write_trylock(lock) __write_trylock(lock) |
138 | #endif | 121 | #endif |
139 | 122 | ||
140 | #ifdef __always_inline__spin_trylock_bh | 123 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH |
141 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) | 124 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) |
142 | #endif | 125 | #endif |
143 | 126 | ||
144 | #ifdef __always_inline__spin_unlock | 127 | #ifdef CONFIG_INLINE_SPIN_UNLOCK |
145 | #define _spin_unlock(lock) __spin_unlock(lock) | 128 | #define _spin_unlock(lock) __spin_unlock(lock) |
146 | #endif | 129 | #endif |
147 | 130 | ||
148 | #ifdef __always_inline__read_unlock | 131 | #ifdef CONFIG_INLINE_READ_UNLOCK |
149 | #define _read_unlock(lock) __read_unlock(lock) | 132 | #define _read_unlock(lock) __read_unlock(lock) |
150 | #endif | 133 | #endif |
151 | 134 | ||
152 | #ifdef __always_inline__write_unlock | 135 | #ifdef CONFIG_INLINE_WRITE_UNLOCK |
153 | #define _write_unlock(lock) __write_unlock(lock) | 136 | #define _write_unlock(lock) __write_unlock(lock) |
154 | #endif | 137 | #endif |
155 | 138 | ||
156 | #ifdef __always_inline__spin_unlock_bh | 139 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_BH |
157 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) | 140 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) |
158 | #endif | 141 | #endif |
159 | 142 | ||
160 | #ifdef __always_inline__read_unlock_bh | 143 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH |
161 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | 144 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) |
162 | #endif | 145 | #endif |
163 | 146 | ||
164 | #ifdef __always_inline__write_unlock_bh | 147 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH |
165 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | 148 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) |
166 | #endif | 149 | #endif |
167 | 150 | ||
168 | #ifdef __always_inline__spin_unlock_irq | 151 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ |
169 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) | 152 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) |
170 | #endif | 153 | #endif |
171 | 154 | ||
172 | #ifdef __always_inline__read_unlock_irq | 155 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ |
173 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | 156 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) |
174 | #endif | 157 | #endif |
175 | 158 | ||
176 | #ifdef __always_inline__write_unlock_irq | 159 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ |
177 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | 160 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) |
178 | #endif | 161 | #endif |
179 | 162 | ||
180 | #ifdef __always_inline__spin_unlock_irqrestore | 163 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE |
181 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) | 164 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) |
182 | #endif | 165 | #endif |
183 | 166 | ||
184 | #ifdef __always_inline__read_unlock_irqrestore | 167 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE |
185 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | 168 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) |
186 | #endif | 169 | #endif |
187 | 170 | ||
188 | #ifdef __always_inline__write_unlock_irqrestore | 171 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE |
189 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | 172 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) |
190 | #endif | 173 | #endif |
191 | 174 | ||
192 | #endif /* CONFIG_DEBUG_SPINLOCK */ | ||
193 | |||
194 | static inline int __spin_trylock(spinlock_t *lock) | 175 | static inline int __spin_trylock(spinlock_t *lock) |
195 | { | 176 | { |
196 | preempt_disable(); | 177 | preempt_disable(); |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index aca0eee53930..4765d97dcafb 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp); | |||
48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); |
49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
50 | void synchronize_srcu(struct srcu_struct *sp); | 50 | void synchronize_srcu(struct srcu_struct *sp); |
51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | ||
51 | long srcu_batches_completed(struct srcu_struct *sp); | 52 | long srcu_batches_completed(struct srcu_struct *sp); |
52 | 53 | ||
53 | #endif | 54 | #endif |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 73b1f1cec423..febedcf67c7e 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -7,6 +7,8 @@ struct device; | |||
7 | struct dma_attrs; | 7 | struct dma_attrs; |
8 | struct scatterlist; | 8 | struct scatterlist; |
9 | 9 | ||
10 | extern int swiotlb_force; | ||
11 | |||
10 | /* | 12 | /* |
11 | * Maximum allowable number of contiguous slabs to map, | 13 | * Maximum allowable number of contiguous slabs to map, |
12 | * must be a power of 2. What is the appropriate value ? | 14 | * must be a power of 2. What is the appropriate value ? |
@@ -20,8 +22,7 @@ struct scatterlist; | |||
20 | */ | 22 | */ |
21 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
22 | 24 | ||
23 | extern void | 25 | extern void swiotlb_init(int verbose); |
24 | swiotlb_init(void); | ||
25 | 26 | ||
26 | extern void | 27 | extern void |
27 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
@@ -88,4 +89,11 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | |||
88 | extern int | 89 | extern int |
89 | swiotlb_dma_supported(struct device *hwdev, u64 mask); | 90 | swiotlb_dma_supported(struct device *hwdev, u64 mask); |
90 | 91 | ||
92 | #ifdef CONFIG_SWIOTLB | ||
93 | extern void __init swiotlb_free(void); | ||
94 | #else | ||
95 | static inline void swiotlb_free(void) { } | ||
96 | #endif | ||
97 | |||
98 | extern void swiotlb_print_info(void); | ||
91 | #endif /* __LINUX_SWIOTLB_H */ | 99 | #endif /* __LINUX_SWIOTLB_H */ |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 3338b3f5c21a..ac5d1c1285d9 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -27,9 +27,16 @@ | |||
27 | */ | 27 | */ |
28 | #define TPM_ANY_NUM 0xFFFF | 28 | #define TPM_ANY_NUM 0xFFFF |
29 | 29 | ||
30 | #if defined(CONFIG_TCG_TPM) | 30 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
31 | 31 | ||
32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
34 | #else | ||
35 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | ||
36 | return -ENODEV; | ||
37 | } | ||
38 | static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { | ||
39 | return -ENODEV; | ||
40 | } | ||
34 | #endif | 41 | #endif |
35 | #endif | 42 | #endif |