aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h1
-rw-r--r--include/linux/coda_psdev.h15
-rw-r--r--include/linux/elfcore.h9
-rw-r--r--include/linux/in6.h2
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/irq.h86
-rw-r--r--include/linux/irqnr.h1
-rw-r--r--include/linux/kprobes.h22
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/mmiotrace.h78
-rw-r--r--include/linux/nubus.h2
-rw-r--r--include/linux/percpu.h47
-rw-r--r--include/linux/reiserfs_fs.h56
-rw-r--r--include/linux/sched.h16
-rw-r--r--include/linux/smp.h6
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/stackprotector.h16
-rw-r--r--include/linux/topology.h6
-rw-r--r--include/linux/types.h6
19 files changed, 280 insertions, 97 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 6fce2fc2d124..78199151c00b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -79,6 +79,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
79typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 79typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
80 80
81char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 81char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
82void __acpi_unmap_table(char *map, unsigned long size);
82int early_acpi_boot_init(void); 83int early_acpi_boot_init(void);
83int acpi_boot_init (void); 84int acpi_boot_init (void);
84int acpi_boot_table_init (void); 85int acpi_boot_table_init (void);
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 07ae8f846055..5b5d4731f956 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -6,6 +6,7 @@
6#define CODA_PSDEV_MAJOR 67 6#define CODA_PSDEV_MAJOR 67
7#define MAX_CODADEVS 5 /* how many do we allow */ 7#define MAX_CODADEVS 5 /* how many do we allow */
8 8
9#ifdef __KERNEL__
9struct kstatfs; 10struct kstatfs;
10 11
11/* communication pending/processing queues */ 12/* communication pending/processing queues */
@@ -24,7 +25,6 @@ static inline struct venus_comm *coda_vcp(struct super_block *sb)
24 return (struct venus_comm *)((sb)->s_fs_info); 25 return (struct venus_comm *)((sb)->s_fs_info);
25} 26}
26 27
27
28/* upcalls */ 28/* upcalls */
29int venus_rootfid(struct super_block *sb, struct CodaFid *fidp); 29int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
30int venus_getattr(struct super_block *sb, struct CodaFid *fid, 30int venus_getattr(struct super_block *sb, struct CodaFid *fid,
@@ -64,6 +64,12 @@ int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
64int venus_fsync(struct super_block *sb, struct CodaFid *fid); 64int venus_fsync(struct super_block *sb, struct CodaFid *fid);
65int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); 65int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
66 66
67/*
68 * Statistics
69 */
70
71extern struct venus_comm coda_comms[];
72#endif /* __KERNEL__ */
67 73
68/* messages between coda filesystem in kernel and Venus */ 74/* messages between coda filesystem in kernel and Venus */
69struct upc_req { 75struct upc_req {
@@ -82,11 +88,4 @@ struct upc_req {
82#define REQ_WRITE 0x4 88#define REQ_WRITE 0x4
83#define REQ_ABORT 0x8 89#define REQ_ABORT 0x8
84 90
85
86/*
87 * Statistics
88 */
89
90extern struct venus_comm coda_comms[];
91
92#endif 91#endif
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 5ca54d77079f..7605c5e9589f 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -111,6 +111,15 @@ static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *re
111#endif 111#endif
112} 112}
113 113
114static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
115{
116#ifdef ELF_CORE_COPY_KERNEL_REGS
117 ELF_CORE_COPY_KERNEL_REGS((*elfregs), regs);
118#else
119 elf_core_copy_regs(elfregs, regs);
120#endif
121}
122
114static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) 123static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
115{ 124{
116#ifdef ELF_CORE_COPY_TASK_REGS 125#ifdef ELF_CORE_COPY_TASK_REGS
diff --git a/include/linux/in6.h b/include/linux/in6.h
index bc492048c349..718bf21c5754 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -44,11 +44,11 @@ struct in6_addr
44 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined 44 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
45 * in network byte order, not in host byte order as are the IPv4 equivalents 45 * in network byte order, not in host byte order as are the IPv4 equivalents
46 */ 46 */
47#ifdef __KERNEL__
47extern const struct in6_addr in6addr_any; 48extern const struct in6_addr in6addr_any;
48#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 49#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
49extern const struct in6_addr in6addr_loopback; 50extern const struct in6_addr in6addr_loopback;
50#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } 51#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
51#ifdef __KERNEL__
52extern const struct in6_addr in6addr_linklocal_allnodes; 52extern const struct in6_addr in6addr_linklocal_allnodes;
53#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ 53#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
54 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } 54 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 9127f6b51a39..472f11765f60 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -467,6 +467,7 @@ int show_interrupts(struct seq_file *p, void *v);
467struct irq_desc; 467struct irq_desc;
468 468
469extern int early_irq_init(void); 469extern int early_irq_init(void);
470extern int arch_probe_nr_irqs(void);
470extern int arch_early_irq_init(void); 471extern int arch_early_irq_init(void);
471extern int arch_init_chip_data(struct irq_desc *desc, int cpu); 472extern int arch_init_chip_data(struct irq_desc *desc, int cpu);
472 473
diff --git a/include/linux/irq.h b/include/linux/irq.h
index f899b502f186..27a67536511e 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -182,11 +182,11 @@ struct irq_desc {
182 unsigned int irqs_unhandled; 182 unsigned int irqs_unhandled;
183 spinlock_t lock; 183 spinlock_t lock;
184#ifdef CONFIG_SMP 184#ifdef CONFIG_SMP
185 cpumask_t affinity; 185 cpumask_var_t affinity;
186 unsigned int cpu; 186 unsigned int cpu;
187#endif
188#ifdef CONFIG_GENERIC_PENDING_IRQ 187#ifdef CONFIG_GENERIC_PENDING_IRQ
189 cpumask_t pending_mask; 188 cpumask_var_t pending_mask;
189#endif
190#endif 190#endif
191#ifdef CONFIG_PROC_FS 191#ifdef CONFIG_PROC_FS
192 struct proc_dir_entry *dir; 192 struct proc_dir_entry *dir;
@@ -422,4 +422,84 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
422 422
423#endif /* !CONFIG_S390 */ 423#endif /* !CONFIG_S390 */
424 424
425#ifdef CONFIG_SMP
426/**
427 * init_alloc_desc_masks - allocate cpumasks for irq_desc
428 * @desc: pointer to irq_desc struct
429 * @cpu: cpu which will be handling the cpumasks
430 * @boot: true if need bootmem
431 *
432 * Allocates affinity and pending_mask cpumask if required.
433 * Returns true if successful (or not required).
434 * Side effect: affinity has all bits set, pending_mask has all bits clear.
435 */
436static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
437 bool boot)
438{
439 int node;
440
441 if (boot) {
442 alloc_bootmem_cpumask_var(&desc->affinity);
443 cpumask_setall(desc->affinity);
444
445#ifdef CONFIG_GENERIC_PENDING_IRQ
446 alloc_bootmem_cpumask_var(&desc->pending_mask);
447 cpumask_clear(desc->pending_mask);
448#endif
449 return true;
450 }
451
452 node = cpu_to_node(cpu);
453
454 if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
455 return false;
456 cpumask_setall(desc->affinity);
457
458#ifdef CONFIG_GENERIC_PENDING_IRQ
459 if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
460 free_cpumask_var(desc->affinity);
461 return false;
462 }
463 cpumask_clear(desc->pending_mask);
464#endif
465 return true;
466}
467
468/**
469 * init_copy_desc_masks - copy cpumasks for irq_desc
470 * @old_desc: pointer to old irq_desc struct
471 * @new_desc: pointer to new irq_desc struct
472 *
473 * Insures affinity and pending_masks are copied to new irq_desc.
474 * If !CONFIG_CPUMASKS_OFFSTACK the cpumasks are embedded in the
475 * irq_desc struct so the copy is redundant.
476 */
477
478static inline void init_copy_desc_masks(struct irq_desc *old_desc,
479 struct irq_desc *new_desc)
480{
481#ifdef CONFIG_CPUMASKS_OFFSTACK
482 cpumask_copy(new_desc->affinity, old_desc->affinity);
483
484#ifdef CONFIG_GENERIC_PENDING_IRQ
485 cpumask_copy(new_desc->pending_mask, old_desc->pending_mask);
486#endif
487#endif
488}
489
490#else /* !CONFIG_SMP */
491
492static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
493 bool boot)
494{
495 return true;
496}
497
498static inline void init_copy_desc_masks(struct irq_desc *old_desc,
499 struct irq_desc *new_desc)
500{
501}
502
503#endif /* CONFIG_SMP */
504
425#endif /* _LINUX_IRQ_H */ 505#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 86af92e9e84c..887477bc2ab0 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -20,6 +20,7 @@
20 20
21# define for_each_irq_desc_reverse(irq, desc) \ 21# define for_each_irq_desc_reverse(irq, desc) \
22 for (irq = nr_irqs - 1; irq >= 0; irq--) 22 for (irq = nr_irqs - 1; irq >= 0; irq--)
23
23#else /* CONFIG_GENERIC_HARDIRQS */ 24#else /* CONFIG_GENERIC_HARDIRQS */
24 25
25extern int nr_irqs; 26extern int nr_irqs;
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 32851eef48f0..2ec6cc14a114 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -182,6 +182,14 @@ struct kprobe_blackpoint {
182DECLARE_PER_CPU(struct kprobe *, current_kprobe); 182DECLARE_PER_CPU(struct kprobe *, current_kprobe);
183DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 183DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
184 184
185/*
186 * For #ifdef avoidance:
187 */
188static inline int kprobes_built_in(void)
189{
190 return 1;
191}
192
185#ifdef CONFIG_KRETPROBES 193#ifdef CONFIG_KRETPROBES
186extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, 194extern void arch_prepare_kretprobe(struct kretprobe_instance *ri,
187 struct pt_regs *regs); 195 struct pt_regs *regs);
@@ -271,8 +279,16 @@ void unregister_kretprobes(struct kretprobe **rps, int num);
271void kprobe_flush_task(struct task_struct *tk); 279void kprobe_flush_task(struct task_struct *tk);
272void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); 280void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
273 281
274#else /* CONFIG_KPROBES */ 282#else /* !CONFIG_KPROBES: */
275 283
284static inline int kprobes_built_in(void)
285{
286 return 0;
287}
288static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
289{
290 return 0;
291}
276static inline struct kprobe *get_kprobe(void *addr) 292static inline struct kprobe *get_kprobe(void *addr)
277{ 293{
278 return NULL; 294 return NULL;
@@ -329,5 +345,5 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num)
329static inline void kprobe_flush_task(struct task_struct *tk) 345static inline void kprobe_flush_task(struct task_struct *tk)
330{ 346{
331} 347}
332#endif /* CONFIG_KPROBES */ 348#endif /* CONFIG_KPROBES */
333#endif /* _LINUX_KPROBES_H */ 349#endif /* _LINUX_KPROBES_H */
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 0b4df7eba852..5b4e28bcb788 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -49,4 +49,5 @@
49#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA 49#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
50#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA 50#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
51 51
52#define STACK_END_MAGIC 0x57AC6E9D
52#endif /* __LINUX_MAGIC_H__ */ 53#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h
index 139d7c88d9c9..3d1b7bde1283 100644
--- a/include/linux/mmiotrace.h
+++ b/include/linux/mmiotrace.h
@@ -1,5 +1,5 @@
1#ifndef MMIOTRACE_H 1#ifndef _LINUX_MMIOTRACE_H
2#define MMIOTRACE_H 2#define _LINUX_MMIOTRACE_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/list.h> 5#include <linux/list.h>
@@ -13,28 +13,34 @@ typedef void (*kmmio_post_handler_t)(struct kmmio_probe *,
13 unsigned long condition, struct pt_regs *); 13 unsigned long condition, struct pt_regs *);
14 14
15struct kmmio_probe { 15struct kmmio_probe {
16 struct list_head list; /* kmmio internal list */ 16 /* kmmio internal list: */
17 unsigned long addr; /* start location of the probe point */ 17 struct list_head list;
18 unsigned long len; /* length of the probe region */ 18 /* start location of the probe point: */
19 kmmio_pre_handler_t pre_handler; /* Called before addr is executed. */ 19 unsigned long addr;
20 kmmio_post_handler_t post_handler; /* Called after addr is executed */ 20 /* length of the probe region: */
21 void *private; 21 unsigned long len;
22 /* Called before addr is executed: */
23 kmmio_pre_handler_t pre_handler;
24 /* Called after addr is executed: */
25 kmmio_post_handler_t post_handler;
26 void *private;
22}; 27};
23 28
29extern unsigned int kmmio_count;
30
31extern int register_kmmio_probe(struct kmmio_probe *p);
32extern void unregister_kmmio_probe(struct kmmio_probe *p);
33
34#ifdef CONFIG_MMIOTRACE
24/* kmmio is active by some kmmio_probes? */ 35/* kmmio is active by some kmmio_probes? */
25static inline int is_kmmio_active(void) 36static inline int is_kmmio_active(void)
26{ 37{
27 extern unsigned int kmmio_count;
28 return kmmio_count; 38 return kmmio_count;
29} 39}
30 40
31extern int register_kmmio_probe(struct kmmio_probe *p);
32extern void unregister_kmmio_probe(struct kmmio_probe *p);
33
34/* Called from page fault handler. */ 41/* Called from page fault handler. */
35extern int kmmio_handler(struct pt_regs *regs, unsigned long addr); 42extern int kmmio_handler(struct pt_regs *regs, unsigned long addr);
36 43
37#ifdef CONFIG_MMIOTRACE
38/* Called from ioremap.c */ 44/* Called from ioremap.c */
39extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size, 45extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
40 void __iomem *addr); 46 void __iomem *addr);
@@ -43,7 +49,17 @@ extern void mmiotrace_iounmap(volatile void __iomem *addr);
43/* For anyone to insert markers. Remember trailing newline. */ 49/* For anyone to insert markers. Remember trailing newline. */
44extern int mmiotrace_printk(const char *fmt, ...) 50extern int mmiotrace_printk(const char *fmt, ...)
45 __attribute__ ((format (printf, 1, 2))); 51 __attribute__ ((format (printf, 1, 2)));
46#else 52#else /* !CONFIG_MMIOTRACE: */
53static inline int is_kmmio_active(void)
54{
55 return 0;
56}
57
58static inline int kmmio_handler(struct pt_regs *regs, unsigned long addr)
59{
60 return 0;
61}
62
47static inline void mmiotrace_ioremap(resource_size_t offset, 63static inline void mmiotrace_ioremap(resource_size_t offset,
48 unsigned long size, void __iomem *addr) 64 unsigned long size, void __iomem *addr)
49{ 65{
@@ -63,28 +79,28 @@ static inline int mmiotrace_printk(const char *fmt, ...)
63#endif /* CONFIG_MMIOTRACE */ 79#endif /* CONFIG_MMIOTRACE */
64 80
65enum mm_io_opcode { 81enum mm_io_opcode {
66 MMIO_READ = 0x1, /* struct mmiotrace_rw */ 82 MMIO_READ = 0x1, /* struct mmiotrace_rw */
67 MMIO_WRITE = 0x2, /* struct mmiotrace_rw */ 83 MMIO_WRITE = 0x2, /* struct mmiotrace_rw */
68 MMIO_PROBE = 0x3, /* struct mmiotrace_map */ 84 MMIO_PROBE = 0x3, /* struct mmiotrace_map */
69 MMIO_UNPROBE = 0x4, /* struct mmiotrace_map */ 85 MMIO_UNPROBE = 0x4, /* struct mmiotrace_map */
70 MMIO_UNKNOWN_OP = 0x5, /* struct mmiotrace_rw */ 86 MMIO_UNKNOWN_OP = 0x5, /* struct mmiotrace_rw */
71}; 87};
72 88
73struct mmiotrace_rw { 89struct mmiotrace_rw {
74 resource_size_t phys; /* PCI address of register */ 90 resource_size_t phys; /* PCI address of register */
75 unsigned long value; 91 unsigned long value;
76 unsigned long pc; /* optional program counter */ 92 unsigned long pc; /* optional program counter */
77 int map_id; 93 int map_id;
78 unsigned char opcode; /* one of MMIO_{READ,WRITE,UNKNOWN_OP} */ 94 unsigned char opcode; /* one of MMIO_{READ,WRITE,UNKNOWN_OP} */
79 unsigned char width; /* size of register access in bytes */ 95 unsigned char width; /* size of register access in bytes */
80}; 96};
81 97
82struct mmiotrace_map { 98struct mmiotrace_map {
83 resource_size_t phys; /* base address in PCI space */ 99 resource_size_t phys; /* base address in PCI space */
84 unsigned long virt; /* base virtual address */ 100 unsigned long virt; /* base virtual address */
85 unsigned long len; /* mapping size */ 101 unsigned long len; /* mapping size */
86 int map_id; 102 int map_id;
87 unsigned char opcode; /* MMIO_PROBE or MMIO_UNPROBE */ 103 unsigned char opcode; /* MMIO_PROBE or MMIO_UNPROBE */
88}; 104};
89 105
90/* in kernel/trace/trace_mmiotrace.c */ 106/* in kernel/trace/trace_mmiotrace.c */
@@ -94,4 +110,4 @@ extern void mmio_trace_rw(struct mmiotrace_rw *rw);
94extern void mmio_trace_mapping(struct mmiotrace_map *map); 110extern void mmio_trace_mapping(struct mmiotrace_map *map);
95extern int mmio_trace_printk(const char *fmt, va_list args); 111extern int mmio_trace_printk(const char *fmt, va_list args);
96 112
97#endif /* MMIOTRACE_H */ 113#endif /* _LINUX_MMIOTRACE_H */
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index 7382af374731..e137b3c486a7 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -237,6 +237,7 @@ struct nubus_dirent
237 int mask; 237 int mask;
238}; 238};
239 239
240#ifdef __KERNEL__
240struct nubus_board { 241struct nubus_board {
241 struct nubus_board* next; 242 struct nubus_board* next;
242 struct nubus_dev* first_dev; 243 struct nubus_dev* first_dev;
@@ -351,6 +352,7 @@ void nubus_get_rsrc_mem(void* dest,
351void nubus_get_rsrc_str(void* dest, 352void nubus_get_rsrc_str(void* dest,
352 const struct nubus_dirent *dirent, 353 const struct nubus_dirent *dirent,
353 int maxlen); 354 int maxlen);
355#endif /* __KERNEL__ */
354 356
355/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */ 357/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
356static inline void *nubus_slot_addr(int slot) 358static inline void *nubus_slot_addr(int slot)
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 9f2a3751873a..3577ffd90d45 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -8,35 +8,46 @@
8 8
9#include <asm/percpu.h> 9#include <asm/percpu.h>
10 10
11#ifndef PER_CPU_BASE_SECTION
12#ifdef CONFIG_SMP
13#define PER_CPU_BASE_SECTION ".data.percpu"
14#else
15#define PER_CPU_BASE_SECTION ".data"
16#endif
17#endif
18
11#ifdef CONFIG_SMP 19#ifdef CONFIG_SMP
12#define DEFINE_PER_CPU(type, name) \
13 __attribute__((__section__(".data.percpu"))) \
14 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
15 20
16#ifdef MODULE 21#ifdef MODULE
17#define SHARED_ALIGNED_SECTION ".data.percpu" 22#define PER_CPU_SHARED_ALIGNED_SECTION ""
18#else 23#else
19#define SHARED_ALIGNED_SECTION ".data.percpu.shared_aligned" 24#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
20#endif 25#endif
26#define PER_CPU_FIRST_SECTION ".first"
21 27
22#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ 28#else
23 __attribute__((__section__(SHARED_ALIGNED_SECTION))) \
24 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \
25 ____cacheline_aligned_in_smp
26 29
27#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ 30#define PER_CPU_SHARED_ALIGNED_SECTION ""
28 __attribute__((__section__(".data.percpu.page_aligned"))) \ 31#define PER_CPU_FIRST_SECTION ""
32
33#endif
34
35#define DEFINE_PER_CPU_SECTION(type, name, section) \
36 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \
29 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 37 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
30#else 38
31#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
32 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 40 DEFINE_PER_CPU_SECTION(type, name, "")
33 41
34#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ 42#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
35 DEFINE_PER_CPU(type, name) 43 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
44 ____cacheline_aligned_in_smp
36 45
37#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ 46#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
38 DEFINE_PER_CPU(type, name) 47 DEFINE_PER_CPU_SECTION(type, name, ".page_aligned")
39#endif 48
49#define DEFINE_PER_CPU_FIRST(type, name) \
50 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION)
40 51
41#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) 52#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
42#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) 53#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index bc5114d35e99..e356c99f0659 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -28,8 +28,6 @@
28#include <linux/reiserfs_fs_sb.h> 28#include <linux/reiserfs_fs_sb.h>
29#endif 29#endif
30 30
31struct fid;
32
33/* 31/*
34 * include/linux/reiser_fs.h 32 * include/linux/reiser_fs.h
35 * 33 *
@@ -37,6 +35,33 @@ struct fid;
37 * 35 *
38 */ 36 */
39 37
38/* ioctl's command */
39#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
40/* define following flags to be the same as in ext2, so that chattr(1),
41 lsattr(1) will work with us. */
42#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
43#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
44#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
45#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
46
47#ifdef __KERNEL__
48/* the 32 bit compat definitions with int argument */
49#define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int)
50#define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
51#define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
52#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
53#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
54
55/* Locking primitives */
56/* Right now we are still falling back to (un)lock_kernel, but eventually that
57 would evolve into real per-fs locks */
58#define reiserfs_write_lock( sb ) lock_kernel()
59#define reiserfs_write_unlock( sb ) unlock_kernel()
60
61/* xattr stuff */
62#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
63struct fid;
64
40/* in reading the #defines, it may help to understand that they employ 65/* in reading the #defines, it may help to understand that they employ
41 the following abbreviations: 66 the following abbreviations:
42 67
@@ -698,6 +723,7 @@ static inline void cpu_key_k_offset_dec(struct cpu_key *key)
698/* object identifier for root dir */ 723/* object identifier for root dir */
699#define REISERFS_ROOT_OBJECTID 2 724#define REISERFS_ROOT_OBJECTID 2
700#define REISERFS_ROOT_PARENT_OBJECTID 1 725#define REISERFS_ROOT_PARENT_OBJECTID 1
726
701extern struct reiserfs_key root_key; 727extern struct reiserfs_key root_key;
702 728
703/* 729/*
@@ -1540,7 +1566,6 @@ struct reiserfs_iget_args {
1540/* FUNCTION DECLARATIONS */ 1566/* FUNCTION DECLARATIONS */
1541/***************************************************************************/ 1567/***************************************************************************/
1542 1568
1543/*#ifdef __KERNEL__*/
1544#define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12) 1569#define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12)
1545 1570
1546#define journal_trans_half(blocksize) \ 1571#define journal_trans_half(blocksize) \
@@ -2178,29 +2203,6 @@ long reiserfs_compat_ioctl(struct file *filp,
2178 unsigned int cmd, unsigned long arg); 2203 unsigned int cmd, unsigned long arg);
2179int reiserfs_unpack(struct inode *inode, struct file *filp); 2204int reiserfs_unpack(struct inode *inode, struct file *filp);
2180 2205
2181/* ioctl's command */
2182#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
2183/* define following flags to be the same as in ext2, so that chattr(1),
2184 lsattr(1) will work with us. */
2185#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
2186#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
2187#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
2188#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
2189
2190/* the 32 bit compat definitions with int argument */
2191#define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int)
2192#define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
2193#define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
2194#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
2195#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
2196
2197/* Locking primitives */
2198/* Right now we are still falling back to (un)lock_kernel, but eventually that
2199 would evolve into real per-fs locks */
2200#define reiserfs_write_lock( sb ) lock_kernel()
2201#define reiserfs_write_unlock( sb ) unlock_kernel()
2202
2203/* xattr stuff */
2204#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
2205 2206
2207#endif /* __KERNEL__ */
2206#endif /* _LINUX_REISER_FS_H */ 2208#endif /* _LINUX_REISER_FS_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8981e52c714f..f0a50b20e8a0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1178,10 +1178,9 @@ struct task_struct {
1178 pid_t pid; 1178 pid_t pid;
1179 pid_t tgid; 1179 pid_t tgid;
1180 1180
1181#ifdef CONFIG_CC_STACKPROTECTOR
1182 /* Canary value for the -fstack-protector gcc feature */ 1181 /* Canary value for the -fstack-protector gcc feature */
1183 unsigned long stack_canary; 1182 unsigned long stack_canary;
1184#endif 1183
1185 /* 1184 /*
1186 * pointers to (original) parent process, youngest child, younger sibling, 1185 * pointers to (original) parent process, youngest child, younger sibling,
1187 * older sibling, respectively. (p->father can be replaced with 1186 * older sibling, respectively. (p->father can be replaced with
@@ -2087,6 +2086,19 @@ static inline int object_is_on_stack(void *obj)
2087 2086
2088extern void thread_info_cache_init(void); 2087extern void thread_info_cache_init(void);
2089 2088
2089#ifdef CONFIG_DEBUG_STACK_USAGE
2090static inline unsigned long stack_not_used(struct task_struct *p)
2091{
2092 unsigned long *n = end_of_stack(p);
2093
2094 do { /* Skip over canary */
2095 n++;
2096 } while (!*n);
2097
2098 return (unsigned long)n - (unsigned long)end_of_stack(p);
2099}
2100#endif
2101
2090/* set thread flags in other task's structures 2102/* set thread flags in other task's structures
2091 * - see asm/thread_info.h for TIF_xxxx flags available 2103 * - see asm/thread_info.h for TIF_xxxx flags available
2092 */ 2104 */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 715196b09d67..bbacb7baa446 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -176,6 +176,12 @@ static inline void init_call_single_data(void)
176#define put_cpu() preempt_enable() 176#define put_cpu() preempt_enable()
177#define put_cpu_no_resched() preempt_enable_no_resched() 177#define put_cpu_no_resched() preempt_enable_no_resched()
178 178
179/*
180 * Callback to arch code if there's nosmp or maxcpus=0 on the
181 * boot command line:
182 */
183extern void arch_disable_smp_support(void);
184
179void smp_setup_processor_id(void); 185void smp_setup_processor_id(void);
180 186
181#endif /* __LINUX_SMP_H */ 187#endif /* __LINUX_SMP_H */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 20fc4bbfca42..afc01909a428 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -24,10 +24,12 @@ struct __kernel_sockaddr_storage {
24#include <linux/types.h> /* pid_t */ 24#include <linux/types.h> /* pid_t */
25#include <linux/compiler.h> /* __user */ 25#include <linux/compiler.h> /* __user */
26 26
27#ifdef CONFIG_PROC_FS 27#ifdef __KERNEL__
28# ifdef CONFIG_PROC_FS
28struct seq_file; 29struct seq_file;
29extern void socket_seq_show(struct seq_file *seq); 30extern void socket_seq_show(struct seq_file *seq);
30#endif 31# endif
32#endif /* __KERNEL__ */
31 33
32typedef unsigned short sa_family_t; 34typedef unsigned short sa_family_t;
33 35
diff --git a/include/linux/stackprotector.h b/include/linux/stackprotector.h
new file mode 100644
index 000000000000..6f3e54c704c0
--- /dev/null
+++ b/include/linux/stackprotector.h
@@ -0,0 +1,16 @@
1#ifndef _LINUX_STACKPROTECTOR_H
2#define _LINUX_STACKPROTECTOR_H 1
3
4#include <linux/compiler.h>
5#include <linux/sched.h>
6#include <linux/random.h>
7
8#ifdef CONFIG_CC_STACKPROTECTOR
9# include <asm/stackprotector.h>
10#else
11static inline void boot_init_stack_canary(void)
12{
13}
14#endif
15
16#endif
diff --git a/include/linux/topology.h b/include/linux/topology.h
index e632d29f0544..a16b9e06f2e5 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -193,5 +193,11 @@ int arch_update_cpu_topology(void);
193#ifndef topology_core_siblings 193#ifndef topology_core_siblings
194#define topology_core_siblings(cpu) cpumask_of_cpu(cpu) 194#define topology_core_siblings(cpu) cpumask_of_cpu(cpu)
195#endif 195#endif
196#ifndef topology_thread_cpumask
197#define topology_thread_cpumask(cpu) cpumask_of(cpu)
198#endif
199#ifndef topology_core_cpumask
200#define topology_core_cpumask(cpu) cpumask_of(cpu)
201#endif
196 202
197#endif /* _LINUX_TOPOLOGY_H */ 203#endif /* _LINUX_TOPOLOGY_H */
diff --git a/include/linux/types.h b/include/linux/types.h
index 712ca53bc348..fca82ed55f49 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -1,6 +1,9 @@
1#ifndef _LINUX_TYPES_H 1#ifndef _LINUX_TYPES_H
2#define _LINUX_TYPES_H 2#define _LINUX_TYPES_H
3 3
4#include <asm/types.h>
5
6#ifndef __ASSEMBLY__
4#ifdef __KERNEL__ 7#ifdef __KERNEL__
5 8
6#define DECLARE_BITMAP(name,bits) \ 9#define DECLARE_BITMAP(name,bits) \
@@ -9,7 +12,6 @@
9#endif 12#endif
10 13
11#include <linux/posix_types.h> 14#include <linux/posix_types.h>
12#include <asm/types.h>
13 15
14#ifndef __KERNEL_STRICT_NAMES 16#ifndef __KERNEL_STRICT_NAMES
15 17
@@ -212,5 +214,5 @@ struct ustat {
212}; 214};
213 215
214#endif /* __KERNEL__ */ 216#endif /* __KERNEL__ */
215 217#endif /* __ASSEMBLY__ */
216#endif /* _LINUX_TYPES_H */ 218#endif /* _LINUX_TYPES_H */