summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-07-08 04:24:04 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-07-08 04:24:04 -0700
commit6fee4e4eae95a053b1148537c1fe1ee9ff3d7a45 (patch)
treefea61da3aecfaa64c024bea99e9216039d61fc5a /include
parent58af6e3af0578edece898ea59261812bad7a3576 (diff)
parenta1bafab5cbe2ce874fe5b0e012cc9ab74a672b39 (diff)
Resolve conflicts in ipconfig.c changes.
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/div64.h15
-rw-r--r--include/asm-alpha/machvec.h2
-rw-r--r--include/asm-alpha/mmu_context.h15
-rw-r--r--include/asm-alpha/mmzone.h3
-rw-r--r--include/asm-arm/mmu_context.h4
-rw-r--r--include/asm-arm26/arch.h62
-rw-r--r--include/asm-arm26/bug.h11
-rw-r--r--include/asm-arm26/bugs.h2
-rw-r--r--include/asm-arm26/div64.h15
-rw-r--r--include/asm-arm26/ecard.h3
-rw-r--r--include/asm-arm26/mach-types.h1
-rw-r--r--include/asm-arm26/mmu_context.h4
-rw-r--r--include/asm-arm26/pgalloc.h4
-rw-r--r--include/asm-arm26/pgtable.h2
-rw-r--r--include/asm-arm26/statfs.h21
-rw-r--r--include/asm-arm26/thread_info.h2
-rw-r--r--include/asm-cris/div64.h17
-rw-r--r--include/asm-cris/mmu_context.h6
-rw-r--r--include/asm-generic/div64.h53
-rw-r--r--include/asm-h8300/div64.h14
-rw-r--r--include/asm-h8300/flat.h17
-rw-r--r--include/asm-h8300/mmu_context.h4
-rw-r--r--include/asm-i386/cacheflush.h5
-rw-r--r--include/asm-i386/hardirq.h2
-rw-r--r--include/asm-i386/mmu_context.h11
-rw-r--r--include/asm-i386/mmzone.h5
-rw-r--r--include/asm-i386/timer.h13
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-ia64/div64.h21
-rw-r--r--include/asm-ia64/mmu_context.h4
-rw-r--r--include/asm-m68k/div64.h9
-rw-r--r--include/asm-m68k/mmu_context.h6
-rw-r--r--include/asm-m68knommu/div64.h14
-rw-r--r--include/asm-m68knommu/flat.h8
-rw-r--r--include/asm-m68knommu/io.h9
-rw-r--r--include/asm-m68knommu/mmu_context.h4
-rw-r--r--include/asm-m68knommu/page.h2
-rw-r--r--include/asm-m68knommu/semaphore.h2
-rw-r--r--include/asm-m68knommu/uaccess.h21
-rw-r--r--include/asm-mips/mmu_context.h5
-rw-r--r--include/asm-mips64/div64.h19
-rw-r--r--include/asm-mips64/mmu_context.h2
-rw-r--r--include/asm-mips64/mmzone.h2
-rw-r--r--include/asm-parisc/div64.h55
-rw-r--r--include/asm-parisc/mmu_context.h6
-rw-r--r--include/asm-ppc/div64.h24
-rw-r--r--include/asm-ppc/mmu_context.h4
-rw-r--r--include/asm-ppc/serial.h4
-rw-r--r--include/asm-ppc64/div64.h19
-rw-r--r--include/asm-ppc64/mmu_context.h8
-rw-r--r--include/asm-ppc64/mmzone.h1
-rw-r--r--include/asm-s390/div64.h8
-rw-r--r--include/asm-s390/mmu_context.h8
-rw-r--r--include/asm-sh/div64.h21
-rw-r--r--include/asm-sh/mmu_context.h10
-rw-r--r--include/asm-sparc/div64.h12
-rw-r--r--include/asm-sparc/mmu_context.h8
-rw-r--r--include/asm-sparc64/div64.h15
-rw-r--r--include/asm-sparc64/hardirq.h8
-rw-r--r--include/asm-sparc64/mmu_context.h6
-rw-r--r--include/asm-sparc64/xor.h360
-rw-r--r--include/asm-um/mmu_context.h6
-rw-r--r--include/asm-v850/div64.h12
-rw-r--r--include/asm-v850/flat.h117
-rw-r--r--include/asm-v850/mmu_context.h4
-rw-r--r--include/asm-x86_64/div64.h15
-rw-r--r--include/asm-x86_64/mmu_context.h9
-rw-r--r--include/asm-x86_64/mmzone.h3
-rw-r--r--include/linux/acct.h2
-rw-r--r--include/linux/affs_fs.h4
-rw-r--r--include/linux/blkdev.h92
-rw-r--r--include/linux/buffer_head.h7
-rw-r--r--include/linux/coda_linux.h2
-rw-r--r--include/linux/compat_ioctl.h2
-rw-r--r--include/linux/dcache.h3
-rw-r--r--include/linux/device.h13
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/eisa.h21
-rw-r--r--include/linux/elevator.h17
-rw-r--r--include/linux/eventpoll.h35
-rw-r--r--include/linux/ext3_fs.h6
-rw-r--r--include/linux/ext3_fs_i.h10
-rw-r--r--include/linux/flat.h20
-rw-r--r--include/linux/fs.h14
-rw-r--r--include/linux/hfs_fs.h2
-rw-r--r--include/linux/interrupt.h4
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/irq_cpustat.h4
-rw-r--r--include/linux/iso_fs.h2
-rw-r--r--include/linux/kernel_stat.h3
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/mm.h26
-rw-r--r--include/linux/mman.h3
-rw-r--r--include/linux/mmzone.h7
-rw-r--r--include/linux/msdos_fs.h8
-rw-r--r--include/linux/namei.h17
-rw-r--r--include/linux/netdevice.h8
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/proc_fs.h4
-rw-r--r--include/linux/qnx4_fs.h5
-rw-r--r--include/linux/quota.h10
-rw-r--r--include/linux/sched.h5
-rw-r--r--include/linux/security.h16
-rw-r--r--include/linux/sem.h1
-rw-r--r--include/linux/slab.h4
-rw-r--r--include/linux/sysfs.h5
-rw-r--r--include/linux/umsdos_fs.p4
108 files changed, 669 insertions, 913 deletions
diff --git a/include/asm-alpha/div64.h b/include/asm-alpha/div64.h
index 080dcd480805..6cd978cefb28 100644
--- a/include/asm-alpha/div64.h
+++ b/include/asm-alpha/div64.h
@@ -1,14 +1 @@
-#ifndef __ALPHA_DIV64
-#define __ALPHA_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) (n)) % (unsigned) (base); \
- (n) = ((unsigned long) (n)) / (unsigned) (base); \
- __res; })
-
-#endif
+#include <asm-generic/div64.h>
diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h
index 6d1b408e3ed5..f09f71909aa6 100644
--- a/include/asm-alpha/machvec.h
+++ b/include/asm-alpha/machvec.h
@@ -68,7 +68,7 @@ struct alpha_machine_vector
int (*mv_is_ioaddr)(unsigned long);
void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
- struct task_struct *, long);
+ struct task_struct *);
void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
void (*mv_flush_tlb_current)(struct mm_struct *);
diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h
index a087254ea38a..3ae6408acaed 100644
--- a/include/asm-alpha/mmu_context.h
+++ b/include/asm-alpha/mmu_context.h
@@ -130,11 +130,12 @@ __get_new_mm_context(struct mm_struct *mm, long cpu)
__EXTERN_INLINE void
ev5_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
- struct task_struct *next, long cpu)
+ struct task_struct *next)
{
/* Check if our ASN is of an older version, and thus invalid. */
unsigned long asn;
unsigned long mmc;
+ long cpu = smp_processor_id();
#ifdef CONFIG_SMP
cpu_data[cpu].asn_lock = 1;
@@ -159,7 +160,7 @@ ev5_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
__EXTERN_INLINE void
ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
- struct task_struct *next, long cpu)
+ struct task_struct *next)
{
/* As described, ASN's are broken for TLB usage. But we can
optimize for switching between threads -- if the mm is
@@ -174,7 +175,7 @@ ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
/* Do continue to allocate ASNs, because we can still use them
to avoid flushing the icache. */
- ev5_switch_mm(prev_mm, next_mm, next, cpu);
+ ev5_switch_mm(prev_mm, next_mm, next);
}
extern void __load_new_mm_context(struct mm_struct *);
@@ -212,14 +213,14 @@ ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
#define deactivate_mm(tsk,mm) do { } while (0)
#ifdef CONFIG_ALPHA_GENERIC
-# define switch_mm(a,b,c,d) alpha_mv.mv_switch_mm((a),(b),(c),(d))
+# define switch_mm(a,b,c) alpha_mv.mv_switch_mm((a),(b),(c))
# define activate_mm(x,y) alpha_mv.mv_activate_mm((x),(y))
#else
# ifdef CONFIG_ALPHA_EV4
-# define switch_mm(a,b,c,d) ev4_switch_mm((a),(b),(c),(d))
+# define switch_mm(a,b,c) ev4_switch_mm((a),(b),(c))
# define activate_mm(x,y) ev4_activate_mm((x),(y))
# else
-# define switch_mm(a,b,c,d) ev5_switch_mm((a),(b),(c),(d))
+# define switch_mm(a,b,c) ev5_switch_mm((a),(b),(c))
# define activate_mm(x,y) ev5_activate_mm((x),(y))
# endif
#endif
@@ -245,7 +246,7 @@ destroy_context(struct mm_struct *mm)
}
static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
tsk->thread_info->pcb.ptbr
= ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index 6edb9c64aa7b..36e3130c6696 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -31,7 +31,6 @@ extern pg_data_t node_data[];
#define pa_to_nid(pa) alpha_pa_to_nid(pa)
#define NODE_DATA(nid) (&node_data[(nid)])
-#define node_size(nid) (NODE_DATA(nid)->node_size)
#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
@@ -124,7 +123,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
#define pfn_to_nid(pfn) pa_to_nid(((u64)pfn << PAGE_SHIFT))
#define pfn_valid(pfn) \
(((pfn) - node_start_pfn(pfn_to_nid(pfn))) < \
- node_size(pfn_to_nid(pfn))) \
+ node_spanned_pages(pfn_to_nid(pfn))) \
#define virt_addr_valid(kaddr) pfn_valid((__pa(kaddr) >> PAGE_SHIFT))
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
index 3b3b473c668f..e0340f5fbf32 100644
--- a/include/asm-arm/mmu_context.h
+++ b/include/asm-arm/mmu_context.h
@@ -28,7 +28,7 @@
* tsk->mm will be NULL
*/
static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -40,7 +40,7 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
*/
static inline void
switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned int cpu)
+ struct task_struct *tsk)
{
if (prev != next) {
cpu_switch_mm(next->pgd, next);
diff --git a/include/asm-arm26/arch.h b/include/asm-arm26/arch.h
deleted file mode 100644
index 1011bcc6d7ac..000000000000
--- a/include/asm-arm26/arch.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * linux/include/asm-arm/mach/arch.h
- *
- * Copyright (C) 2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * The size of struct machine_desc
- * (for assembler code)
- * FIXME - I count 45... or is this padding?
- */
-#define SIZEOF_MACHINE_DESC 48
-
-#ifndef __ASSEMBLY__
-
-struct tag;
-
-struct machine_desc {
- int nr; /* arch no FIXME - get rid */
- const char *name; /* architecture name */
- unsigned int param_offset; /* parameter page */
-
- unsigned int video_start; /* start of video RAM */
- unsigned int video_end; /* end of video RAM */
-
- unsigned int reserve_lp0 :1; /* never has lp0 */
- unsigned int reserve_lp1 :1; /* never has lp1 */
- unsigned int reserve_lp2 :1; /* never has lp2 */
- unsigned int soft_reboot :1; /* soft reboot */
- void (*fixup)(struct machine_desc *,
- struct tag *, char **,
- struct meminfo *);
- void (*map_io)(void);/* IO mapping function */
- void (*init_irq)(void);
-};
-
-/*
- * Set of macros to define architecture features. This is built into
- * a table by the linker.
- */
-#define MACHINE_START(_type,_name) \
-const struct machine_desc __mach_desc_##_type \
- __attribute__((__section__(".arch.info"))) = { \
- nr: MACH_TYPE_##_type, \
- name: _name,
-
-#define MAINTAINER(n)
-
-#define BOOT_PARAMS(_params) \
- param_offset: _params,
-
-#define INITIRQ(_func) \
- init_irq: _func,
-
-#define MACHINE_END \
-};
-
-#endif
diff --git a/include/asm-arm26/bug.h b/include/asm-arm26/bug.h
index a92b1bc8eb1e..a1afde728b03 100644
--- a/include/asm-arm26/bug.h
+++ b/include/asm-arm26/bug.h
@@ -4,7 +4,7 @@
#include <linux/config.h>
#ifdef CONFIG_DEBUG_BUGVERBOSE
-extern void __bug(const char *file, int line, void *data);
+extern volatile void __bug(const char *file, int line, void *data);
/* give file/line information */
#define BUG() __bug(__FILE__, __LINE__, NULL)
@@ -18,4 +18,13 @@ extern void __bug(const char *file, int line, void *data);
#endif
+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+
+#define WARN_ON(condition) do { \
+ if (unlikely((condition)!=0)) { \
+ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
+ dump_stack(); \
+ } \
+} while (0)
+
#endif
diff --git a/include/asm-arm26/bugs.h b/include/asm-arm26/bugs.h
index 665ab62c27ce..e99ac2e46d7f 100644
--- a/include/asm-arm26/bugs.h
+++ b/include/asm-arm26/bugs.h
@@ -1,5 +1,5 @@
/*
- * linux/include/asm-arm/bugs.h
+ * linux/include/asm-arm26/bugs.h
*
* Copyright (C) 1995 Russell King
*
diff --git a/include/asm-arm26/div64.h b/include/asm-arm26/div64.h
index 27fec4ee6aed..6cd978cefb28 100644
--- a/include/asm-arm26/div64.h
+++ b/include/asm-arm26/div64.h
@@ -1,14 +1 @@
-#ifndef __ASM_ARM_DIV64
-#define __ASM_ARM_DIV64
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) \
-({ \
- int __res; \
- __res = ((unsigned long)n) % (unsigned int)base; \
- n = ((unsigned long)n) / (unsigned int)base; \
- __res; \
-})
-
-#endif
-
+#include <asm-generic/div64.h>
diff --git a/include/asm-arm26/ecard.h b/include/asm-arm26/ecard.h
index 28af14fd7f75..8318a0c1df81 100644
--- a/include/asm-arm26/ecard.h
+++ b/include/asm-arm26/ecard.h
@@ -26,6 +26,9 @@
#define PROD_ACORN_ETHER1 0x0003
#define PROD_ACORN_MFM 0x000b
+#define MANU_CCONCEPTS 0x0009
+#define PROD_CCONCEPTS_COLOURCARD 0x0050
+
#define MANU_ANT2 0x0011
#define PROD_ANT_ETHER3 0x00a4
diff --git a/include/asm-arm26/mach-types.h b/include/asm-arm26/mach-types.h
index 514b8032696c..b34045b78128 100644
--- a/include/asm-arm26/mach-types.h
+++ b/include/asm-arm26/mach-types.h
@@ -1,5 +1,6 @@
/*
* Unlike ARM32 this is NOT automatically generated. DONT delete it
+ * Instead, consider FIXME-ing it so its auto-detected.
*/
#ifndef __ASM_ARM_MACH_TYPE_H
diff --git a/include/asm-arm26/mmu_context.h b/include/asm-arm26/mmu_context.h
index 88b7b4f8f210..1a929bfe5c3a 100644
--- a/include/asm-arm26/mmu_context.h
+++ b/include/asm-arm26/mmu_context.h
@@ -26,7 +26,7 @@
* tsk->mm will be NULL
*/
static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -36,7 +36,7 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
*/
static inline void
switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned int cpu)
+ struct task_struct *tsk)
{
cpu_switch_mm(next->pgd, next);
}
diff --git a/include/asm-arm26/pgalloc.h b/include/asm-arm26/pgalloc.h
index bf2e19512524..6437167b1ffe 100644
--- a/include/asm-arm26/pgalloc.h
+++ b/include/asm-arm26/pgalloc.h
@@ -55,9 +55,9 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
* is thrown away. It just cant be zero. -IM
*/
-#define pmd_alloc_one(mm,addr) ((pmd_t *)2); BUG()
+#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
#define pmd_free(pmd) do { } while (0)
-#define pgd_populate(mm,pmd,pte) (0)
+#define pgd_populate(mm,pmd,pte) BUG()
extern pgd_t *get_pgd_slow(struct mm_struct *mm);
extern void free_pgd_slow(pgd_t *pgd);
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
index a6ac3957b0be..3fb067eaf801 100644
--- a/include/asm-arm26/pgtable.h
+++ b/include/asm-arm26/pgtable.h
@@ -179,7 +179,7 @@ extern struct page *empty_zero_page;
/* Is pmd_page supposed to return a pointer to a page in some arches? ours seems to
* return a pointer to memory (no special alignment)
*/
-#define pmd_page(pmd) ((unsigned long)(pmd_val((pmd)) & ~_PMD_PRESENT))
+#define pmd_page(pmd) ((struct page *)(pmd_val((pmd)) & ~_PMD_PRESENT))
#define pmd_page_kernel(pmd) ((pte_t *)(pmd_val((pmd)) & ~_PMD_PRESENT))
#define pte_offset_kernel(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
diff --git a/include/asm-arm26/statfs.h b/include/asm-arm26/statfs.h
index a1eba73ded99..776dbc8f7623 100644
--- a/include/asm-arm26/statfs.h
+++ b/include/asm-arm26/statfs.h
@@ -1,25 +1,8 @@
#ifndef _ASMARM_STATFS_H
#define _ASMARM_STATFS_H
-#ifndef __KERNEL_STRICT_NAMES
+//FIXME - this may not be appropriate for arm26. check it out.
-#include <linux/types.h>
-
-typedef __kernel_fsid_t fsid_t;
-
-#endif
-
-struct statfs {
- long f_type;
- long f_bsize;
- long f_blocks;
- long f_bfree;
- long f_bavail;
- long f_files;
- long f_ffree;
- __kernel_fsid_t f_fsid;
- long f_namelen;
- long f_spare[6];
-};
+#include <asm-generic/statfs.h>
#endif
diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h
index 3f298bf9206a..24c5136484fb 100644
--- a/include/asm-arm26/thread_info.h
+++ b/include/asm-arm26/thread_info.h
@@ -85,7 +85,7 @@ static inline struct thread_info *current_thread_info(void)
//#define INIT_THREAD_SIZE (65536)
#define __get_user_regs(x) (((struct pt_regs *)((unsigned long)(x) + THREAD_SIZE - 8)) - 1)
-extern struct thread_info *alloc_thread_info(void);
+extern struct thread_info *alloc_thread_info(struct task_struct *task);
extern void free_thread_info(struct thread_info *);
#define get_thread_info(ti) get_task_struct((ti)->task)
diff --git a/include/asm-cris/div64.h b/include/asm-cris/div64.h
index bf33c2e8a04d..6cd978cefb28 100644
--- a/include/asm-cris/div64.h
+++ b/include/asm-cris/div64.h
@@ -1,16 +1 @@
-#ifndef __ASM_CRIS_DIV64
-#define __ASM_CRIS_DIV64
-
-/* copy from asm-arm */
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) \
-({ \
- int __res; \
- __res = ((unsigned long)n) % (unsigned int)base; \
- n = ((unsigned long)n) / (unsigned int)base; \
- __res; \
-})
-
-#endif
-
+#include <asm-generic/div64.h>
diff --git a/include/asm-cris/mmu_context.h b/include/asm-cris/mmu_context.h
index 6a6ea71a85cd..f9308c5bbd99 100644
--- a/include/asm-cris/mmu_context.h
+++ b/include/asm-cris/mmu_context.h
@@ -5,11 +5,11 @@ extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
extern void get_mmu_context(struct mm_struct *mm);
extern void destroy_context(struct mm_struct *mm);
extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, int cpu);
+ struct task_struct *tsk);
#define deactivate_mm(tsk,mm) do { } while (0)
-#define activate_mm(prev,next) switch_mm((prev),(next),NULL,smp_processor_id())
+#define activate_mm(prev,next) switch_mm((prev),(next),NULL)
/* current active pgd - this is similar to other processors pgd
* registers like cr3 on the i386
@@ -17,7 +17,7 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
extern volatile pgd_t *current_pgd; /* defined in arch/cris/mm/fault.c */
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h
new file mode 100644
index 000000000000..292b5a840431
--- /dev/null
+++ b/include/asm-generic/div64.h
@@ -0,0 +1,53 @@
+#ifndef _ASM_GENERIC_DIV64_H
+#define _ASM_GENERIC_DIV64_H
+/*
+ * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+ * Based on former asm-ppc/div64.h and asm-m68knommu/div64.h
+ *
+ * The semantics of do_div() are:
+ *
+ * uint32_t do_div(uint64_t *n, uint32_t base)
+ * {
+ * uint32_t remainder = *n % base;
+ * *n = *n / base;
+ * return remainder;
+ * }
+ *
+ * NOTE: macro parameter n is evaluated multiple times,
+ * beware of side effects!
+ */
+
+#include <linux/types.h>
+
+#if BITS_PER_LONG == 64
+
+# define do_div(n,base) ({ \
+ uint32_t __base = (base); \
+ uint32_t __rem; \
+ __rem = ((uint64_t)(n)) % __base; \
+ (n) = ((uint64_t)(n)) / __base; \
+ __rem; \
+ })
+
+#elif BITS_PER_LONG == 32
+
+extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
+
+# define do_div(n,base) ({ \
+ uint32_t __base = (base); \
+ uint32_t __rem; \
+ if (((n) >> 32) == 0) { \
+ __rem = (uint32_t)(n) % __base; \
+ (n) = (uint32_t)(n) / __base; \
+ } else \
+ __rem = __div64_32(&(n), __base); \
+ __rem; \
+ })
+
+#else /* BITS_PER_LONG == ?? */
+
+# error do_div() does not yet support the C64
+
+#endif /* BITS_PER_LONG */
+
+#endif /* _ASM_GENERIC_DIV64_H */
diff --git a/include/asm-h8300/div64.h b/include/asm-h8300/div64.h
index df5634def9dc..6cd978cefb28 100644
--- a/include/asm-h8300/div64.h
+++ b/include/asm-h8300/div64.h
@@ -1,13 +1 @@
-#ifndef H8300_DIV64_H
-#define H8300_DIV64_H
-
-/* n = n / base; return rem; */
-
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; \
-})
-
-#endif /* _H8300_DIV64_H */
+#include <asm-generic/div64.h>
diff --git a/include/asm-h8300/flat.h b/include/asm-h8300/flat.h
index ac3f50610f54..61d9aaf7e0b2 100644
--- a/include/asm-h8300/flat.h
+++ b/include/asm-h8300/flat.h
@@ -5,6 +5,21 @@
#ifndef __H8300_FLAT_H__
#define __H8300_FLAT_H__
-#define flat_argvp_envp_on_stack() 1
+#define flat_stack_align(sp) /* nothing needed */
+#define flat_argvp_envp_on_stack() 1
+#define flat_old_ram_flag(flags) 1
+#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
+
+/*
+ * on the H8 a couple of the relocations have an instruction in the
+ * top byte. As there can only be 24bits of address space, we just
+ * always preserve that 8bits at the top, when it isn't an instruction
+ * is is 0 (davidm@snapgear.com)
+ */
+
+#define flat_get_relocate_addr(rel) (rel)
+#define flat_get_addr_from_rp(rp, relval) (get_unaligned(rp) & 0x0ffffff)
+#define flat_put_addr_at_rp(rp, addr, rel) \
+ put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
#endif /* __H8300_FLAT_H__ */
diff --git a/include/asm-h8300/mmu_context.h b/include/asm-h8300/mmu_context.h
index ffdf723191cf..23b555b7b4b9 100644
--- a/include/asm-h8300/mmu_context.h
+++ b/include/asm-h8300/mmu_context.h
@@ -6,7 +6,7 @@
#include <asm/page.h>
#include <asm/pgalloc.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -20,7 +20,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
#define destroy_context(mm) do { } while(0)
#define deactivate_mm(tsk,mm) do { } while(0)
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
}
diff --git a/include/asm-i386/cacheflush.h b/include/asm-i386/cacheflush.h
index adc632b97542..d3ce5511dbbc 100644
--- a/include/asm-i386/cacheflush.h
+++ b/include/asm-i386/cacheflush.h
@@ -17,4 +17,9 @@
void global_flush_tlb(void);
int change_page_attr(struct page *page, int numpages, pgprot_t prot);
+#ifdef CONFIG_DEBUG_PAGEALLOC
+/* internal debugging function */
+void kernel_map_pages(struct page *page, int numpages, int enable);
+#endif
+
#endif /* _I386_CACHEFLUSH_H */
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index e8b9149f0b29..5a14545af179 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -7,8 +7,6 @@
typedef struct {
unsigned int __softirq_pending;
- unsigned int __syscall_count;
- struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
unsigned long idle_timestamp;
unsigned int __nmi_count; /* arch dependent */
unsigned int apic_timer_irqs; /* arch dependent */
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h
index 14b1fa1ebef8..938fc1364344 100644
--- a/include/asm-i386/mmu_context.h
+++ b/include/asm-i386/mmu_context.h
@@ -14,16 +14,21 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
#ifdef CONFIG_SMP
+ unsigned cpu = smp_processor_id();
if (cpu_tlbstate[cpu].state == TLBSTATE_OK)
cpu_tlbstate[cpu].state = TLBSTATE_LAZY;
#endif
}
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev,
+ struct mm_struct *next,
+ struct task_struct *tsk)
{
+ int cpu = smp_processor_id();
+
if (likely(prev != next)) {
/* stop flush ipis for the previous mm */
clear_bit(cpu, &prev->cpu_vm_mask);
@@ -62,6 +67,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, str
asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
#define activate_mm(prev, next) \
- switch_mm((prev),(next),NULL,smp_processor_id())
+ switch_mm((prev),(next),NULL)
#endif
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index b6138f07c309..d5da17912a8c 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -32,8 +32,7 @@ extern struct pglist_data *node_data[];
#define alloc_bootmem_low_pages_node(ignore, x) \
__alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
-#define node_size(nid) (node_data[nid]->node_size)
-#define node_localnr(pfn, nid) ((pfn) - node_data[nid]->node_start_pfn)
+#define node_localnr(pfn, nid) ((pfn) - node_data[nid]->node_start_pfn)
/*
* Following are macros that each numa implmentation must define.
@@ -54,7 +53,7 @@ extern struct pglist_data *node_data[];
#define node_end_pfn(nid) \
({ \
pg_data_t *__pgdat = NODE_DATA(nid); \
- __pgdat->node_start_pfn + __pgdat->node_size; \
+ __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \
})
#define local_mapnr(kvaddr) \
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index 005ce2e61748..cfcfb5b7a128 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -21,8 +21,21 @@ struct timer_opts{
#define TICK_SIZE (tick_nsec / 1000)
extern struct timer_opts* select_timer(void);
+extern void clock_fallback(void);
/* Modifiers for buggy PIT handling */
extern int pit_latch_buggy;
+
+extern struct timer_opts *cur_timer;
+extern int timer_ack;
+
+/* list of externed timers */
+extern struct timer_opts timer_none;
+extern struct timer_opts timer_pit;
+extern struct timer_opts timer_tsc;
+#ifdef CONFIG_X86_CYCLONE_TIMER
+extern struct timer_opts timer_cyclone;
+#endif
+
#endif
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index b1bdc016eed5..f39e505e3eb4 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -275,8 +275,9 @@
#define __NR_clock_nanosleep (__NR_timer_create+8)
#define __NR_statfs64 268
#define __NR_fstatfs64 269
+#define __NR_tgkill 270
-#define NR_syscalls 270
+#define NR_syscalls 271
/* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
diff --git a/include/asm-ia64/div64.h b/include/asm-ia64/div64.h
index 08c03f672041..6cd978cefb28 100644
--- a/include/asm-ia64/div64.h
+++ b/include/asm-ia64/div64.h
@@ -1,20 +1 @@
-#ifndef _ASM_IA64_DIV64_H
-#define _ASM_IA64_DIV64_H
-
-/*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * vsprintf uses this to divide a 64-bit integer N by a small integer BASE.
- * This is incredibly hard on IA-64...
- */
-
-#define do_div(n,base) \
-({ \
- int _res; \
- _res = ((unsigned long) (n)) % (unsigned) (base); \
- (n) = ((unsigned long) (n)) / (unsigned) (base); \
- _res; \
-})
-
-#endif /* _ASM_IA64_DIV64_H */
+#include <asm-generic/div64.h>
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h
index a614a1dbbb61..dee1cd007f5a 100644
--- a/include/asm-ia64/mmu_context.h
+++ b/include/asm-ia64/mmu_context.h
@@ -71,7 +71,7 @@ DECLARE_PER_CPU(u8, ia64_need_tlb_flush);
extern void wrap_mmu_context (struct mm_struct *mm);
static inline void
-enter_lazy_tlb (struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb (struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -198,7 +198,7 @@ activate_mm (struct mm_struct *prev, struct mm_struct *next)
activate_context(next);
}
-#define switch_mm(prev_mm,next_mm,next_task,cpu) activate_mm(prev_mm, next_mm)
+#define switch_mm(prev_mm,next_mm,next_task) activate_mm(prev_mm, next_mm)
# endif /* ! __ASSEMBLY__ */
#endif /* _ASM_IA64_MMU_CONTEXT_H */
diff --git a/include/asm-m68k/div64.h b/include/asm-m68k/div64.h
index 16bf1f88d40c..9f65de1a2480 100644
--- a/include/asm-m68k/div64.h
+++ b/include/asm-m68k/div64.h
@@ -3,7 +3,6 @@
/* n = n / base; return rem; */
-#if 1
#define do_div(n, base) ({ \
union { \
unsigned long n32[2]; \
@@ -23,13 +22,5 @@
(n) = __n.n64; \
__rem; \
})
-#else
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; \
-})
-#endif
#endif /* _M68K_DIV64_H */
diff --git a/include/asm-m68k/mmu_context.h b/include/asm-m68k/mmu_context.h
index 04cfa101eb70..4983fb7b6a0c 100644
--- a/include/asm-m68k/mmu_context.h
+++ b/include/asm-m68k/mmu_context.h
@@ -3,7 +3,7 @@
#include <linux/config.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -79,7 +79,7 @@ extern inline void switch_mm_0460(struct mm_struct *mm)
asm volatile (".chip 68k");
}
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
if (prev != next) {
if (CPU_IS_020_OR_030)
@@ -137,7 +137,7 @@ static inline void activate_context(struct mm_struct *mm)
sun3_put_context(mm->context);
}
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
activate_context(tsk->mm);
}
diff --git a/include/asm-m68knommu/div64.h b/include/asm-m68knommu/div64.h
index b41200162d8b..6cd978cefb28 100644
--- a/include/asm-m68knommu/div64.h
+++ b/include/asm-m68knommu/div64.h
@@ -1,13 +1 @@
-#ifndef _M68KNOMMU_DIV64_H
-#define _M68KNOMMU_DIV64_H
-
-/* n = n / base; return rem; */
-
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; \
-})
-
-#endif /* _M68K_DIV64_H */
+#include <asm-generic/div64.h>
diff --git a/include/asm-m68knommu/flat.h b/include/asm-m68knommu/flat.h
index fe805aaa33df..73712f276cc0 100644
--- a/include/asm-m68knommu/flat.h
+++ b/include/asm-m68knommu/flat.h
@@ -5,6 +5,12 @@
#ifndef __M68KNOMMU_FLAT_H__
#define __M68KNOMMU_FLAT_H__
-#define flat_argvp_envp_on_stack() 1
+#define flat_stack_align(sp) /* nothing needed */
+#define flat_argvp_envp_on_stack() 1
+#define flat_old_ram_flag(flags) (flags)
+#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
+#define flat_get_addr_from_rp(rp, relval) get_unaligned(rp)
+#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
+#define flat_get_relocate_addr(rel) (rel)
#endif /* __M68KNOMMU_FLAT_H__ */
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
index d0dbd4c796c4..f42645e4a2d2 100644
--- a/include/asm-m68knommu/io.h
+++ b/include/asm-m68knommu/io.h
@@ -43,6 +43,13 @@ static inline unsigned int _swapl(volatile unsigned long v)
#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
static inline void io_outsb(unsigned int addr, void *buf, int len)
{
volatile unsigned char *ap = (volatile unsigned char *) addr;
@@ -100,7 +107,7 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
-#define inb(addr) readb(addr)
+#define inb(addr) readb(addr)
#define inw(addr) readw(addr)
#define inl(addr) readl(addr)
#define outb(x,addr) ((void) writeb(x,addr))
diff --git a/include/asm-m68knommu/mmu_context.h b/include/asm-m68knommu/mmu_context.h
index a4286176513c..9bc0fd49b8aa 100644
--- a/include/asm-m68knommu/mmu_context.h
+++ b/include/asm-m68knommu/mmu_context.h
@@ -6,7 +6,7 @@
#include <asm/page.h>
#include <asm/pgalloc.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -19,7 +19,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
#define destroy_context(mm) do { } while(0)
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
}
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
index 7defa6391f0b..0d063a97f1c7 100644
--- a/include/asm-m68knommu/page.h
+++ b/include/asm-m68knommu/page.h
@@ -6,7 +6,7 @@
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT (12)
-#define PAGE_SIZE (4096)
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__
diff --git a/include/asm-m68knommu/semaphore.h b/include/asm-m68knommu/semaphore.h
index f6cfb9f49001..4720a09e6191 100644
--- a/include/asm-m68knommu/semaphore.h
+++ b/include/asm-m68knommu/semaphore.h
@@ -145,7 +145,7 @@ extern inline int down_trylock(struct semaphore * sem)
".previous"
: "=d" (result)
: "a" (sem1)
- : "%d0", "memory");
+ : "memory");
return result;
}
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 6ff1747b02e0..9f890ed45b4f 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -13,21 +13,14 @@
#define VERIFY_READ 0
#define VERIFY_WRITE 1
-/* We let the MMU do all checking */
-extern inline int access_ok(int type, const void * addr, unsigned long size)
+#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size))
+
+static inline int _access_ok(unsigned long addr, unsigned long size)
{
-#define RANGE_CHECK_OK(addr, size, lower, upper) \
- (((addr) >= (lower)) && (((addr) + (size)) < (upper)))
-
-#ifdef CONFIG_COLDFIRE
- extern unsigned long _ramend;
- return(RANGE_CHECK_OK((unsigned long) addr, size, 0L, _ramend) ||
- (is_in_rom((unsigned long) addr) &&
- is_in_rom((unsigned long) addr + size)));
-#else
- /* DAVIDM - this could be restricted a lot more */
- return(RANGE_CHECK_OK((unsigned long)addr, size, 0, 0x10f00000));
-#endif
+ extern unsigned long memory_start, memory_end;
+
+ return (((addr >= memory_start) && (addr+size < memory_end)) ||
+ (is_in_rom(addr) && is_in_rom(addr+size)));
}
extern inline int verify_area(int type, const void * addr, unsigned long size)
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index cf19cd768f95..8d2153f323ef 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -49,7 +49,7 @@ extern unsigned long pgd_current[];
#define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK)
#define asid_cache(cpu) (cpu_data[cpu].asid_cache)
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -92,9 +92,10 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
unsigned long flags;
+ unsigned cpu = smp_processor_id();
local_irq_save(flags);
diff --git a/include/asm-mips64/div64.h b/include/asm-mips64/div64.h
index 3ec1fadcfd7e..1147123d4d82 100644
--- a/include/asm-mips64/div64.h
+++ b/include/asm-mips64/div64.h
@@ -27,23 +27,6 @@
(res) = __quot; \
__mod; })
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n, base) ({ \
- unsigned long __quot; \
- unsigned int __mod; \
- unsigned long __div; \
- unsigned int __base; \
- \
- __div = (n); \
- __base = (base); \
- \
- __mod = __div % __base; \
- __quot = __div / __base; \
- \
- (n) = __quot; \
- __mod; })
+#include <asm-generic.h>
#endif /* _ASM_DIV64_H */
diff --git a/include/asm-mips64/mmu_context.h b/include/asm-mips64/mmu_context.h
index 107e2459ccd0..b7ca8c085452 100644
--- a/include/asm-mips64/mmu_context.h
+++ b/include/asm-mips64/mmu_context.h
@@ -40,7 +40,7 @@ extern unsigned long pgd_current[];
#define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK)
#define asid_cache(cpu) (cpu_data[cpu].asid_cache)
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
diff --git a/include/asm-mips64/mmzone.h b/include/asm-mips64/mmzone.h
index 25a42752b182..cba337b07be1 100644
--- a/include/asm-mips64/mmzone.h
+++ b/include/asm-mips64/mmzone.h
@@ -24,7 +24,7 @@ extern plat_pg_data_t *plat_node_data[];
#define PHYSADDR_TO_NID(pa) NASID_TO_COMPACT_NODEID(NASID_GET(pa))
#define PLAT_NODE_DATA(n) (plat_node_data[n])
-#define PLAT_NODE_DATA_SIZE(n) (PLAT_NODE_DATA(n)->gendata.node_size)
+#define PLAT_NODE_DATA_SIZE(n) (PLAT_NODE_DATA(n)->gendata.node_spanned_pages)
#define PLAT_NODE_DATA_LOCALNR(p, n) \
(((p) >> PAGE_SHIFT) - PLAT_NODE_DATA(n)->gendata.node_start_pfn)
diff --git a/include/asm-parisc/div64.h b/include/asm-parisc/div64.h
index e86e35e8a272..6cd978cefb28 100644
--- a/include/asm-parisc/div64.h
+++ b/include/asm-parisc/div64.h
@@ -1,54 +1 @@
-#ifndef __ASM_PARISC_DIV64
-#define __ASM_PARISC_DIV64
-
-#ifdef __LP64__
-
-/*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * vsprintf uses this to divide a 64-bit integer N by a small integer BASE.
- * This is incredibly hard on IA-64 and HPPA
- */
-
-#define do_div(n,base) \
-({ \
- int _res; \
- _res = ((unsigned long) (n)) % (unsigned) (base); \
- (n) = ((unsigned long) (n)) / (unsigned) (base); \
- _res; \
-})
-
-#else
-/*
- * unsigned long long division. Yuck Yuck! What is Linux coming to?
- * This is 100% disgusting
- */
-#define do_div(n,base) \
-({ \
- unsigned long __low, __low2, __high, __rem; \
- __low = (n) & 0xffffffff; \
- __high = (n) >> 32; \
- if (__high) { \
- __rem = __high % (unsigned long)base; \
- __high = __high / (unsigned long)base; \
- __low2 = __low >> 16; \
- __low2 += __rem << 16; \
- __rem = __low2 % (unsigned long)base; \
- __low2 = __low2 / (unsigned long)base; \
- __low = __low & 0xffff; \
- __low += __rem << 16; \
- __rem = __low % (unsigned long)base; \
- __low = __low / (unsigned long)base; \
- n = __low + ((long long)__low2 << 16) + \
- ((long long) __high << 32); \
- } else { \
- __rem = __low % (unsigned long)base; \
- n = (__low / (unsigned long)base); \
- } \
- __rem; \
-})
-#endif
-
-#endif
-
+#include <asm-generic/div64.h>
diff --git a/include/asm-parisc/mmu_context.h b/include/asm-parisc/mmu_context.h
index 1ff9e5f0582c..6327156282f2 100644
--- a/include/asm-parisc/mmu_context.h
+++ b/include/asm-parisc/mmu_context.h
@@ -6,7 +6,7 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -43,7 +43,7 @@ static inline void load_context(mm_context_t context)
#endif
}
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
if (prev != next) {
@@ -69,6 +69,6 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
if (next->context == 0)
next->context = alloc_sid();
- switch_mm(prev,next,current,0);
+ switch_mm(prev,next,current);
}
#endif
diff --git a/include/asm-ppc/div64.h b/include/asm-ppc/div64.h
index ec3ae5bcb3de..6cd978cefb28 100644
--- a/include/asm-ppc/div64.h
+++ b/include/asm-ppc/div64.h
@@ -1,23 +1 @@
-#ifndef __PPC_DIV64
-#define __PPC_DIV64
-
-#include <linux/types.h>
-
-extern u32 __div64_32(u64 *dividend, u32 div);
-
-#define do_div(n, div) ({ \
- u64 __n = (n); \
- u32 __d = (div); \
- u32 __q, __r; \
- if ((__n >> 32) == 0) { \
- __q = (u32)__n / __d; \
- __r = (u32)__n - __q * __d; \
- (n) = __q; \
- } else { \
- __r = __div64_32(&__n, __d); \
- (n) = __n; \
- } \
- __r; \
-})
-
-#endif
+#include <asm-generic/div64.h>
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 131269863309..1e8176b2d122 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -48,7 +48,7 @@
-- Dan
*/
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -153,7 +153,7 @@ static inline void destroy_context(struct mm_struct *mm)
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, int cpu)
+ struct task_struct *tsk)
{
tsk->thread.pgdir = next->pgd;
get_mmu_context(next);
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index 887fa5302a9f..5d121448d3c1 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -25,11 +25,9 @@
#elif defined(CONFIG_PRPMC800)
#include <platforms/prpmc800_serial.h>
#elif defined(CONFIG_SANDPOINT)
-#include <platforms/sandpoint_serial.h>
+#include <platforms/sandpoint.h>
#elif defined(CONFIG_SPRUCE)
#include <platforms/spruce_serial.h>
-#elif defined(CONFIG_ZX4500)
-#include <platforms/zx4500_serial.h>
#elif defined(CONFIG_40x)
#include <asm/ibm4xx.h>
#else
diff --git a/include/asm-ppc64/div64.h b/include/asm-ppc64/div64.h
index 22ba87033456..6cd978cefb28 100644
--- a/include/asm-ppc64/div64.h
+++ b/include/asm-ppc64/div64.h
@@ -1,18 +1 @@
-#ifndef __PPC_DIV64
-#define __PPC_DIV64
-
-/* Copyright 2001 PPC64 Team, IBM Corp
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) (n)) % (unsigned) (base); \
- (n) = ((unsigned long) (n)) / (unsigned) (base); \
- __res; })
-
-#endif
+#include <asm-generic/div64.h>
diff --git a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h
index 1014f086e5e7..a84ee5812e9f 100644
--- a/include/asm-ppc64/mmu_context.h
+++ b/include/asm-ppc64/mmu_context.h
@@ -56,7 +56,7 @@ struct mmu_context_queue_t {
extern struct mmu_context_queue_t mmu_context_queue;
static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -140,10 +140,10 @@ extern void flush_stab(struct task_struct *tsk, struct mm_struct *mm);
*/
static inline void
switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, int cpu)
+ struct task_struct *tsk)
{
flush_stab(tsk, next);
- set_bit(cpu, &next->cpu_vm_mask);
+ set_bit(smp_processor_id(), &next->cpu_vm_mask);
}
#define deactivate_mm(tsk,mm) do { } while (0)
@@ -153,7 +153,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
* the context for the new mm so we see the new mappings.
*/
#define activate_mm(active_mm, mm) \
- switch_mm(active_mm, mm, current, smp_processor_id());
+ switch_mm(active_mm, mm, current);
#define VSID_RANDOMIZER 42470972311
#define VSID_MASK 0xfffffffff
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h
index 8503e25b17b3..2e5136012845 100644
--- a/include/asm-ppc64/mmzone.h
+++ b/include/asm-ppc64/mmzone.h
@@ -54,7 +54,6 @@ static inline int pa_to_nid(unsigned long pa)
*/
#define NODE_DATA(nid) (&node_data[nid])
-#define node_size(nid) (NODE_DATA(nid)->node_size)
#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
/*
diff --git a/include/asm-s390/div64.h b/include/asm-s390/div64.h
index 79b5f06fa174..0c5f739832f1 100644
--- a/include/asm-s390/div64.h
+++ b/include/asm-s390/div64.h
@@ -43,13 +43,7 @@
})
#else /* __s390x__ */
-
-#define do_div(n,base) ({ \
-int __res; \
-__res = ((unsigned long) n) % (unsigned) base; \
-n = ((unsigned long) n) / (unsigned) base; \
-__res; })
-
+#include <asm-generic/div64.h>
#endif /* __s390x__ */
#endif
diff --git a/include/asm-s390/mmu_context.h b/include/asm-s390/mmu_context.h
index 87be0aab7028..0e63fd521893 100644
--- a/include/asm-s390/mmu_context.h
+++ b/include/asm-s390/mmu_context.h
@@ -17,12 +17,12 @@
#define destroy_context(mm) flush_tlb_mm(mm)
static inline void enter_lazy_tlb(struct mm_struct *mm,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
unsigned long pgd;
@@ -42,7 +42,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
: : "m" (pgd) );
#endif /* __s390x__ */
}
- set_bit(cpu, &next->cpu_vm_mask);
+ set_bit(smp_processor_id(), &next->cpu_vm_mask);
}
#define deactivate_mm(tsk,mm) do { } while (0)
@@ -50,7 +50,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
extern inline void activate_mm(struct mm_struct *prev,
struct mm_struct *next)
{
- switch_mm(prev, next, current, smp_processor_id());
+ switch_mm(prev, next, current);
}
#endif
diff --git a/include/asm-sh/div64.h b/include/asm-sh/div64.h
index dd4665af4fb8..6cd978cefb28 100644
--- a/include/asm-sh/div64.h
+++ b/include/asm-sh/div64.h
@@ -1,20 +1 @@
-#ifndef __ASM_SH_DIV64
-#define __ASM_SH_DIV64
-
-extern u64 __div64_32(u64 n, u32 d);
-
-#define do_div(n,base) ({ \
-u64 __n = (n), __q; \
-u32 __base = (base); \
-u32 __res; \
-if ((__n >> 32) == 0) { \
- __res = ((unsigned long) __n) % (unsigned) __base; \
- (n) = ((unsigned long) __n) / (unsigned) __base; \
-} else { \
- __q = __div64_32(__n, __base); \
- __res = __n - __q * __base; \
- (n) = __q; \
-} \
-__res; })
-
-#endif /* __ASM_SH_DIV64 */
+#include <asm-generic/div64.h>
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h
index 17775400498b..c956ddea556b 100644
--- a/include/asm-sh/mmu_context.h
+++ b/include/asm-sh/mmu_context.h
@@ -129,7 +129,7 @@ static __inline__ void activate_context(struct mm_struct *mm)
(Currently not used) */
static __inline__ void switch_mm(struct mm_struct *prev,
struct mm_struct *next,
- struct task_struct *tsk, unsigned int cpu)
+ struct task_struct *tsk)
{
if (likely(prev != next)) {
unsigned long __pgdir = (unsigned long)next->pgd;
@@ -144,10 +144,10 @@ static __inline__ void switch_mm(struct mm_struct *prev,
#define deactivate_mm(tsk,mm) do { } while (0)
#define activate_mm(prev, next) \
- switch_mm((prev),(next),NULL,smp_processor_id())
+ switch_mm((prev),(next),NULL)
static __inline__ void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
#else /* !CONFIG_MMU */
@@ -157,10 +157,10 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
#define set_asid(asid) do { } while (0)
#define get_asid() (0)
#define activate_context(mm) do { } while (0)
-#define switch_mm(prev,next,tsk,cpu) do { } while (0)
+#define switch_mm(prev,next,tsk) do { } while (0)
#define deactivate_mm(tsk,mm) do { } while (0)
#define activate_mm(prev,next) do { } while (0)
-#define enter_lazy_tlb(mm,tsk,cpu) do { } while (0)
+#define enter_lazy_tlb(mm,tsk) do { } while (0)
#endif /* CONFIG_MMU */
#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
diff --git a/include/asm-sparc/div64.h b/include/asm-sparc/div64.h
index 167260a9c953..6cd978cefb28 100644
--- a/include/asm-sparc/div64.h
+++ b/include/asm-sparc/div64.h
@@ -1,11 +1 @@
-#ifndef __SPARC_DIV64
-#define __SPARC_DIV64
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; })
-
-#endif /* __SPARC_DIV64 */
+#include <asm-generic/div64.h>
diff --git a/include/asm-sparc/mmu_context.h b/include/asm-sparc/mmu_context.h
index f386a8f4bbe8..ed1e01d04d21 100644
--- a/include/asm-sparc/mmu_context.h
+++ b/include/asm-sparc/mmu_context.h
@@ -5,7 +5,7 @@
#ifndef __ASSEMBLY__
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -26,14 +26,14 @@ BTFIXUPDEF_CALL(void, destroy_context, struct mm_struct *)
#define destroy_context(mm) BTFIXUP_CALL(destroy_context)(mm)
/* Switch the current MM context. */
-BTFIXUPDEF_CALL(void, switch_mm, struct mm_struct *, struct mm_struct *, struct task_struct *, int)
+BTFIXUPDEF_CALL(void, switch_mm, struct mm_struct *, struct mm_struct *, struct task_struct *)
-#define switch_mm(old_mm, mm, tsk, cpu) BTFIXUP_CALL(switch_mm)(old_mm, mm, tsk, cpu)
+#define switch_mm(old_mm, mm, tsk) BTFIXUP_CALL(switch_mm)(old_mm, mm, tsk)
#define deactivate_mm(tsk,mm) do { } while (0)
/* Activate a new MM instance for the current task. */
-#define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL, smp_processor_id())
+#define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL)
#endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc64/div64.h b/include/asm-sparc64/div64.h
index a36d2443d209..6cd978cefb28 100644
--- a/include/asm-sparc64/div64.h
+++ b/include/asm-sparc64/div64.h
@@ -1,14 +1 @@
-#ifndef __SPARC64_DIV64
-#define __SPARC64_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; })
-
-#endif /* __SPARC64_DIV64 */
+#include <asm-generic/div64.h>
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index 44a4e97f4793..97e43a160b3b 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -11,15 +11,9 @@
#include <linux/spinlock.h>
#include <linux/cache.h>
-/* entry.S is sensitive to the offsets of these fields */
-/* rtrap.S is sensitive to the size of this structure */
+/* rtrap.S is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
- unsigned int __unused_1;
- unsigned int __unused_2;
- unsigned int __unused_3;
- unsigned int __syscall_count;
- struct task_struct * __ksoftirqd_task;
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h
index ab9eedf22860..292757aa3176 100644
--- a/include/asm-sparc64/mmu_context.h
+++ b/include/asm-sparc64/mmu_context.h
@@ -27,7 +27,7 @@
#include <asm/system.h>
#include <asm/spitfire.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
@@ -106,7 +106,7 @@ do { \
extern void __flush_tlb_mm(unsigned long, unsigned long);
/* Switch the current MM context. */
-static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk, int cpu)
+static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
{
unsigned long ctx_valid;
@@ -125,7 +125,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
}
{
- unsigned long vm_mask = (1UL << cpu);
+ unsigned long vm_mask = (1UL << smp_processor_id());
/* Even if (mm == old_mm) we _must_ check
* the cpu_vm_mask. If we do not we could
diff --git a/include/asm-sparc64/xor.h b/include/asm-sparc64/xor.h
index 9ecc98f667d0..8b3a7e4b6062 100644
--- a/include/asm-sparc64/xor.h
+++ b/include/asm-sparc64/xor.h
@@ -16,15 +16,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- * Requirements:
- * !(((long)dest | (long)sourceN) & (64 - 1)) &&
- * !(len & 127) && len >= 256
- *
- * It is done in pure assembly, as otherwise gcc makes it a non-leaf
- * function, which is not what we want.
- */
-
#include <asm/pstate.h>
#include <asm/asi.h>
@@ -36,356 +27,7 @@ extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
unsigned long *, unsigned long *, unsigned long *);
-#define _S(x) __S(x)
-#define __S(x) #x
-#define DEF(x) __asm__(#x " = " _S(x))
-
-DEF(FPRS_FEF);
-DEF(FPRS_DU);
-DEF(ASI_BLK_P);
-
-/* ??? We set and use %asi instead of using ASI_BLK_P directly because gas
- currently does not accept symbolic constants for the ASI specifier. */
-
-__asm__ ("
- .text
- .globl xor_vis_2
- .type xor_vis_2,@function
-xor_vis_2:
- rd %fprs, %o5
- andcc %o5, FPRS_FEF|FPRS_DU, %g0
- be,pt %icc, 0f
- sethi %hi(VISenter), %g1
- jmpl %g1 + %lo(VISenter), %g7
- add %g7, 8, %g7
-0: wr %g0, FPRS_FEF, %fprs
- rd %asi, %g1
- wr %g0, ASI_BLK_P, %asi
- membar #LoadStore|#StoreLoad|#StoreStore
- sub %o0, 128, %o0
- ldda [%o1] %asi, %f0
- ldda [%o2] %asi, %f16
-
-2: ldda [%o1 + 64] %asi, %f32
- fxor %f0, %f16, %f16
- fxor %f2, %f18, %f18
- fxor %f4, %f20, %f20
- fxor %f6, %f22, %f22
- fxor %f8, %f24, %f24
- fxor %f10, %f26, %f26
- fxor %f12, %f28, %f28
- fxor %f14, %f30, %f30
- stda %f16, [%o1] %asi
- ldda [%o2 + 64] %asi, %f48
- ldda [%o1 + 128] %asi, %f0
- fxor %f32, %f48, %f48
- fxor %f34, %f50, %f50
- add %o1, 128, %o1
- fxor %f36, %f52, %f52
- add %o2, 128, %o2
- fxor %f38, %f54, %f54
- subcc %o0, 128, %o0
- fxor %f40, %f56, %f56
- fxor %f42, %f58, %f58
- fxor %f44, %f60, %f60
- fxor %f46, %f62, %f62
- stda %f48, [%o1 - 64] %asi
- bne,pt %xcc, 2b
- ldda [%o2] %asi, %f16
-
- ldda [%o1 + 64] %asi, %f32
- fxor %f0, %f16, %f16
- fxor %f2, %f18, %f18
- fxor %f4, %f20, %f20
- fxor %f6, %f22, %f22
- fxor %f8, %f24, %f24
- fxor %f10, %f26, %f26
- fxor %f12, %f28, %f28
- fxor %f14, %f30, %f30
- stda %f16, [%o1] %asi
- ldda [%o2 + 64] %asi, %f48
- membar #Sync
- fxor %f32, %f48, %f48
- fxor %f34, %f50, %f50
- fxor %f36, %f52, %f52
- fxor %f38, %f54, %f54
- fxor %f40, %f56, %f56
- fxor %f42, %f58, %f58
- fxor %f44, %f60, %f60
- fxor %f46, %f62, %f62
- stda %f48, [%o1 + 64] %asi
- membar #Sync|#StoreStore|#StoreLoad
- wr %g1, %g0, %asi
- retl
- wr %g0, 0, %fprs
- .size xor_vis_2, .-xor_vis_2
-
-
- .globl xor_vis_3
- .type xor_vis_3,@function
-xor_vis_3:
- rd %fprs, %o5
- andcc %o5, FPRS_FEF|FPRS_DU, %g0
- be,pt %icc, 0f
- sethi %hi(VISenter), %g1
- jmpl %g1 + %lo(VISenter), %g7
- add %g7, 8, %g7
-0: wr %g0, FPRS_FEF, %fprs
- rd %asi, %g1
- wr %g0, ASI_BLK_P, %asi
- membar #LoadStore|#StoreLoad|#StoreStore
- sub %o0, 64, %o0
- ldda [%o1] %asi, %f0
- ldda [%o2] %asi, %f16
-
-3: ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f48
- fxor %f2, %f18, %f50
- add %o1, 64, %o1
- fxor %f4, %f20, %f52
- fxor %f6, %f22, %f54
- add %o2, 64, %o2
- fxor %f8, %f24, %f56
- fxor %f10, %f26, %f58
- fxor %f12, %f28, %f60
- fxor %f14, %f30, %f62
- ldda [%o1] %asi, %f0
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- add %o3, 64, %o3
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- subcc %o0, 64, %o0
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- stda %f48, [%o1 - 64] %asi
- bne,pt %xcc, 3b
- ldda [%o2] %asi, %f16
-
- ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f48
- fxor %f2, %f18, %f50
- fxor %f4, %f20, %f52
- fxor %f6, %f22, %f54
- fxor %f8, %f24, %f56
- fxor %f10, %f26, %f58
- fxor %f12, %f28, %f60
- fxor %f14, %f30, %f62
- membar #Sync
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- stda %f48, [%o1] %asi
- membar #Sync|#StoreStore|#StoreLoad
- wr %g1, %g0, %asi
- retl
- wr %g0, 0, %fprs
- .size xor_vis_3, .-xor_vis_3
-
-
- .globl xor_vis_4
- .type xor_vis_4,@function
-xor_vis_4:
- rd %fprs, %o5
- andcc %o5, FPRS_FEF|FPRS_DU, %g0
- be,pt %icc, 0f
- sethi %hi(VISenter), %g1
- jmpl %g1 + %lo(VISenter), %g7
- add %g7, 8, %g7
-0: wr %g0, FPRS_FEF, %fprs
- rd %asi, %g1
- wr %g0, ASI_BLK_P, %asi
- membar #LoadStore|#StoreLoad|#StoreStore
- sub %o0, 64, %o0
- ldda [%o1] %asi, %f0
- ldda [%o2] %asi, %f16
-
-4: ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f16
- fxor %f2, %f18, %f18
- add %o1, 64, %o1
- fxor %f4, %f20, %f20
- fxor %f6, %f22, %f22
- add %o2, 64, %o2
- fxor %f8, %f24, %f24
- fxor %f10, %f26, %f26
- fxor %f12, %f28, %f28
- fxor %f14, %f30, %f30
- ldda [%o4] %asi, %f48
- fxor %f16, %f32, %f32
- fxor %f18, %f34, %f34
- fxor %f20, %f36, %f36
- fxor %f22, %f38, %f38
- add %o3, 64, %o3
- fxor %f24, %f40, %f40
- fxor %f26, %f42, %f42
- fxor %f28, %f44, %f44
- fxor %f30, %f46, %f46
- ldda [%o1] %asi, %f0
- fxor %f32, %f48, %f48
- fxor %f34, %f50, %f50
- fxor %f36, %f52, %f52
- add %o4, 64, %o4
- fxor %f38, %f54, %f54
- fxor %f40, %f56, %f56
- fxor %f42, %f58, %f58
- subcc %o0, 64, %o0
- fxor %f44, %f60, %f60
- fxor %f46, %f62, %f62
- stda %f48, [%o1 - 64] %asi
- bne,pt %xcc, 4b
- ldda [%o2] %asi, %f16
-
- ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f16
- fxor %f2, %f18, %f18
- fxor %f4, %f20, %f20
- fxor %f6, %f22, %f22
- fxor %f8, %f24, %f24
- fxor %f10, %f26, %f26
- fxor %f12, %f28, %f28
- fxor %f14, %f30, %f30
- ldda [%o4] %asi, %f48
- fxor %f16, %f32, %f32
- fxor %f18, %f34, %f34
- fxor %f20, %f36, %f36
- fxor %f22, %f38, %f38
- fxor %f24, %f40, %f40
- fxor %f26, %f42, %f42
- fxor %f28, %f44, %f44
- fxor %f30, %f46, %f46
- membar #Sync
- fxor %f32, %f48, %f48
- fxor %f34, %f50, %f50
- fxor %f36, %f52, %f52
- fxor %f38, %f54, %f54
- fxor %f40, %f56, %f56
- fxor %f42, %f58, %f58
- fxor %f44, %f60, %f60
- fxor %f46, %f62, %f62
- stda %f48, [%o1] %asi
- membar #Sync|#StoreStore|#StoreLoad
- wr %g1, %g0, %asi
- retl
- wr %g0, 0, %fprs
- .size xor_vis_4, .-xor_vis_4
-
-
- .globl xor_vis_5
- .type xor_vis_5,@function
-xor_vis_5:
- mov %o5, %g5
- rd %fprs, %o5
- andcc %o5, FPRS_FEF|FPRS_DU, %g0
- be,pt %icc, 0f
- sethi %hi(VISenter), %g1
- jmpl %g1 + %lo(VISenter), %g7
- add %g7, 8, %g7
-0: wr %g0, FPRS_FEF, %fprs
- mov %g5, %o5
- rd %asi, %g1
- wr %g0, ASI_BLK_P, %asi
- membar #LoadStore|#StoreLoad|#StoreStore
- sub %o0, 64, %o0
- ldda [%o1] %asi, %f0
- ldda [%o2] %asi, %f16
-
-5: ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f48
- fxor %f2, %f18, %f50
- add %o1, 64, %o1
- fxor %f4, %f20, %f52
- fxor %f6, %f22, %f54
- add %o2, 64, %o2
- fxor %f8, %f24, %f56
- fxor %f10, %f26, %f58
- fxor %f12, %f28, %f60
- fxor %f14, %f30, %f62
- ldda [%o4] %asi, %f16
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- add %o3, 64, %o3
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- ldda [%o5] %asi, %f32
- fxor %f48, %f16, %f48
- fxor %f50, %f18, %f50
- add %o4, 64, %o4
- fxor %f52, %f20, %f52
- fxor %f54, %f22, %f54
- add %o5, 64, %o5
- fxor %f56, %f24, %f56
- fxor %f58, %f26, %f58
- fxor %f60, %f28, %f60
- fxor %f62, %f30, %f62
- ldda [%o1] %asi, %f0
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- subcc %o0, 64, %o0
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- stda %f48, [%o1 - 64] %asi
- bne,pt %xcc, 5b
- ldda [%o2] %asi, %f16
-
- ldda [%o3] %asi, %f32
- fxor %f0, %f16, %f48
- fxor %f2, %f18, %f50
- fxor %f4, %f20, %f52
- fxor %f6, %f22, %f54
- fxor %f8, %f24, %f56
- fxor %f10, %f26, %f58
- fxor %f12, %f28, %f60
- fxor %f14, %f30, %f62
- ldda [%o4] %asi, %f16
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- ldda [%o5] %asi, %f32
- fxor %f48, %f16, %f48
- fxor %f50, %f18, %f50
- fxor %f52, %f20, %f52
- fxor %f54, %f22, %f54
- fxor %f56, %f24, %f56
- fxor %f58, %f26, %f58
- fxor %f60, %f28, %f60
- fxor %f62, %f30, %f62
- membar #Sync
- fxor %f48, %f32, %f48
- fxor %f50, %f34, %f50
- fxor %f52, %f36, %f52
- fxor %f54, %f38, %f54
- fxor %f56, %f40, %f56
- fxor %f58, %f42, %f58
- fxor %f60, %f44, %f60
- fxor %f62, %f46, %f62
- stda %f48, [%o1] %asi
- membar #Sync|#StoreStore|#StoreLoad
- wr %g1, %g0, %asi
- retl
- wr %g0, 0, %fprs
- .size xor_vis_5, .-xor_vis_5
-");
+/* XXX Ugh, write cheetah versions... -DaveM */
static struct xor_block_template xor_block_VIS = {
.name = "VIS",
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 14ca8b2a4628..4ddffc1a7832 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -21,8 +21,10 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
extern void switch_mm_skas(int mm_fd);
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
+ unsigned cpu = smp_processor_id();
+
if(prev != next){
clear_bit(cpu, &prev->cpu_vm_mask);
set_bit(cpu, &next->cpu_vm_mask);
@@ -33,7 +35,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
}
static inline void enter_lazy_tlb(struct mm_struct *mm,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
}
diff --git a/include/asm-v850/div64.h b/include/asm-v850/div64.h
index 165518b4623c..6cd978cefb28 100644
--- a/include/asm-v850/div64.h
+++ b/include/asm-v850/div64.h
@@ -1,11 +1 @@
-#ifndef __V850_DIV64_H__
-#define __V850_DIV64_H__
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) n) % (unsigned) base; \
- n = ((unsigned long) n) / (unsigned) base; \
- __res; })
-
-#endif /* __V850_DIV64_H__ */
+#include <asm-generic/div64.h>
diff --git a/include/asm-v850/flat.h b/include/asm-v850/flat.h
index 94a42a41e843..17106c894ab7 100644
--- a/include/asm-v850/flat.h
+++ b/include/asm-v850/flat.h
@@ -1,8 +1,8 @@
/*
* include/asm-v850/flat.h -- uClinux flat-format executables
*
- * Copyright (C) 2002 NEC Corporation
- * Copyright (C) 2002 Miles Bader <miles@gnu.org>
+ * Copyright (C) 2002,03 NEC Electronics Corporation
+ * Copyright (C) 2002,03 Miles Bader <miles@gnu.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
@@ -14,6 +14,117 @@
#ifndef __V850_FLAT_H__
#define __V850_FLAT_H__
-#define flat_argvp_envp_on_stack() 0
+/* The amount by which a relocation can exceed the program image limits
+ without being regarded as an error. On the v850, the relocations of
+ some base-pointers can be offset by 0x8000 (to allow better usage of the
+ space offered by 16-bit signed offsets -- in most cases the offsets used
+ with such a base-pointer will be negative). */
+
+#define flat_reloc_valid(reloc, size) ((reloc) <= (size + 0x8000))
+
+#define flat_stack_align(sp) /* nothing needed */
+#define flat_argvp_envp_on_stack() 0
+#define flat_old_ram_flag(flags) (flags)
+
+/* We store the type of relocation in the top 4 bits of the `relval.' */
+
+/* Convert a relocation entry into an address. */
+static inline unsigned long
+flat_get_relocate_addr (unsigned long relval)
+{
+ return relval & 0x0fffffff; /* Mask out top 4-bits */
+}
+
+#define flat_v850_get_reloc_type(relval) ((relval) >> 28)
+
+#define FLAT_V850_R_32 0 /* Normal 32-bit reloc */
+#define FLAT_V850_R_HI16S_LO15 1 /* High 16-bits + signed 15-bit low field */
+#define FLAT_V850_R_HI16S_LO16 2 /* High 16-bits + signed 16-bit low field */
+
+/* Extract the address to be relocated from the symbol reference at RP;
+ RELVAL is the raw relocation-table entry from which RP is derived.
+ For the v850, RP should always be half-word aligned. */
+static inline unsigned long flat_get_addr_from_rp (unsigned long *rp,
+ unsigned long relval)
+{
+ short *srp = (short *)rp;
+
+ switch (flat_v850_get_reloc_type (relval))
+ {
+ case FLAT_V850_R_32:
+ /* Simple 32-bit address. */
+ return srp[0] | (srp[1] << 16);
+
+ case FLAT_V850_R_HI16S_LO16:
+ /* The high and low halves of the address are in the 16
+ bits at RP, and the 2nd word of the 32-bit instruction
+ following that, respectively. The low half is _signed_
+ so we have to sign-extend it and add it to the upper
+ half instead of simply or-ing them together.
+
+ Unlike most relocated address, this one is stored in
+ native (little-endian) byte-order to avoid problems with
+ trashing the low-order bit, so we have to convert to
+ network-byte-order before returning, as that's what the
+ caller expects. */
+ return htonl ((srp[0] << 16) + srp[2]);
+
+ case FLAT_V850_R_HI16S_LO15:
+ /* The high and low halves of the address are in the 16
+ bits at RP, and the upper 15 bits of the 2nd word of the
+ 32-bit instruction following that, respectively. The
+ low half is _signed_ so we have to sign-extend it and
+ add it to the upper half instead of simply or-ing them
+ together. The lowest bit is always zero.
+
+ Unlike most relocated address, this one is stored in
+ native (little-endian) byte-order to avoid problems with
+ trashing the low-order bit, so we have to convert to
+ network-byte-order before returning, as that's what the
+ caller expects. */
+ return htonl ((srp[0] << 16) + (srp[2] & ~0x1));
+
+ default:
+ return ~0; /* bogus value */
+ }
+}
+
+/* Insert the address ADDR into the symbol reference at RP;
+ RELVAL is the raw relocation-table entry from which RP is derived.
+ For the v850, RP should always be half-word aligned. */
+static inline void flat_put_addr_at_rp (unsigned long *rp, unsigned long addr,
+ unsigned long relval)
+{
+ short *srp = (short *)rp;
+
+ switch (flat_v850_get_reloc_type (relval)) {
+ case FLAT_V850_R_32:
+ /* Simple 32-bit address. */
+ srp[0] = addr & 0xFFFF;
+ srp[1] = (addr >> 16);
+ break;
+
+ case FLAT_V850_R_HI16S_LO16:
+ /* The high and low halves of the address are in the 16
+ bits at RP, and the 2nd word of the 32-bit instruction
+ following that, respectively. The low half is _signed_
+ so we must carry its sign bit to the upper half before
+ writing the upper half. */
+ srp[0] = (addr >> 16) + ((addr >> 15) & 0x1);
+ srp[2] = addr & 0xFFFF;
+ break;
+
+ case FLAT_V850_R_HI16S_LO15:
+ /* The high and low halves of the address are in the 16
+ bits at RP, and the upper 15 bits of the 2nd word of the
+ 32-bit instruction following that, respectively. The
+ low half is _signed_ so we must carry its sign bit to
+ the upper half before writing the upper half. The
+ lowest bit we preserve from the existing instruction. */
+ srp[0] = (addr >> 16) + ((addr >> 15) & 0x1);
+ srp[2] = (addr & 0xFFFE) | (srp[2] & 0x1);
+ break;
+ }
+}
#endif /* __V850_FLAT_H__ */
diff --git a/include/asm-v850/mmu_context.h b/include/asm-v850/mmu_context.h
index 24301a46a92e..f521c8050d3c 100644
--- a/include/asm-v850/mmu_context.h
+++ b/include/asm-v850/mmu_context.h
@@ -3,9 +3,9 @@
#define destroy_context(mm) ((void)0)
#define init_new_context(tsk,mm) 0
-#define switch_mm(prev,next,tsk,cpu) ((void)0)
+#define switch_mm(prev,next,tsk) ((void)0)
#define deactivate_mm(tsk,mm) do { } while (0)
#define activate_mm(prev,next) ((void)0)
-#define enter_lazy_tlb(mm,tsk,cpu) ((void)0)
+#define enter_lazy_tlb(mm,tsk) ((void)0)
#endif /* __V850_MMU_CONTEXT_H__ */
diff --git a/include/asm-x86_64/div64.h b/include/asm-x86_64/div64.h
index 2c94d0762fe0..6cd978cefb28 100644
--- a/include/asm-x86_64/div64.h
+++ b/include/asm-x86_64/div64.h
@@ -1,14 +1 @@
-#ifndef __X86_64_DIV64
-#define __X86_64_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
- int __res; \
- __res = ((unsigned long) (n)) % (unsigned) (base); \
- (n) = ((unsigned long) (n)) / (unsigned) (base); \
- __res; })
-
-#endif
+#include <asm-generic/div64.h>
diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h
index 41fc9820ee94..8f80f157035e 100644
--- a/include/asm-x86_64/mmu_context.h
+++ b/include/asm-x86_64/mmu_context.h
@@ -17,20 +17,21 @@ void destroy_context(struct mm_struct *mm);
#ifdef CONFIG_SMP
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
if (read_pda(mmu_state) == TLBSTATE_OK)
write_pda(mmu_state, TLBSTATE_LAZY);
}
#else
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
#endif
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- struct task_struct *tsk, unsigned cpu)
+ struct task_struct *tsk)
{
+ unsigned cpu = smp_processor_id();
if (likely(prev != next)) {
/* stop flush ipis for the previous mm */
clear_bit(cpu, &prev->cpu_vm_mask);
@@ -68,7 +69,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
} while(0)
#define activate_mm(prev, next) \
- switch_mm((prev),(next),NULL,smp_processor_id())
+ switch_mm((prev),(next),NULL)
#endif
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index c1a69000c8d7..398c530270c2 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -40,8 +40,7 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
- NODE_DATA(nid)->node_size)
-#define node_size(nid) (NODE_DATA(nid)->node_size)
+ NODE_DATA(nid)->node_spanned_pages)
#define local_mapnr(kvaddr) \
( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) )
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 0b4ae8298a0e..69389c4af8e4 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -78,7 +78,7 @@ struct acct
#ifdef CONFIG_BSD_PROCESS_ACCT
struct super_block;
extern void acct_auto_close(struct super_block *sb);
-extern int acct_process(long exitcode);
+extern void acct_process(long exitcode);
#else
#define acct_auto_close(x) do { } while (0)
#define acct_process(x) do { } while (0)
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h
index 47ed05c8b744..c849309b1131 100644
--- a/include/linux/affs_fs.h
+++ b/include/linux/affs_fs.h
@@ -41,9 +41,9 @@ extern int affs_init_bitmap(struct super_block *sb);
/* namei.c */
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
-extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry);
+extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *);
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
-extern int affs_create(struct inode *dir, struct dentry *dentry, int mode);
+extern int affs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
extern int affs_link(struct dentry *olddentry, struct inode *dir,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 786ea3563752..2e7f92aa1dc2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -22,11 +22,62 @@ typedef struct elevator_s elevator_t;
struct request_pm_state;
#define BLKDEV_MIN_RQ 4
-#define BLKDEV_MAX_RQ 128
+#define BLKDEV_MAX_RQ 128 /* Default maximum */
+
+/*
+ * This is the per-process anticipatory I/O scheduler state.
+ */
+struct as_io_context {
+ spinlock_t lock;
+
+ void (*dtor)(struct as_io_context *aic); /* destructor */
+ void (*exit)(struct as_io_context *aic); /* called on task exit */
+
+ unsigned long state;
+ atomic_t nr_queued; /* queued reads & sync writes */
+ atomic_t nr_dispatched; /* number of requests gone to the drivers */
+
+ /* IO History tracking */
+ /* Thinktime */
+ unsigned long last_end_request;
+ unsigned long ttime_total;
+ unsigned long ttime_samples;
+ unsigned long ttime_mean;
+ /* Layout pattern */
+ long seek_samples;
+ sector_t last_request_pos;
+ sector_t seek_total;
+ sector_t seek_mean;
+};
+
+/*
+ * This is the per-process I/O subsystem state. It is refcounted and
+ * kmalloc'ed. Currently all fields are modified in process io context
+ * (apart from the atomic refcount), so require no locking.
+ */
+struct io_context {
+ atomic_t refcount;
+ pid_t pid;
+
+ /*
+ * For request batching
+ */
+ unsigned long last_waited; /* Time last woken after wait for request */
+ int nr_batch_requests; /* Number of requests left in the batch */
+
+ struct as_io_context *aic;
+};
+
+void put_io_context(struct io_context *ioc);
+void exit_io_context(void);
+struct io_context *get_io_context(int gfp_flags);
+void copy_io_context(struct io_context **pdst, struct io_context **psrc);
+void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
struct request_list {
int count[2];
mempool_t *rq_pool;
+ wait_queue_head_t wait[2];
};
/*
@@ -268,8 +319,15 @@ struct request_queue
spinlock_t *queue_lock;
/*
+ * queue kobject
+ */
+ struct kobject kobj;
+
+ /*
* queue settings
*/
+ unsigned long nr_requests; /* Max # of requests */
+
unsigned short max_sectors;
unsigned short max_phys_segments;
unsigned short max_hw_segments;
@@ -299,6 +357,8 @@ struct request_queue
#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
+#define QUEUE_FLAG_READFULL 3 /* write queue has been filled */
+#define QUEUE_FLAG_WRITEFULL 4 /* read queue has been filled */
#define blk_queue_plugged(q) !list_empty(&(q)->plug_list)
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
@@ -314,6 +374,30 @@ struct request_queue
#define rq_data_dir(rq) ((rq)->flags & 1)
+static inline int blk_queue_full(struct request_queue *q, int rw)
+{
+ if (rw == READ)
+ return test_bit(QUEUE_FLAG_READFULL, &q->queue_flags);
+ return test_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags);
+}
+
+static inline void blk_set_queue_full(struct request_queue *q, int rw)
+{
+ if (rw == READ)
+ set_bit(QUEUE_FLAG_READFULL, &q->queue_flags);
+ else
+ set_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags);
+}
+
+static inline void blk_clear_queue_full(struct request_queue *q, int rw)
+{
+ if (rw == READ)
+ clear_bit(QUEUE_FLAG_READFULL, &q->queue_flags);
+ else
+ clear_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags);
+}
+
+
/*
* mergeable request must not have _NOMERGE or _BARRIER bit set, nor may
* it already be started by driver.
@@ -397,6 +481,8 @@ struct sec_size {
unsigned block_size_bits;
};
+extern int blk_register_queue(struct gendisk *disk);
+extern void blk_unregister_queue(struct gendisk *disk);
extern void register_disk(struct gendisk *dev);
extern void generic_make_request(struct bio *bio);
extern void blk_put_request(struct request *);
@@ -560,6 +646,10 @@ static inline void put_dev_sector(Sector p)
page_cache_release(p.v);
}
+struct work_struct;
+int kblockd_schedule_work(struct work_struct *work);
+void kblockd_flush(void);
+
#ifdef CONFIG_LBD
# include <asm/div64.h>
# define sector_div(a, b) do_div(a, b)
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 22d3ac8efc6b..1f468b0491ed 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -167,6 +167,7 @@ struct buffer_head *__find_get_block(struct block_device *, sector_t, int);
struct buffer_head * __getblk(struct block_device *, sector_t, int);
void __brelse(struct buffer_head *);
void __bforget(struct buffer_head *);
+void __breadahead(struct block_device *, sector_t block, int size);
struct buffer_head *__bread(struct block_device *, sector_t block, int size);
struct buffer_head *alloc_buffer_head(int gfp_flags);
void free_buffer_head(struct buffer_head * bh);
@@ -241,6 +242,12 @@ sb_bread(struct super_block *sb, sector_t block)
return __bread(sb->s_bdev, block, sb->s_blocksize);
}
+static inline void
+sb_breadahead(struct super_block *sb, sector_t block)
+{
+ __breadahead(sb->s_bdev, block, sb->s_blocksize);
+}
+
static inline struct buffer_head *
sb_getblk(struct super_block *sb, sector_t block)
{
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index b22d34fcfb6d..650a6f997f8a 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -38,7 +38,7 @@ extern struct file_operations coda_ioctl_operations;
int coda_open(struct inode *i, struct file *f);
int coda_flush(struct file *f);
int coda_release(struct inode *i, struct file *f);
-int coda_permission(struct inode *inode, int mask);
+int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
int coda_revalidate_inode(struct dentry *);
int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
int coda_setattr(struct dentry *, struct iattr *);
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 076b1b268c7d..3fb888cc0c34 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -117,7 +117,7 @@ COMPATIBLE_IOCTL(START_ARRAY)
COMPATIBLE_IOCTL(STOP_ARRAY)
COMPATIBLE_IOCTL(STOP_ARRAY_RO)
COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
-#ifdef CONFIG_DM
+#ifdef CONFIG_BLK_DEV_DM
/* DM */
COMPATIBLE_IOCTL(DM_VERSION)
COMPATIBLE_IOCTL(DM_REMOVE_ALL)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 1442779bd893..a25d9f0443a4 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -10,6 +10,7 @@
#include <linux/rcupdate.h>
#include <asm/bug.h>
+struct nameidata;
struct vfsmount;
/*
@@ -106,7 +107,7 @@ struct dentry {
#define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname))
struct dentry_operations {
- int (*d_revalidate)(struct dentry *, int);
+ int (*d_revalidate)(struct dentry *, struct nameidata *);
int (*d_hash) (struct dentry *, struct qstr *);
int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
int (*d_delete)(struct dentry *);
diff --git a/include/linux/device.h b/include/linux/device.h
index 1bd92551c077..2795b85ac6f1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -18,6 +18,7 @@
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/ioport.h>
+#include <linux/module.h>
#include <asm/semaphore.h>
#include <asm/atomic.h>
@@ -95,7 +96,7 @@ struct bus_attribute {
#define BUS_ATTR(_name,_mode,_show,_store) \
struct bus_attribute bus_attr_##_name = { \
- .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
@@ -136,7 +137,7 @@ struct driver_attribute {
#define DRIVER_ATTR(_name,_mode,_show,_store) \
struct driver_attribute driver_attr_##_name = { \
- .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
@@ -176,7 +177,7 @@ struct class_attribute {
#define CLASS_ATTR(_name,_mode,_show,_store) \
struct class_attribute class_attr_##_name = { \
- .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
@@ -215,6 +216,8 @@ extern void class_device_initialize(struct class_device *);
extern int class_device_add(struct class_device *);
extern void class_device_del(struct class_device *);
+extern int class_device_rename(struct class_device *, char *);
+
extern struct class_device * class_device_get(struct class_device *);
extern void class_device_put(struct class_device *);
@@ -226,7 +229,7 @@ struct class_device_attribute {
#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
struct class_device_attribute class_device_attr_##_name = { \
- .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
@@ -324,7 +327,7 @@ struct device_attribute {
#define DEVICE_ATTR(_name,_mode,_show,_store) \
struct device_attribute dev_attr_##_name = { \
- .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index c78e9c2a7b3a..1640eb875d4e 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -46,7 +46,7 @@ extern int efs_statfs(struct super_block *, struct kstatfs *);
extern void efs_read_inode(struct inode *);
extern efs_block_t efs_map_block(struct inode *, efs_block_t);
-extern struct dentry *efs_lookup(struct inode *, struct dentry *);
+extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
extern int efs_bmap(struct inode *, int);
#endif /* __EFS_FS_H__ */
diff --git a/include/linux/eisa.h b/include/linux/eisa.h
index d77fdf0f9f01..93e4c5503d46 100644
--- a/include/linux/eisa.h
+++ b/include/linux/eisa.h
@@ -4,6 +4,8 @@
#define EISA_SIG_LEN 8
#define EISA_MAX_SLOTS 8
+#define EISA_MAX_RESOURCES 4
+
/* A few EISA constants/offsets... */
#define EISA_DMA1_STATUS 8
@@ -17,6 +19,10 @@
#define EISA_INT1_EDGE_LEVEL 0x4D0
#define EISA_INT2_EDGE_LEVEL 0x4D1
#define EISA_VENDOR_ID_OFFSET 0xC80
+#define EISA_CONFIG_OFFSET 0xC84
+
+#define EISA_CONFIG_ENABLED 1
+#define EISA_CONFIG_FORCED 2
/* The EISA signature, in ASCII form, null terminated */
struct eisa_device_id {
@@ -26,19 +32,28 @@ struct eisa_device_id {
/* There is not much we can say about an EISA device, apart from
* signature, slot number, and base address. dma_mask is set by
- * default to 32 bits.*/
+ * default to parent device mask..*/
struct eisa_device {
struct eisa_device_id id;
int slot;
+ int state;
unsigned long base_addr;
- struct resource res;
+ struct resource res[EISA_MAX_RESOURCES];
u64 dma_mask;
struct device dev; /* generic device */
};
#define to_eisa_device(n) container_of(n, struct eisa_device, dev)
+static inline int eisa_get_region_index (void *addr)
+{
+ unsigned long x = (unsigned long) addr;
+
+ x &= 0xc00;
+ return (x >> 12);
+}
+
struct eisa_driver {
const struct eisa_device_id *id_table;
struct device_driver driver;
@@ -69,6 +84,8 @@ struct eisa_root_device {
struct resource *res;
unsigned long bus_base_addr;
int slots; /* Max slot number */
+ int force_probe; /* Probe even when no slot 0 */
+ u64 dma_mask; /* from bridge device */
int bus_nr; /* Set by eisa_root_register */
struct resource eisa_root_res; /* ditto */
};
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 522e51609ef3..b0e70562be94 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -15,6 +15,9 @@ typedef int (elevator_queue_empty_fn) (request_queue_t *);
typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
typedef struct list_head *(elevator_get_sort_head_fn) (request_queue_t *, struct request *);
+typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
+typedef int (elevator_may_queue_fn) (request_queue_t *, int);
+
typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, int);
typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
@@ -32,6 +35,7 @@ struct elevator_s
elevator_remove_req_fn *elevator_remove_req_fn;
elevator_queue_empty_fn *elevator_queue_empty_fn;
+ elevator_completed_req_fn *elevator_completed_req_fn;
elevator_request_list_fn *elevator_former_req_fn;
elevator_request_list_fn *elevator_latter_req_fn;
@@ -39,6 +43,8 @@ struct elevator_s
elevator_set_req_fn *elevator_set_req_fn;
elevator_put_req_fn *elevator_put_req_fn;
+ elevator_may_queue_fn *elevator_may_queue_fn;
+
elevator_init_fn *elevator_init_fn;
elevator_exit_fn *elevator_exit_fn;
@@ -62,8 +68,10 @@ extern int elv_queue_empty(request_queue_t *);
extern struct request *elv_next_request(struct request_queue *q);
extern struct request *elv_former_request(request_queue_t *, struct request *);
extern struct request *elv_latter_request(request_queue_t *, struct request *);
-extern int elv_register_queue(struct gendisk *);
-extern void elv_unregister_queue(struct gendisk *);
+extern int elv_register_queue(request_queue_t *q);
+extern void elv_unregister_queue(request_queue_t *q);
+extern int elv_may_queue(request_queue_t *, int);
+extern void elv_completed_request(request_queue_t *, struct request *);
extern int elv_set_request(request_queue_t *, struct request *, int);
extern void elv_put_request(request_queue_t *, struct request *);
@@ -81,6 +89,11 @@ extern elevator_t elevator_noop;
*/
extern elevator_t iosched_deadline;
+/*
+ * anticipatory I/O scheduler
+ */
+extern elevator_t iosched_as;
+
extern int elevator_init(request_queue_t *, elevator_t *);
extern void elevator_exit(request_queue_t *);
extern inline int elv_rq_merge_ok(struct request *, struct bio *);
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 60f8cadb1f50..f89acbe8183a 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -14,6 +14,8 @@
#ifndef _LINUX_EVENTPOLL_H
#define _LINUX_EVENTPOLL_H
+#include <linux/types.h>
+
/* Valid opcodes to issue to sys_epoll_ctl() */
#define EPOLL_CTL_ADD 1
@@ -55,8 +57,37 @@ asmlinkage long sys_epoll_wait(int epfd, struct epoll_event *events, int maxeven
/* Used to initialize the epoll bits inside the "struct file" */
void eventpoll_init_file(struct file *file);
-/* Used in fs/file_table.c:__fput() to unlink files from the eventpoll interface */
-void eventpoll_release(struct file *file);
+/* Used to release the epoll bits inside the "struct file" */
+void eventpoll_release_file(struct file *file);
+
+/*
+ * This is called from inside fs/file_table.c:__fput() to unlink files
+ * from the eventpoll interface. We need to have this facility to cleanup
+ * correctly files that are closed without being removed from the eventpoll
+ * interface.
+ */
+static inline void eventpoll_release(struct file *file)
+{
+
+ /*
+ * Fast check to avoid the get/release of the semaphore. Since
+ * we're doing this outside the semaphore lock, it might return
+ * false negatives, but we don't care. It'll help in 99.99% of cases
+ * to avoid the semaphore lock. False positives simply cannot happen
+ * because the file in on the way to be removed and nobody ( but
+ * eventpoll ) has still a reference to this file.
+ */
+ if (likely(list_empty(&file->f_ep_links)))
+ return;
+
+ /*
+ * The file is being closed while it is still linked to an epoll
+ * descriptor. We need to handle this by correctly unlinking it
+ * from its containers.
+ */
+ eventpoll_release_file(file);
+}
+
#else
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index f077563bcfc3..c360f84fed3d 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -636,10 +636,14 @@ struct dx_hash_info
struct ext3_iloc
{
struct buffer_head *bh;
- struct ext3_inode *raw_inode;
+ unsigned long offset;
unsigned long block_group;
};
+static inline struct ext3_inode *ext3_raw_inode(struct ext3_iloc *iloc)
+{
+ return (struct ext3_inode *) (iloc->bh->b_data + iloc->offset);
+}
/*
* This structure is stuffed into the struct file's private_data field
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index 1a6a6c5922f7..1181cfae7142 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -62,6 +62,16 @@ struct ext3_inode_info {
__u32 i_prealloc_count;
#endif
__u32 i_dir_start_lookup;
+#ifdef CONFIG_EXT3_FS_XATTR
+ /*
+ * Extended attributes can be read independently of the main file
+ * data. Taking i_sem even when reading would cause contention
+ * between readers of EAs and writers of regular file data, so
+ * instead we synchronize on xattr_sem when reading or changing
+ * EAs.
+ */
+ struct rw_semaphore xattr_sem;
+#endif
#ifdef CONFIG_EXT3_FS_POSIX_ACL
struct posix_acl *i_acl;
struct posix_acl *i_default_acl;
diff --git a/include/linux/flat.h b/include/linux/flat.h
index 7643a3f9d3f5..ec56852e2659 100644
--- a/include/linux/flat.h
+++ b/include/linux/flat.h
@@ -1,7 +1,7 @@
-
-/* Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
- * The Silver Hammer Group, Ltd.
- * Copyright (C) 2002 David McCullough <davidm@snapgear.com>
+/*
+ * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
+ * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
+ * The Silver Hammer Group, Ltd.
*
* This file provides the definitions and structures needed to
* support uClinux flat-format executables.
@@ -10,10 +10,18 @@
#ifndef _LINUX_FLAT_H
#define _LINUX_FLAT_H
+#ifdef __KERNEL__
#include <asm/flat.h>
+#endif
#define FLAT_VERSION 0x00000004L
+#ifdef CONFIG_BINFMT_SHARED_FLAT
+#define MAX_SHARED_LIBS (4)
+#else
+#define MAX_SHARED_LIBS (1)
+#endif
+
/*
* To make everything easier to port and manage cross platform
* development, all fields are in network byte order.
@@ -46,8 +54,10 @@ struct flat_hdr {
#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
+#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
+#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
/*
* While it would be nice to keep this header clean, users of older
* tools still need this support in the kernel. So this section is
@@ -85,4 +95,6 @@ typedef union {
} reloc;
} flat_v2_reloc_t;
+#endif /* __KERNEL__ */
+
#endif /* _LINUX_FLAT_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c3bda88631bc..77dd4b13dc43 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -420,6 +420,8 @@ struct file_ra_state {
unsigned long ahead_start; /* Ahead window */
unsigned long ahead_size;
unsigned long ra_pages; /* Maximum readahead window */
+ unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
+ unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
};
struct file {
@@ -639,7 +641,7 @@ static inline void unlock_super(struct super_block * sb)
/*
* VFS helper functions..
*/
-extern int vfs_create(struct inode *, struct dentry *, int);
+extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int vfs_mkdir(struct inode *, struct dentry *, int);
extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
@@ -730,8 +732,8 @@ struct file_operations {
};
struct inode_operations {
- int (*create) (struct inode *,struct dentry *,int);
- struct dentry * (*lookup) (struct inode *,struct dentry *);
+ int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
+ struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
@@ -743,7 +745,7 @@ struct inode_operations {
int (*readlink) (struct dentry *, char __user *,int);
int (*follow_link) (struct dentry *, struct nameidata *);
void (*truncate) (struct inode *);
- int (*permission) (struct inode *, int);
+ int (*permission) (struct inode *, int, struct nameidata *);
int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
@@ -1121,7 +1123,7 @@ extern int do_remount_sb(struct super_block *sb, int flags,
extern sector_t bmap(struct inode *, sector_t);
extern int setattr_mask(unsigned int);
extern int notify_change(struct dentry *, struct iattr *);
-extern int permission(struct inode *, int);
+extern int permission(struct inode *, int, struct nameidata *);
extern int vfs_permission(struct inode *, int);
extern int get_write_access(struct inode *);
extern int deny_write_access(struct file *);
@@ -1291,7 +1293,7 @@ extern int simple_prepare_write(struct file *file, struct page *page,
extern int simple_commit_write(struct file *file, struct page *page,
unsigned offset, unsigned to);
-extern struct dentry *simple_lookup(struct inode *, struct dentry *);
+extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
extern struct file_operations simple_dir_operations;
extern struct inode_operations simple_dir_inode_operations;
diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h
index 40971822e3e4..7bebd13150dd 100644
--- a/include/linux/hfs_fs.h
+++ b/include/linux/hfs_fs.h
@@ -234,7 +234,7 @@ extern struct hfs_cat_entry *hfs_cat_get(struct hfs_mdb *,
const struct hfs_cat_key *);
/* dir.c */
-extern int hfs_create(struct inode *, struct dentry *, int);
+extern int hfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int hfs_mkdir(struct inode *, struct dentry *, int);
extern int hfs_unlink(struct inode *, struct dentry *);
extern int hfs_rmdir(struct inode *, struct dentry *);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index da2eaeb18118..21e48723b386 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -94,8 +94,8 @@ struct softirq_action
asmlinkage void do_softirq(void);
extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data);
extern void softirq_init(void);
-#define __cpu_raise_softirq(cpu, nr) do { softirq_pending(cpu) |= 1UL << (nr); } while (0)
-extern void FASTCALL(cpu_raise_softirq(unsigned int cpu, unsigned int nr));
+#define __raise_softirq_irqoff(nr) do { local_softirq_pending() |= 1UL << (nr); } while (0)
+extern void FASTCALL(raise_softirq_irqoff(unsigned int nr));
extern void FASTCALL(raise_softirq(unsigned int nr));
#ifndef invoke_softirq
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 9193a8df0122..26d6293ed4c9 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -43,6 +43,7 @@ struct resource_list {
#define IORESOURCE_SHADOWABLE 0x00010000
#define IORESOURCE_BUS_HAS_VGA 0x00080000
+#define IORESOURCE_DISABLED 0x10000000
#define IORESOURCE_UNSET 0x20000000
#define IORESOURCE_AUTO 0x40000000
#define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */
diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h
index 3f49c2ba63ed..03b3e17de805 100644
--- a/include/linux/irq_cpustat.h
+++ b/include/linux/irq_cpustat.h
@@ -29,10 +29,6 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */
/* arch independent irq_stat fields */
#define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending)
#define local_softirq_pending() softirq_pending(smp_processor_id())
-#define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count)
-#define local_syscall_count() syscall_count(smp_processor_id())
-#define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task)
-#define local_ksoftirqd_task() ksoftirqd_task(smp_processor_id())
/* arch dependent irq_stat fields */
#define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index 4763b595287a..223f161da018 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -227,7 +227,7 @@ extern int isofs_name_translate(struct iso_directory_record *, char *, struct in
int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *);
int get_acorn_filename(struct iso_directory_record *, char *, struct inode *);
-extern struct dentry *isofs_lookup(struct inode *, struct dentry *);
+extern struct dentry *isofs_lookup(struct inode *, struct dentry *, struct nameidata *);
extern struct buffer_head *isofs_bread(struct inode *, sector_t);
extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long);
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 88425e94cdc5..9971827a3c4b 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -31,7 +31,8 @@ struct kernel_stat {
DECLARE_PER_CPU(struct kernel_stat, kstat);
#define kstat_cpu(cpu) per_cpu(kstat, cpu)
-#define kstat_this_cpu kstat_cpu(smp_processor_id())
+/* Must have preemption disabled for this to be meaningful. */
+#define kstat_this_cpu __get_cpu_var(kstat)
extern unsigned long nr_context_switches(void);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 5d42248dd95f..e744a55d07d5 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -39,6 +39,8 @@ extern void kobject_cleanup(struct kobject *);
extern int kobject_add(struct kobject *);
extern void kobject_del(struct kobject *);
+extern void kobject_rename(struct kobject *, char *new_name);
+
extern int kobject_register(struct kobject *);
extern void kobject_unregister(struct kobject *);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 492bc8aeb053..858914b2dbd3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -339,9 +339,14 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num)
page->flags |= zone_num << ZONE_SHIFT;
}
-static inline void * lowmem_page_address(struct page *page)
+#ifndef CONFIG_DISCONTIGMEM
+/* The array of struct pages - for discontigmem use pgdat->lmem_map */
+extern struct page *mem_map;
+#endif
+
+static inline void *lowmem_page_address(struct page *page)
{
- return __va( ( (page - page_zone(page)->zone_mem_map) + page_zone(page)->zone_start_pfn) << PAGE_SHIFT);
+ return __va(page_to_pfn(page) << PAGE_SHIFT);
}
#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -395,11 +400,6 @@ static inline int page_mapped(struct page *page)
#define VM_FAULT_MINOR 1
#define VM_FAULT_MAJOR 2
-#ifndef CONFIG_DISCONTIGMEM
-/* The array of struct pages - for discontigmem use pgdat->lmem_map */
-extern struct page *mem_map;
-#endif
-
extern void show_free_areas(void);
struct page *shmem_nopage(struct vm_area_struct * vma,
@@ -571,10 +571,6 @@ void page_cache_readahead(struct address_space *mapping,
struct file_ra_state *ra,
struct file *filp,
unsigned long offset);
-void page_cache_readaround(struct address_space *mapping,
- struct file_ra_state *ra,
- struct file *filp,
- unsigned long offset);
void handle_ra_miss(struct address_space *mapping,
struct file_ra_state *ra, pgoff_t offset);
unsigned long max_sane_readahead(unsigned long nr);
@@ -609,5 +605,13 @@ extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
int write);
extern int remap_page_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot);
+
+#ifndef CONFIG_DEBUG_PAGEALLOC
+static inline void
+kernel_map_pages(struct page *page, int numpages, int enable)
+{
+}
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 474d1c046436..a8956f6588ad 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -9,7 +9,8 @@
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
-extern int vm_enough_memory(long pages);
+extern int sysctl_overcommit_memory;
+extern int sysctl_overcommit_ratio;
extern atomic_t vm_committed_space;
#ifdef CONFIG_SMP
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 21e95664fdf8..e768f7ab8963 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -184,12 +184,17 @@ typedef struct pglist_data {
unsigned long *valid_addr_bitmap;
struct bootmem_data *bdata;
unsigned long node_start_pfn;
- unsigned long node_size;
+ unsigned long node_present_pages; /* total number of physical pages */
+ unsigned long node_spanned_pages; /* total size of physical page
+ range, including holes */
int node_id;
struct pglist_data *pgdat_next;
wait_queue_head_t kswapd_wait;
} pg_data_t;
+#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
+#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages)
+
extern int numnodes;
extern struct pglist_data *pgdat_list;
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 4268ed112436..1ce9ba2f57b0 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -307,8 +307,8 @@ extern int fat_scan(struct inode *dir, const char *name,
struct msdos_dir_entry **res_de, loff_t *i_pos);
/* msdos/namei.c - these are for Umsdos */
-extern struct dentry *msdos_lookup(struct inode *dir, struct dentry *);
-extern int msdos_create(struct inode *dir, struct dentry *dentry, int mode);
+extern struct dentry *msdos_lookup(struct inode *dir, struct dentry *, struct nameidata *);
+extern int msdos_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int msdos_rmdir(struct inode *dir, struct dentry *dentry);
extern int msdos_mkdir(struct inode *dir, struct dentry *dentry, int mode);
extern int msdos_unlink(struct inode *dir, struct dentry *dentry);
@@ -317,8 +317,8 @@ extern int msdos_rename(struct inode *old_dir, struct dentry *old_dentry,
extern int msdos_fill_super(struct super_block *sb, void *data, int silent);
/* vfat/namei.c - these are for dmsdos */
-extern struct dentry *vfat_lookup(struct inode *dir, struct dentry *);
-extern int vfat_create(struct inode *dir, struct dentry *dentry, int mode);
+extern struct dentry *vfat_lookup(struct inode *dir, struct dentry *, struct nameidata *);
+extern int vfat_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int vfat_rmdir(struct inode *dir, struct dentry *dentry);
extern int vfat_unlink(struct inode *dir, struct dentry *dentry);
extern int vfat_mkdir(struct inode *dir, struct dentry *dentry, int mode);
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 16baf5cdb9c7..4117cd90a345 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -5,12 +5,22 @@
struct vfsmount;
+struct open_intent {
+ int flags;
+ int create_mode;
+};
+
struct nameidata {
struct dentry *dentry;
struct vfsmount *mnt;
struct qstr last;
unsigned int flags;
int last_type;
+
+ /* Intent data */
+ union {
+ struct open_intent open;
+ } intent;
};
/*
@@ -31,7 +41,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
#define LOOKUP_CONTINUE 4
#define LOOKUP_PARENT 16
#define LOOKUP_NOALT 32
-
+/*
+ * Intent data
+ */
+#define LOOKUP_OPEN (0x0100)
+#define LOOKUP_CREATE (0x0200)
+#define LOOKUP_ACCESS (0x0400)
extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
#define user_path_walk(name,nd) \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d79375c33273..3aef822b4493 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -561,7 +561,7 @@ static inline void __netif_schedule(struct net_device *dev)
cpu = smp_processor_id();
dev->next_sched = softnet_data[cpu].output_queue;
softnet_data[cpu].output_queue = dev;
- cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
+ raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
}
}
@@ -612,7 +612,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb)
cpu = smp_processor_id();
skb->next = softnet_data[cpu].completion_queue;
softnet_data[cpu].completion_queue = skb;
- cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
+ raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
}
}
@@ -779,7 +779,7 @@ static inline void __netif_rx_schedule(struct net_device *dev)
dev->quota += dev->weight;
else
dev->quota = dev->weight;
- __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ);
+ __raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
}
@@ -805,7 +805,7 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
local_irq_save(flags);
cpu = smp_processor_id();
list_add_tail(&dev->poll_list, &softnet_data[cpu].poll_list);
- __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ);
+ __raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
return 1;
}
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 3d7525998534..a6d594bb252c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -240,7 +240,7 @@ extern struct inode *nfs_fhget(struct dentry *, struct nfs_fh *,
struct nfs_fattr *);
extern int __nfs_refresh_inode(struct inode *, struct nfs_fattr *);
extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
-extern int nfs_permission(struct inode *, int);
+extern int nfs_permission(struct inode *, int, struct nameidata *);
extern int nfs_open(struct inode *, struct file *);
extern int nfs_release(struct inode *, struct file *);
extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3ceb5d7da821..a219c58ad88e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -543,7 +543,7 @@ void pcibios_update_irq(struct pci_dev *, int irq);
/* Generic PCI functions used internally */
-int pci_bus_exists(const struct list_head *list, int nr);
+extern struct pci_bus *pci_find_bus(int domain, int busnr);
struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
{
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index c0144a1ba4cb..e2e54ee6186d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -92,7 +92,7 @@ extern struct proc_dir_entry *proc_root_kcore;
extern void proc_root_init(void);
extern void proc_misc_init(void);
-struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry);
+struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *);
struct dentry *proc_pid_unhash(struct task_struct *p);
void proc_pid_flush(struct dentry *proc_dentry);
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
@@ -115,7 +115,7 @@ extern int proc_match(int, const char *,struct proc_dir_entry *);
* of the /proc/<pid> subdirectories.
*/
extern int proc_readdir(struct file *, void *, filldir_t);
-extern struct dentry *proc_lookup(struct inode *, struct dentry *);
+extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *);
extern struct file_operations proc_kcore_operations;
extern struct file_operations proc_kmsg_operations;
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 5710620989d5..53233c8fb3ef 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -110,21 +110,20 @@ struct qnx4_inode_info {
struct inode vfs_inode;
};
-extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry);
+extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd);
extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
extern struct buffer_head *qnx4_getblk(struct inode *, int, int);
extern struct buffer_head *qnx4_bread(struct inode *, int, int);
-extern int qnx4_create(struct inode *dir, struct dentry *dentry, int mode);
extern struct inode_operations qnx4_file_inode_operations;
extern struct inode_operations qnx4_dir_inode_operations;
extern struct file_operations qnx4_file_operations;
extern struct file_operations qnx4_dir_operations;
extern int qnx4_is_free(struct super_block *sb, long block);
extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy);
-extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode);
+extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd);
extern void qnx4_truncate(struct inode *inode);
extern void qnx4_free_inode(struct inode *inode);
extern int qnx4_unlink(struct inode *dir, struct dentry *dentry);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 77d017472dc7..fbf2d2b2a5be 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -306,6 +306,16 @@ int register_quota_format(struct quota_format_type *fmt);
void unregister_quota_format(struct quota_format_type *fmt);
void init_dquot_operations(struct dquot_operations *fsdqops);
+struct quota_module_name {
+ int qm_fmt_id;
+ char *qm_mod_name;
+};
+
+#define INIT_QUOTA_MODULE_NAMES {\
+ {QFMT_VFS_OLD, "quota_v1"},\
+ {QFMT_VFS_V0, "quota_v2"},\
+ {0, NULL}}
+
#else
# /* nodep */ include <sys/cdefs.h>
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ca97376901b0..750f2a12cada 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -321,6 +321,8 @@ struct k_itimer {
};
+struct io_context; /* See blkdev.h */
+void exit_io_context(void);
struct task_struct {
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -450,6 +452,8 @@ struct task_struct {
struct dentry *proc_dentry;
struct backing_dev_info *backing_dev_info;
+ struct io_context *io_context;
+
unsigned long ptrace_message;
siginfo_t *last_siginfo; /* For ptrace use. */
};
@@ -481,6 +485,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_KSWAPD 0x00040000 /* I am kswapd */
#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
#define PF_LESS_THROTTLE 0x01000000 /* Throttle me less: I clena memory */
+#define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */
#ifdef CONFIG_SMP
extern int set_cpus_allowed(task_t *p, unsigned long new_mask);
diff --git a/include/linux/security.h b/include/linux/security.h
index 9589f99c3ef3..4d91dfc52c52 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -49,6 +49,7 @@ extern int cap_bprm_secureexec(struct linux_binprm *bprm);
extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
extern void cap_task_reparent_to_init (struct task_struct *p);
extern int cap_syslog (int type);
+extern int cap_vm_enough_memory (long pages);
static inline int cap_netlink_send (struct sk_buff *skb)
{
@@ -958,6 +959,10 @@ struct swap_info_struct;
* See the syslog(2) manual page for an explanation of the @type values.
* @type contains the type of action.
* Return 0 if permission is granted.
+ * @vm_enough_memory:
+ * Check permissions for allocating a new virtual mapping.
+ * @pages contains the number of pages.
+ * Return 0 if permission is granted.
*
* @register_security:
* allow module stacking.
@@ -989,6 +994,7 @@ struct security_operations {
int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
int (*quota_on) (struct file * f);
int (*syslog) (int type);
+ int (*vm_enough_memory) (long pages);
int (*bprm_alloc_security) (struct linux_binprm * bprm);
void (*bprm_free_security) (struct linux_binprm * bprm);
@@ -1238,6 +1244,11 @@ static inline int security_syslog(int type)
return security_ops->syslog(type);
}
+static inline int security_vm_enough_memory(long pages)
+{
+ return security_ops->vm_enough_memory(pages);
+}
+
static inline int security_bprm_alloc (struct linux_binprm *bprm)
{
return security_ops->bprm_alloc_security (bprm);
@@ -1898,6 +1909,11 @@ static inline int security_syslog(int type)
return cap_syslog(type);
}
+static inline int security_vm_enough_memory(long pages)
+{
+ return cap_vm_enough_memory(pages);
+}
+
static inline int security_bprm_alloc (struct linux_binprm *bprm)
{
return 0;
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 2821bc07f647..6e13e5efc163 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -109,7 +109,6 @@ struct sem_queue {
int id; /* internal sem id */
struct sembuf * sops; /* array of pending operations */
int nsops; /* number of operations */
- int alter; /* operation will alter semaphore */
};
/* Each task has a list of undo requests. They are executed automatically
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 843c8d638d29..d797c981f37e 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -114,6 +114,10 @@ extern kmem_cache_t *signal_cachep;
extern kmem_cache_t *sighand_cachep;
extern kmem_cache_t *bio_cachep;
+void ptrinfo(unsigned long addr);
+
+extern atomic_t slab_reclaim_pages;
+
#endif /* __KERNEL__ */
#endif /* _LINUX_SLAB_H */
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index f054416c8145..441c0d91f583 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -10,9 +10,11 @@
#define _SYSFS_H_
struct kobject;
+struct module;
struct attribute {
char * name;
+ struct module * owner;
mode_t mode;
};
@@ -37,6 +39,9 @@ sysfs_create_dir(struct kobject *);
extern void
sysfs_remove_dir(struct kobject *);
+extern void
+sysfs_rename_dir(struct kobject *, char *new_name);
+
extern int
sysfs_create_file(struct kobject *, struct attribute *);
diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p
index 7034b7eb6b16..1c284c5a7aec 100644
--- a/include/linux/umsdos_fs.p
+++ b/include/linux/umsdos_fs.p
@@ -10,7 +10,7 @@ char * umsdos_d_path(struct dentry *, char *, int);
void umsdos_lookup_patch_new(struct dentry *, struct umsdos_info *);
int umsdos_is_pseudodos (struct inode *dir, struct dentry *dentry);
struct dentry *umsdos_lookup_x ( struct inode *dir, struct dentry *dentry, int nopseudo);
-struct dentry *UMSDOS_lookup(struct inode *, struct dentry *);
+struct dentry *UMSDOS_lookup(struct inode *, struct dentry *, struct nameidata *);
struct dentry *umsdos_lookup_dentry(struct dentry *, char *, int, int);
struct dentry *umsdos_covered(struct dentry *, char *, int);
@@ -92,7 +92,7 @@ int UMSDOS_rename (struct inode *old_dir,
/* rdir.c 22/03/95 03.31.42 */
struct dentry *umsdos_rlookup_x (struct inode *dir, struct dentry *dentry, int nopseudo);
-struct dentry *UMSDOS_rlookup (struct inode *dir, struct dentry *dentry);
+struct dentry *UMSDOS_rlookup (struct inode *dir, struct dentry *dentry, struct nameidata *nd);
static inline struct umsdos_inode_info *UMSDOS_I(struct inode *inode)
{