summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@maxwell.earthlink.net>2002-12-29 18:44:33 -0800
committerJames Simmons <jsimmons@maxwell.earthlink.net>2002-12-29 18:44:33 -0800
commita5900581f22590feaa182c440be0ab67ad964863 (patch)
tree71c6e5c0cabf70e0da90f1ed3d51148039acee6d /include
parent6065bc2dc398089fa385f128baaa858a8ecab5a6 (diff)
parentbec7aa00ffe5b1270837b965fdfe80be3e8e6e2e (diff)
Merge maxwell.earthlink.net:/usr/src/linus-2.5
into maxwell.earthlink.net:/usr/src/fbdev-2.5
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-arc/io.h2
-rw-r--r--include/asm-arm/arch-cl7500/io.h2
-rw-r--r--include/asm-arm/arch-rpc/io.h2
-rw-r--r--include/asm-arm/memory.h4
-rw-r--r--include/asm-arm/setup.h2
-rw-r--r--include/asm-i386/desc.h1
-rw-r--r--include/asm-i386/hw_irq.h2
-rw-r--r--include/asm-i386/mach-default/mach_apic.h3
-rw-r--r--include/asm-i386/mach-numaq/mach_apic.h3
-rw-r--r--include/asm-i386/mach-numaq/mach_mpparse.h3
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h3
-rw-r--r--include/asm-i386/processor.h35
-rw-r--r--include/asm-i386/segment.h8
-rw-r--r--include/asm-i386/smp.h21
-rw-r--r--include/asm-i386/uaccess.h2
-rw-r--r--include/asm-i386/voyager.h1
-rw-r--r--include/asm-m68k/ide.h14
-rw-r--r--include/linux/ax25.h2
-rw-r--r--include/linux/binfmts.h8
-rw-r--r--include/linux/compiler.h13
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/init.h5
-rw-r--r--include/linux/ioport.h3
-rw-r--r--include/linux/module.h68
-rw-r--r--include/linux/moduleparam.h2
-rw-r--r--include/linux/mtd/map.h5
-rw-r--r--include/linux/mtd/mtd.h3
-rw-r--r--include/linux/personality.h18
28 files changed, 122 insertions, 118 deletions
diff --git a/include/asm-arm/arch-arc/io.h b/include/asm-arm/arch-arc/io.h
index 11c9ce687ab4..5aab0c88953f 100644
--- a/include/asm-arm/arch-arc/io.h
+++ b/include/asm-arm/arch-arc/io.h
@@ -246,7 +246,7 @@ DECLARE_IO(int,l,"")
#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
-/* the following macro is depreciated */
+/* the following macro is deprecated */
#define ioaddr(port) __ioaddr((port))
/*
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h
index 376ca94ebb9c..16a926084d5f 100644
--- a/include/asm-arm/arch-cl7500/io.h
+++ b/include/asm-arm/arch-cl7500/io.h
@@ -236,7 +236,7 @@ DECLARE_IO(int,l,"")
#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
-/* the following macro is depreciated */
+/* the following macro is deprecated */
#define ioaddr(port) __ioaddr((port))
#endif
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index cb39453f5c9f..3a1c18ad63bb 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -238,7 +238,7 @@ DECLARE_IO(int,l,"")
#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
-/* the following macro is depreciated */
+/* the following macro is deprecated */
#define ioaddr(port) __ioaddr((port))
#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index c936883e5f0e..38682a28d121 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -44,7 +44,7 @@ static inline void *phys_to_virt(unsigned long x)
/*
* Virtual <-> DMA view memory address translations
* Again, these are *only* valid on the kernel direct mapped RAM
- * memory. Use of these is *depreciated*.
+ * memory. Use of these is *deprecated*.
*/
#define virt_to_bus(x) (__virt_to_bus((unsigned long)(x)))
#define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x))))
@@ -109,7 +109,7 @@ static inline void *phys_to_virt(unsigned long x)
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
/*
- * We should really eliminate virt_to_bus() here - it's depreciated.
+ * We should really eliminate virt_to_bus() here - it's deprecated.
*/
#define page_to_bus(page) (virt_to_bus(page_address(page)))
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index 38f4ba0ecc67..f3319e9b4f29 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -68,7 +68,7 @@ struct tag_ramdisk {
/* describes where the compressed ramdisk image lives (virtual address) */
/*
* this one accidentally used virtual addresses - as such,
- * its depreciated.
+ * it's deprecated.
*/
#define ATAG_INITRD 0x54410005
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h
index 77f2b1c0ec46..d42e28c1e3fa 100644
--- a/include/asm-i386/desc.h
+++ b/include/asm-i386/desc.h
@@ -16,6 +16,7 @@ extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
struct Xgt_desc_struct {
unsigned short size;
unsigned long address __attribute__((packed));
+ unsigned short pad;
} __attribute__ ((packed));
extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS];
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index 1a60daa9172e..035a6af03c63 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -131,7 +131,7 @@ static inline int unregister_profile_notifier(struct notifier_block * nb)
#endif /* CONFIG_PROFILING */
-#ifdef CONFIG_SMP /*more of this file should probably be ifdefed SMP */
+#if defined(CONFIG_SMP) && !defined(CONFIG_VOYAGER) /*more of this file should probably be ifdefed SMP */
static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {
if (IO_APIC_IRQ(i))
send_IPI_self(IO_APIC_VECTOR(i));
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
index a24df01ffe2e..905bc7a1284d 100644
--- a/include/asm-i386/mach-default/mach_apic.h
+++ b/include/asm-i386/mach-default/mach_apic.h
@@ -73,8 +73,7 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
return (m->mpc_apicid);
}
-#define wakeup_secondary_cpu(apicid, start_eip) \
- wakeup_secondary_via_INIT(apicid, start_eip)
+#define WAKE_SECONDARY_VIA_INIT
static inline void setup_portio_remap(void)
{
diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
index be8eacb32aa0..94d2f5f28275 100644
--- a/include/asm-i386/mach-numaq/mach_apic.h
+++ b/include/asm-i386/mach-numaq/mach_apic.h
@@ -69,8 +69,7 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
return logical_apicid;
}
-#define wakeup_secondary_cpu(apicid, start_eip) \
- wakeup_secondary_via_NMI(apicid)
+#define WAKE_SECONDARY_VIA_NMI
static inline void setup_portio_remap(void)
{
diff --git a/include/asm-i386/mach-numaq/mach_mpparse.h b/include/asm-i386/mach-numaq/mach_mpparse.h
index ddda81a724a8..f15b7b9ae1e8 100644
--- a/include/asm-i386/mach-numaq/mach_mpparse.h
+++ b/include/asm-i386/mach-numaq/mach_mpparse.h
@@ -1,9 +1,6 @@
#ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H
-static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
- unsigned short oemsize);
-
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation)
{
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 2de1e9fea7cd..bf601c3368ad 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -54,8 +54,7 @@ static inline unsigned long apicid_to_phys_cpu_present(int apicid)
return (1ul << apicid);
}
-#define wakeup_secondary_cpu(apicid, start_eip) \
- wakeup_secondary_via_INIT(apicid, start_eip)
+#define WAKE_SECONDARY_VIA_INIT
static inline void setup_portio_remap(void)
{
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index ad72420d5374..6ee68de9408b 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -19,6 +19,9 @@
#include <linux/config.h>
#include <linux/threads.h>
+/* flag for disabling the tsc */
+extern int tsc_disable;
+
struct desc_struct {
unsigned long a,b;
};
@@ -392,31 +395,17 @@ struct thread_struct {
unsigned long *ts_io_bitmap;
};
-#define INIT_THREAD { \
- { { 0, 0 } , }, \
- 0, \
- 0, 0, 0, 0, \
- { [0 ... 7] = 0 }, /* debugging registers */ \
- 0, 0, 0, \
- { { 0, }, }, /* 387 state */ \
- 0,0,0,0,0, \
- NULL, /* io permissions */ \
+#define INIT_THREAD { \
+ .vm86_info = NULL, \
+ .ts_io_bitmap = NULL, \
}
-#define INIT_TSS { \
- 0,0, /* back_link, __blh */ \
- sizeof(init_stack) + (long) &init_stack, /* esp0 */ \
- __KERNEL_DS, 0, /* ss0 */ \
- 0,0,0,0,0,0, /* stack1, stack2 */ \
- 0, /* cr3 */ \
- 0,0, /* eip,eflags */ \
- 0,0,0,0, /* eax,ecx,edx,ebx */ \
- 0,0,0,0, /* esp,ebp,esi,edi */ \
- 0,0,0,0,0,0, /* es,cs,ss */ \
- 0,0,0,0,0,0, /* ds,fs,gs */ \
- GDT_ENTRY_LDT,0, /* ldt */ \
- 0, INVALID_IO_BITMAP_OFFSET, /* tace, bitmap */ \
- {~0, } /* ioperm */ \
+#define INIT_TSS { \
+ .esp0 = sizeof(init_stack) + (long)&init_stack, \
+ .ss0 = __KERNEL_DS, \
+ .ldt = GDT_ENTRY_LDT, \
+ .bitmap = INVALID_IO_BITMAP_OFFSET, \
+ .io_bitmap = { [ 0 ... IO_BITMAP_SIZE ] = ~0 }, \
}
static inline void load_esp0(struct tss_struct *tss, unsigned long esp0)
diff --git a/include/asm-i386/segment.h b/include/asm-i386/segment.h
index f6949fb109d9..3f272860a6b3 100644
--- a/include/asm-i386/segment.h
+++ b/include/asm-i386/segment.h
@@ -71,6 +71,14 @@
#define GDT_SIZE (GDT_ENTRIES * 8)
+/* Simple and small GDT entries for booting only */
+
+#define GDT_ENTRY_BOOT_CS 2
+#define __BOOT_CS (GDT_ENTRY_BOOT_CS * 8)
+
+#define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1)
+#define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8)
+
/*
* The interrupt descriptor table has room for 256 idt's,
* the global descriptor table is dependent on the number
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 32a8f5a05a84..71d58561d39c 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -6,6 +6,7 @@
*/
#ifndef __ASSEMBLY__
#include <linux/config.h>
+#include <linux/kernel.h>
#include <linux/threads.h>
#endif
@@ -83,11 +84,22 @@ extern volatile unsigned long cpu_callout_map;
#define cpu_possible(cpu) (cpu_callout_map & (1<<(cpu)))
#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
+#define for_each_cpu(cpu, mask) \
+ for(mask = cpu_online_map; \
+ cpu = __ffs(mask), mask != 0; \
+ mask &= ~(1<<cpu))
+
extern inline unsigned int num_online_cpus(void)
{
return hweight32(cpu_online_map);
}
+/* We don't mark CPUs online until __cpu_up(), so we need another measure */
+static inline int num_booting_cpus(void)
+{
+ return hweight32(cpu_callout_map);
+}
+
extern inline int any_online_cpu(unsigned int mask)
{
if (mask & cpu_online_map)
@@ -95,7 +107,7 @@ extern inline int any_online_cpu(unsigned int mask)
return -1;
}
-
+#ifdef CONFIG_X86_LOCAL_APIC
static __inline int hard_smp_processor_id(void)
{
/* we don't want to mark this access volatile - bad code generation */
@@ -108,12 +120,7 @@ static __inline int logical_smp_processor_id(void)
return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
}
-/* We don't mark CPUs online until __cpu_up(), so we need another measure */
-static inline int num_booting_cpus(void)
-{
- return hweight32(cpu_callout_map);
-}
-
+#endif
#endif /* !__ASSEMBLY__ */
#define NO_PROC_ID 0xFF /* No processor magic marker */
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 05bdac770eed..377038170a0b 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -189,7 +189,7 @@ do { \
case 1: __put_user_asm(x,ptr,retval,"b","b","iq"); break; \
case 2: __put_user_asm(x,ptr,retval,"w","w","ir"); break; \
case 4: __put_user_asm(x,ptr,retval,"l","","ir"); break; \
- case 8: __put_user_u64(x,ptr,retval); break; \
+ case 8: __put_user_u64((__typeof__(*ptr))(x),ptr,retval); break; \
default: __put_user_bad(); \
} \
} while (0)
diff --git a/include/asm-i386/voyager.h b/include/asm-i386/voyager.h
index 1e97e05e17d0..aaf432dd7673 100644
--- a/include/asm-i386/voyager.h
+++ b/include/asm-i386/voyager.h
@@ -504,7 +504,6 @@ extern void voyager_setup_irqs(void);
extern int voyager_memory_detect(int region, __u32 *addr, __u32 *length);
extern void voyager_smp_intr_init(void);
extern __u8 voyager_extended_cmos_read(__u16 cmos_address);
-extern void voyager_dump(void);
extern void voyager_smp_dump(void);
extern void voyager_timer_interrupt(struct pt_regs *regs);
extern void smp_local_timer_interrupt(struct pt_regs * regs);
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 6b451e47441c..621be3adc24a 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -144,19 +144,19 @@ static __inline__ void ide_init_default_hwifs(void)
#define ATA_ARCH_ACK_INTR
-#ifdef CONFIG_ATARI
+#ifdef CONFIG_BLK_DEV_FALCON_IDE
#define ATA_ARCH_LOCK
-extern int ide_intr_lock;
+extern int falconide_intr_lock;
static __inline__ void ide_release_lock (void)
{
if (MACH_IS_ATARI) {
- if (ide_intr_lock == 0) {
+ if (falconide_intr_lock == 0) {
printk("ide_release_lock: bug\n");
return;
}
- ide_intr_lock = 0;
+ falconide_intr_lock = 0;
stdma_release();
}
}
@@ -164,14 +164,14 @@ static __inline__ void ide_release_lock (void)
static __inline__ void ide_get_lock(void (*handler)(int, void *, struct pt_regs *), void *data)
{
if (MACH_IS_ATARI) {
- if (ide_intr_lock == 0) {
+ if (falconide_intr_lock == 0) {
if (in_interrupt() > 0)
panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
stdma_lock(handler, data);
- ide_intr_lock = 1;
+ falconide_intr_lock = 1;
}
}
}
-#endif /* CONFIG_ATARI */
+#endif /* CONFIG_BLK_DEV_FALCON_IDE */
#endif /* __KERNEL__ */
#endif /* _M68K_IDE_H */
diff --git a/include/linux/ax25.h b/include/linux/ax25.h
index 6dfc8fc9116d..56c11f0dbd80 100644
--- a/include/linux/ax25.h
+++ b/include/linux/ax25.h
@@ -85,7 +85,7 @@ struct ax25_ctl_struct {
};
/* this will go away. Please do not export to user land */
-struct ax25_info_struct_depreciated {
+struct ax25_info_struct_deprecated {
unsigned int n2, n2count;
unsigned int t1, t1timer;
unsigned int t2, t2timer;
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index ae1b454395b5..bd929e344d75 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -58,13 +58,7 @@ extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm);
extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
extern void compute_creds(struct linux_binprm *binprm);
extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
-extern void set_binfmt(struct linux_binfmt *new);
-
-
-#if 0
-/* this went away now */
-#define change_ldt(a,b) setup_arg_pages(a,b)
-#endif
+extern int set_binfmt(struct linux_binfmt *new);
#endif /* __KERNEL__ */
#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6b19413b47a6..f88889740949 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -13,6 +13,19 @@
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
+/*
+ * Allow us to mark functions as 'deprecated' and have gcc emit a nice
+ * warning for each use, in hopes of speeding the functions removal.
+ * Usage is:
+ * int deprecated foo(void)
+ * and then gcc will emit a warning for each usage of the function.
+ */
+#if __GNUC__ >= 3
+#define __deprecated __attribute__((deprecated))
+#else
+#define __deprecated
+#endif
+
/* This macro obfuscates arithmetic on a variable address so that gcc
shouldn't recognize the original var, and make assumptions about it */
#define RELOC_HIDE(ptr, off) \
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 500cb3ac421e..6c3188b991e6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -983,13 +983,13 @@ struct super_block *get_sb_pseudo(struct file_system_type *, char *,
/* Alas, no aliases. Too much hassle with bringing module.h everywhere */
#define fops_get(fops) \
(((fops) && (fops)->owner) \
- ? ( try_inc_mod_count((fops)->owner) ? (fops) : NULL ) \
+ ? (try_inc_mod_count((fops)->owner) ? (fops) : NULL) \
: (fops))
#define fops_put(fops) \
do { \
if ((fops) && (fops)->owner) \
- __MOD_DEC_USE_COUNT((fops)->owner); \
+ module_put((fops)->owner); \
} while(0)
extern int register_filesystem(struct file_system_type *);
@@ -1300,6 +1300,7 @@ extern int dcache_dir_open(struct inode *, struct file *);
extern int dcache_dir_close(struct inode *, struct file *);
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
extern int dcache_readdir(struct file *, void *, filldir_t);
+extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
extern int simple_statfs(struct super_block *, struct statfs *);
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
extern int simple_unlink(struct inode *, struct dentry *);
diff --git a/include/linux/init.h b/include/linux/init.h
index 46b1ef190c52..b7c6363478aa 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -147,14 +147,13 @@ struct obs_kernel_param {
#define module_init(initfn) \
static inline initcall_t __inittest(void) \
{ return initfn; } \
- int __initfn(void) __attribute__((alias(#initfn)));
+ int init_module(void) __attribute__((alias(#initfn)));
/* This is only required if you want to be unloadable. */
#define module_exit(exitfn) \
static inline exitcall_t __exittest(void) \
{ return exitfn; } \
- void __exitfn(void) __attribute__((alias(#exitfn)));
-
+ void cleanup_module(void) __attribute__((alias(#exitfn)));
#define __setup(str,func) /* nothing */
#endif
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 020bd1596ab9..edd1eadb98b8 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -8,6 +8,7 @@
#ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H
+#include <linux/compiler.h>
/*
* Resources are tree-like, allowing
* nesting etc..
@@ -107,7 +108,7 @@ extern struct resource * __request_region(struct resource *, unsigned long start
#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
-extern int __check_region(struct resource *, unsigned long, unsigned long);
+extern int __deprecated __check_region(struct resource *, unsigned long, unsigned long);
extern void __release_region(struct resource *, unsigned long, unsigned long);
#define get_ioport_list(buf) get_resource_list(&ioport_resource, buf, PAGE_SIZE)
diff --git a/include/linux/module.h b/include/linux/module.h
index 2392edcc3307..3a411c8c6575 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -40,12 +40,11 @@ struct kernel_symbol
char name[MODULE_NAME_LEN];
};
-#ifdef MODULE
+/* These are either module local, or the kernel's dummy ones. */
+extern int init_module(void);
+extern void cleanup_module(void);
-#ifdef KBUILD_MODNAME
-static const char __module_name[MODULE_NAME_LEN] __attribute__((section(".gnu.linkonce.modname"))) = \
- __stringify(KBUILD_MODNAME);
-#endif
+#ifdef MODULE
/* For replacement modutils, use an alias not a pointer. */
#define MODULE_GENERIC_TABLE(gtype,name) \
@@ -56,9 +55,6 @@ static const struct gtype##_id * __module_##gtype##_table \
extern const struct gtype##_id __mod_##gtype##_table \
__attribute__ ((unused, alias(__stringify(name))))
-/* This is magically filled in by the linker, but THIS_MODULE must be
- a constant so it works in initializers. */
-extern struct module __this_module;
#define THIS_MODULE (&__this_module)
#else /* !MODULE */
@@ -176,7 +172,7 @@ struct module
/* The command line arguments (may be mangled). People like
keeping pointers to this stuff */
- char args[0];
+ char *args;
};
/* FIXME: It'd be nice to isolate modules during init, too, so they
@@ -289,6 +285,19 @@ static inline const char *module_address_lookup(unsigned long addr,
}
#endif /* CONFIG_MODULES */
+#if defined(MODULE) && defined(KBUILD_MODNAME)
+/* We make the linker do some of the work. */
+struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+ .name = __stringify(KBUILD_MODNAME),
+ .symbols = { .owner = &__this_module },
+ .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+ .exit = cleanup_module,
+#endif
+};
+#endif /* MODULE && KBUILD_MODNAME */
+
/* For archs to search exception tables */
extern struct list_head extables;
extern spinlock_t modlist_lock;
@@ -296,9 +305,20 @@ extern spinlock_t modlist_lock;
#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
/* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
-#define __MOD_INC_USE_COUNT(mod) \
- do { __unsafe(mod); (void)try_module_get(mod); } while(0)
-#define __MOD_DEC_USE_COUNT(mod) module_put(mod)
+static inline void __deprecated __MOD_INC_USE_COUNT(struct module *module)
+{
+ __unsafe(module);
+ /*
+ * Yes, we ignore the retval here, that's why it's deprecated.
+ */
+ try_module_get(module);
+}
+
+static inline void __deprecated __MOD_DEC_USE_COUNT(struct module *module)
+{
+ module_put(module);
+}
+
#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE)
struct obsolete_modparm {
@@ -319,14 +339,21 @@ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
/* People do this inside their init routines, when the module isn't
"live" yet. They should no longer be doing that, but
meanwhile... */
+static inline void __deprecated _MOD_INC_USE_COUNT(struct module *module)
+{
+ __unsafe(module);
+
#if defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)
-#define MOD_INC_USE_COUNT \
- do { __unsafe(THIS_MODULE); local_inc(&THIS_MODULE->ref[get_cpu()].count); put_cpu(); } while (0)
+ local_inc(&module->ref[get_cpu()].count);
+ put_cpu();
#else
-#define MOD_INC_USE_COUNT \
- do { __unsafe(THIS_MODULE); (void)try_module_get(THIS_MODULE); } while (0)
+ try_module_get(module);
#endif
-#define MOD_DEC_USE_COUNT module_put(THIS_MODULE)
+}
+#define MOD_INC_USE_COUNT \
+ _MOD_INC_USE_COUNT(THIS_MODULE)
+#define MOD_DEC_USE_COUNT \
+ __MOD_DEC_USE_COUNT(THIS_MODULE)
#define try_inc_mod_count(mod) try_module_get(mod)
#define EXPORT_NO_SYMBOLS
extern int module_dummy_usage;
@@ -342,13 +369,6 @@ extern int module_dummy_usage;
&& __mod_between((p),(n),(m)->module_init,(m)->init_size)) \
|| __mod_between((p),(n),(m)->module_core,(m)->core_size))
-/* Old-style "I'll just call it init_module and it'll be run at
- insert". Use module_init(myroutine) instead. */
-#ifdef MODULE
-#define init_module(voidarg) __initfn(void)
-#define cleanup_module(voidarg) __exitfn(void)
-#endif
-
/*
* The exception and symbol tables, and the lock
* to protect them.
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 92a1bc154e8e..e52553263640 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -39,7 +39,7 @@ struct kparam_string {
writable. */
#define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #name; \
- static struct kernel_param __param_##name \
+ static struct kernel_param const __param_##name \
__attribute__ ((unused,__section__ ("__param"))) \
= { __param_str_##name, perm, set, get, arg }
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 94ffed22315b..ad8dfcbda17d 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -81,10 +81,7 @@ static inline void map_destroy(struct mtd_info *mtd)
if (map->fldrv->destroy)
map->fldrv->destroy(mtd);
-#ifdef CONFIG_MODULES
- if (map->fldrv->module)
- __MOD_DEC_USE_COUNT(map->fldrv->module);
-#endif
+ module_put(map->fldrv->module);
kfree(mtd);
}
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index ae5bfe3e10fb..52d38241e91e 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -224,8 +224,7 @@ static inline struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num)
static inline void put_mtd_device(struct mtd_info *mtd)
{
- if (mtd->module)
- __MOD_DEC_USE_COUNT(mtd->module);
+ module_put(mtd->module);
}
diff --git a/include/linux/personality.h b/include/linux/personality.h
index ca5d403e49ff..33802c8eeedb 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -107,22 +107,4 @@ struct exec_domain {
#define set_personality(pers) \
((current->personality == pers) ? 0 : __set_personality(pers))
-/*
- * Load an execution domain.
- */
-#define get_exec_domain(ep) \
-do { \
- if (ep != NULL && ep->module != NULL) \
- __MOD_INC_USE_COUNT(ep->module); \
-} while (0)
-
-/*
- * Unload an execution domain.
- */
-#define put_exec_domain(ep) \
-do { \
- if (ep != NULL && ep->module != NULL) \
- __MOD_DEC_USE_COUNT(ep->module); \
-} while (0)
-
#endif /* _LINUX_PERSONALITY_H */