diff options
Diffstat (limited to 'include/linux')
139 files changed, 1615 insertions, 1314 deletions
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index 2b68241da812..4e2fe240d5d0 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -315,4 +315,26 @@ struct ac97_driver { extern int ac97_register_driver(struct ac97_driver *driver); extern void ac97_unregister_driver(struct ac97_driver *driver); +/* quirk types */ +enum { + AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */ + AC97_TUNE_NONE = 0, /* nothing extra to do */ + AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */ + AC97_TUNE_SWAP_HP, /* swap headphone and master controls */ + AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */ + AC97_TUNE_AD_SHARING, /* for AD1985, turn on OMS bit and use headphone */ + AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */ +}; + +struct ac97_quirk { + unsigned short vendor; /* PCI vendor id */ + unsigned short device; /* PCI device id */ + unsigned short mask; /* device id bit mask, 0 = accept all */ + const char *name; /* name shown as info */ + int type; /* quirk type above */ +}; + +struct pci_dev; +extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override); + #endif /* _AC97_CODEC_H_ */ diff --git a/include/linux/acct.h b/include/linux/acct.h index a6ab17c49aa1..39cd52f7f557 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -120,9 +120,13 @@ struct acct_v3 struct super_block; extern void acct_auto_close(struct super_block *sb); extern void acct_process(long exitcode); +extern void acct_update_integrals(void); +extern void acct_clear_integrals(struct task_struct *tsk); #else #define acct_auto_close(x) do { } while (0) #define acct_process(x) do { } while (0) +#define acct_update_integrals() do { } while (0) +#define acct_clear_integrals(task) do { } while (0) #endif /* diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 7a1b2cad5e07..8b5d1f25ba0e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -428,6 +428,15 @@ static inline int acpi_boot_table_init(void) unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); +/* + * This function undoes the effect of one call to acpi_register_gsi(). + * If this matches the last registration, any IRQ resources for gsi + * are freed. + */ +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void acpi_unregister_gsi (u32 gsi); +#endif + #ifdef CONFIG_ACPI_PCI struct acpi_prt_entry { @@ -453,6 +462,10 @@ struct pci_dev; int acpi_pci_irq_enable (struct pci_dev *dev); void acpi_penalize_isa_irq(int irq); +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void acpi_pci_irq_disable (struct pci_dev *dev); +#endif + struct acpi_pci_driver { struct acpi_pci_driver *next; int (*add)(acpi_handle handle); diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index bd4364daf948..7198f129e135 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -343,7 +343,6 @@ void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc, void arcnet_unregister_proto(struct ArcProto *proto); irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs); -void arcdev_setup(struct net_device *dev); struct net_device *alloc_arcdev(char *name); void arcnet_rx(struct net_device *dev, int bufnum); diff --git a/include/linux/backlight.h b/include/linux/backlight.h new file mode 100644 index 000000000000..bb9e54322322 --- /dev/null +++ b/include/linux/backlight.h @@ -0,0 +1,57 @@ +/* + * Backlight Lowlevel Control Abstraction + * + * Copyright (C) 2003,2004 Hewlett-Packard Company + * + */ + +#ifndef _LINUX_BACKLIGHT_H +#define _LINUX_BACKLIGHT_H + +#include <linux/device.h> +#include <linux/notifier.h> + +struct backlight_device; +struct fb_info; + +/* This structure defines all the properties of a backlight + (usually attached to a LCD). */ +struct backlight_properties { + /* Owner module */ + struct module *owner; + /* Get the backlight power status (0: full on, 1..3: power saving + modes; 4: full off), see FB_BLANK_XXX */ + int (*get_power)(struct backlight_device *); + /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ + int (*set_power)(struct backlight_device *, int power); + /* Maximal value for brightness (read-only) */ + int max_brightness; + /* Get current backlight brightness */ + int (*get_brightness)(struct backlight_device *); + /* Set backlight brightness (0..max_brightness) */ + int (*set_brightness)(struct backlight_device *, int brightness); + /* Check if given framebuffer device is the one bound to this backlight; + return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ + int (*check_fb)(struct fb_info *); +}; + +struct backlight_device { + /* This protects the 'props' field. If 'props' is NULL, the driver that + registered this device has been unloaded, and if class_get_devdata() + points to something in the body of that driver, it is also invalid. */ + struct semaphore sem; + /* If this is NULL, the backing module is unloaded */ + struct backlight_properties *props; + /* The framebuffer notifier block */ + struct notifier_block fb_notif; + /* The class device structure */ + struct class_device class_dev; +}; + +extern struct backlight_device *backlight_device_register(const char *name, + void *devdata, struct backlight_properties *bp); +extern void backlight_device_unregister(struct backlight_device *bd); + +#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) + +#endif diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index d3f220b57b4a..54f820832c73 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -74,7 +74,9 @@ extern int flush_old_exec(struct linux_binprm * bprm); #define EXSTACK_DISABLE_X 1 /* Disable executable stacks */ #define EXSTACK_ENABLE_X 2 /* Enable executable stacks */ -extern int setup_arg_pages(struct linux_binprm * bprm, int executable_stack); +extern int setup_arg_pages(struct linux_binprm * bprm, + unsigned long stack_top, + int executable_stack); extern int copy_strings(int argc,char __user * __user * 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); diff --git a/include/linux/bitops.h b/include/linux/bitops.h index bcb0b1e1bff1..48f87b979ca9 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -1,7 +1,6 @@ #ifndef _LINUX_BITOPS_H #define _LINUX_BITOPS_H #include <asm/types.h> -#include <asm/bitops.h> /* * ffs: find first bit set. This is defined the same way as @@ -71,6 +70,12 @@ static __inline__ int generic_fls(int x) return r; } +/* + * Include this here because some architectures need generic_ffs/fls in + * scope + */ +#include <asm/bitops.h> + static __inline__ int get_bitmask_order(unsigned int count) { int order; diff --git a/include/linux/blk.h b/include/linux/blk.h deleted file mode 100644 index 42752bccae74..000000000000 --- a/include/linux/blk.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning this file is obsolete, please use <linux/blkdev.h> instead -#include <linux/blkdev.h> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1b7dc44bf3c1..5615a3c9e410 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -95,6 +95,7 @@ void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); struct request_list { int count[2]; + int starved[2]; mempool_t *rq_pool; wait_queue_head_t wait[2]; wait_queue_head_t drain; diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 70942b4f75b4..0dd8ca1a3d5a 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -90,7 +90,7 @@ extern void *__init alloc_large_system_hash(const char *tablename, #else #define HASHDIST_DEFAULT 0 #endif -extern int hashdist; /* Distribute hashes across NUMA nodes? */ +extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ #endif /* _LINUX_BOOTMEM_H */ diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 141a7460763b..b68fdf1f3156 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -1186,8 +1186,6 @@ struct media_event_desc { }; extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med); -extern int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write); -extern int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write); #endif /* End of kernel only stuff */ diff --git a/include/linux/coda.h b/include/linux/coda.h index 309cbbe35e67..bbc5afcd7db6 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -761,8 +761,8 @@ union coda_downcalls { struct ViceIoctl { void __user *in; /* Data to be transferred in */ void __user *out; /* Data to be transferred out */ - short in_size; /* Size of input buffer <= 2K */ - short out_size; /* Maximum size of output buffer, <= 2K */ + u_short in_size; /* Size of input buffer <= 2K */ + u_short out_size; /* Maximum size of output buffer, <= 2K */ }; struct PioctlData { diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h index c061a22ed86d..0dc1b0458e75 100644 --- a/include/linux/coda_proc.h +++ b/include/linux/coda_proc.h @@ -72,26 +72,5 @@ struct coda_cache_inv_stats /* these global variables hold the actual statistics data */ extern struct coda_vfs_stats coda_vfs_stat; -extern struct coda_cache_inv_stats coda_cache_inv_stat; - -/* reset statistics to 0 */ -void reset_coda_vfs_stats( void ); -void reset_coda_cache_inv_stats( void ); - -/* like coda_dointvec, these functions are to be registered in the ctl_table - * data structure for /proc/sys/... files - */ -int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, - void __user * buffer, size_t * lenp, loff_t * ppos ); -int do_reset_coda_cache_inv_stats( ctl_table * table, int write, - struct file * filp, void __user * buffer, - size_t * lenp, loff_t * ppos ); - -/* these functions are called to form the content of /proc/fs/coda/... files */ -int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset, - int length); -int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset, - int length); - #endif /* _CODA_PROC_H */ diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 0c767ffd6a0d..d539262a8f89 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -49,7 +49,7 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, const char *name, int length, struct CodaFid *newfid, struct coda_vattr *attrs); int venus_create(struct super_block *sb, struct CodaFid *dirfid, - const char *name, int length, int excl, int mode, dev_t rdev, + const char *name, int length, int excl, int mode, struct CodaFid *newfid, struct coda_vattr *attrs) ; int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid, const char *name, int length); diff --git a/include/linux/compat.h b/include/linux/compat.h index 56d5582abfe2..a62f5c960c75 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -143,6 +143,8 @@ long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, unsigned long bitmap_size); long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, unsigned long bitmap_size); - +struct compat_siginfo; +int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); +int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); #endif /* CONFIG_COMPAT */ #endif /* _LINUX_COMPAT_H */ diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index a9a2a486234c..062049ca5c44 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -9,6 +9,8 @@ * to achieve effects such as fast scrolling by changing the origin. */ +struct vt_struct; + #define NPAR 16 struct vc_data { @@ -87,6 +89,7 @@ struct vc_data { struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ unsigned long vc_uni_pagedir; unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ + struct vt_struct *vc_vt; /* additional information is in vt_kern.h */ }; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 060cf3bba586..910eca35583d 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -252,65 +252,6 @@ int cpufreq_update_policy(unsigned int cpu); /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ unsigned int cpufreq_get(unsigned int cpu); -/* the proc_intf.c needs this */ -int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor); - - -/********************************************************************* - * CPUFREQ USERSPACE GOVERNOR * - *********************************************************************/ -#ifdef CONFIG_CPU_FREQ_24_API - -int __deprecated cpufreq_setmax(unsigned int cpu); -int __deprecated cpufreq_set(unsigned int kHz, unsigned int cpu); - - -/* /proc/sys/cpu */ -enum { - CPU_NR = 1, /* compatibilty reasons */ - CPU_NR_0 = 1, - CPU_NR_1 = 2, - CPU_NR_2 = 3, - CPU_NR_3 = 4, - CPU_NR_4 = 5, - CPU_NR_5 = 6, - CPU_NR_6 = 7, - CPU_NR_7 = 8, - CPU_NR_8 = 9, - CPU_NR_9 = 10, - CPU_NR_10 = 11, - CPU_NR_11 = 12, - CPU_NR_12 = 13, - CPU_NR_13 = 14, - CPU_NR_14 = 15, - CPU_NR_15 = 16, - CPU_NR_16 = 17, - CPU_NR_17 = 18, - CPU_NR_18 = 19, - CPU_NR_19 = 20, - CPU_NR_20 = 21, - CPU_NR_21 = 22, - CPU_NR_22 = 23, - CPU_NR_23 = 24, - CPU_NR_24 = 25, - CPU_NR_25 = 26, - CPU_NR_26 = 27, - CPU_NR_27 = 28, - CPU_NR_28 = 29, - CPU_NR_29 = 30, - CPU_NR_30 = 31, - CPU_NR_31 = 32, -}; - -/* /proc/sys/cpu/{0,1,...,(NR_CPUS-1)} */ -enum { - CPU_NR_FREQ_MAX = 1, - CPU_NR_FREQ_MIN = 2, - CPU_NR_FREQ = 3, -}; - -#endif /* CONFIG_CPU_FREQ_24_API */ - /********************************************************************* * CPUFREQ DEFAULT GOVERNOR * @@ -351,6 +292,11 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, unsigned int relation, unsigned int *index); +/* the following 3 funtions are for cpufreq core use only */ +struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); +struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); +void cpufreq_cpu_put (struct cpufreq_policy *data); + /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 1ff1e85f6e59..8ccf5487ca99 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -234,29 +234,29 @@ static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits) #if NR_CPUS <= BITS_PER_LONG #define CPU_MASK_ALL \ -((cpumask_t) { { \ +(cpumask_t) { { \ [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ -} }) +} } #else #define CPU_MASK_ALL \ -((cpumask_t) { { \ +(cpumask_t) { { \ [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ -} }) +} } #endif #define CPU_MASK_NONE \ -((cpumask_t) { { \ +(cpumask_t) { { \ [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ -} }) +} } #define CPU_MASK_CPU0 \ -((cpumask_t) { { \ +(cpumask_t) { { \ [0] = 1UL \ -} }) +} } #define cpus_addr(src) ((src).bits) diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f4bc1ac23daa..2da76867183c 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -199,6 +199,7 @@ static inline int dname_external(struct dentry *dentry) * These are the low-level FS interfaces to the dcache.. */ extern void d_instantiate(struct dentry *, struct inode *); +extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); extern void d_delete(struct dentry *); /* allocate/de-allocate */ @@ -242,6 +243,23 @@ static inline void d_add(struct dentry *entry, struct inode *inode) d_rehash(entry); } +/** + * d_add_unique - add dentry to hash queues without aliasing + * @entry: dentry to add + * @inode: The inode to attach to this dentry + * + * This adds the entry to the hash queues and initializes @inode. + * The entry was actually filled in earlier during d_alloc(). + */ +static inline struct dentry *d_add_unique(struct dentry *entry, struct inode *inode) +{ + struct dentry *res; + + res = d_instantiate_unique(entry, inode); + d_rehash(res != NULL ? res : entry); + return res; +} + /* used for rename() and baskets */ extern void d_move(struct dentry *, struct dentry *); diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h new file mode 100644 index 000000000000..6dc7e3eca188 --- /dev/null +++ b/include/linux/debugfs.h @@ -0,0 +1,90 @@ +/* + * debugfs.h - a tiny little debug file system + * + * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> + * Copyright (C) 2004 IBM Inc. + * + * 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. + * + * debugfs is for people to use instead of /proc or /sys. + * See Documentation/DocBook/kernel-api for more details. + */ + +#ifndef _DEBUGFS_H_ +#define _DEBUGFS_H_ + +#if defined(CONFIG_DEBUG_FS) +struct dentry *debugfs_create_file(const char *name, mode_t mode, + struct dentry *parent, void *data, + struct file_operations *fops); + +struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); + +void debugfs_remove(struct dentry *dentry); + +struct dentry *debugfs_create_u8(const char *name, mode_t mode, + struct dentry *parent, u8 *value); +struct dentry *debugfs_create_u16(const char *name, mode_t mode, + struct dentry *parent, u16 *value); +struct dentry *debugfs_create_u32(const char *name, mode_t mode, + struct dentry *parent, u32 *value); +struct dentry *debugfs_create_bool(const char *name, mode_t mode, + struct dentry *parent, u32 *value); + +#else +/* + * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled + * so users have a chance to detect if there was a real error or not. We don't + * want to duplicate the design decision mistakes of procfs and devfs again. + */ + +static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, + struct dentry *parent, + void *data, + struct file_operations *fops) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_dir(const char *name, + struct dentry *parent) +{ + return ERR_PTR(-ENODEV); +} + +static inline void debugfs_remove(struct dentry *dentry) +{ } + +static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +#endif + +#endif diff --git a/include/linux/delay.h b/include/linux/delay.h index 5c43c336c849..acb74865b973 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h @@ -38,6 +38,7 @@ extern unsigned long loops_per_jiffy; #define ndelay(x) udelay(((x)+999)/1000) #endif +void calibrate_delay(void); void msleep(unsigned int msecs); unsigned long msleep_interruptible(unsigned int msecs); diff --git a/include/linux/device.h b/include/linux/device.h index c64cec37dd69..786e1591102b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -61,7 +61,7 @@ struct bus_type { int (*match)(struct device * dev, struct device_driver * drv); int (*hotplug) (struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); - int (*suspend)(struct device * dev, u32 state); + int (*suspend)(struct device * dev, pm_message_t state); int (*resume)(struct device * dev); }; @@ -228,7 +228,10 @@ extern int class_device_create_file(struct class_device *, const struct class_device_attribute *); extern void class_device_remove_file(struct class_device *, const struct class_device_attribute *); - +extern int class_device_create_bin_file(struct class_device *, + struct bin_attribute *); +extern void class_device_remove_bin_file(struct class_device *, + struct bin_attribute *); struct class_interface { struct list_head node; @@ -382,6 +385,8 @@ extern struct device platform_bus; extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); extern int platform_get_irq(struct platform_device *, unsigned int); +extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); +extern int platform_get_irq_byname(struct platform_device *, char *); extern int platform_add_devices(struct platform_device **, int); extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); diff --git a/include/linux/edd.h b/include/linux/edd.h index 5f93881106fa..c6e6747a401d 100644 --- a/include/linux/edd.h +++ b/include/linux/edd.h @@ -49,6 +49,10 @@ #define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */ #define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF in boot_params - treat this as 1 byte */ +#define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ +#define EDD_CL_OFF 0x666f /* "of" for off */ +#define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ + #ifndef __ASSEMBLY__ #define EDD_EXT_FIXED_DISK_ACCESS (1 << 0) diff --git a/include/linux/efs_vh.h b/include/linux/efs_vh.h index b3df61ef2eb2..8a11150c61fe 100644 --- a/include/linux/efs_vh.h +++ b/include/linux/efs_vh.h @@ -47,23 +47,6 @@ struct volume_header { struct pt_types { int pt_type; char *pt_name; -} sgi_pt_types[] = { - {0x00, "SGI vh"}, - {0x01, "SGI trkrepl"}, - {0x02, "SGI secrepl"}, - {0x03, "SGI raw"}, - {0x04, "SGI bsd"}, - {SGI_SYSV, "SGI sysv"}, - {0x06, "SGI vol"}, - {SGI_EFS, "SGI efs"}, - {0x08, "SGI lv"}, - {0x09, "SGI rlv"}, - {0x0A, "SGI xfs"}, - {0x0B, "SGI xfslog"}, - {0x0C, "SGI xlv"}, - {0x82, "Linux swap"}, - {0x83, "Linux native"}, - {0, NULL} }; #endif /* __EFS_VH_H__ */ diff --git a/include/linux/elf-fdpic.h b/include/linux/elf-fdpic.h new file mode 100644 index 000000000000..9f5b7456bff3 --- /dev/null +++ b/include/linux/elf-fdpic.h @@ -0,0 +1,68 @@ +/* elf-fdpic.h: FDPIC ELF load map + * + * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * 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. + */ + +#ifndef _LINUX_ELF_FDPIC_H +#define _LINUX_ELF_FDPIC_H + +#include <linux/elf.h> + +#define PT_GNU_STACK (PT_LOOS + 0x474e551) + +/* segment mappings for ELF FDPIC libraries/executables/interpreters */ +struct elf32_fdpic_loadseg { + Elf32_Addr addr; /* core address to which mapped */ + Elf32_Addr p_vaddr; /* VMA recorded in file */ + Elf32_Word p_memsz; /* allocation size recorded in file */ +}; + +struct elf32_fdpic_loadmap { + Elf32_Half version; /* version of these structures, just in case... */ + Elf32_Half nsegs; /* number of segments */ + struct elf32_fdpic_loadseg segs[]; +}; + +#define ELF32_FDPIC_LOADMAP_VERSION 0x0000 + +/* + * binfmt binary parameters structure + */ +struct elf_fdpic_params { + struct elfhdr hdr; /* ref copy of ELF header */ + struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */ + struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */ + unsigned long elfhdr_addr; /* mapped ELF header user address */ + unsigned long ph_addr; /* mapped PT_PHDR user address */ + unsigned long map_addr; /* mapped loadmap user address */ + unsigned long entry_addr; /* mapped entry user address */ + unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */ + unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */ + unsigned long load_addr; /* user address at which to map binary */ + unsigned long flags; +#define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */ +#define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */ +#define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */ +#define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant + * displacement */ +#define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */ +#define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */ +#define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */ +#define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */ +#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */ +}; + +#ifdef CONFIG_MMU +extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params, + struct elf_fdpic_params *interp_params, + unsigned long *start_stack, + unsigned long *start_brk); +#endif + +#endif /* _LINUX_ELF_FDPIC_H */ diff --git a/include/linux/elf.h b/include/linux/elf.h index 052b7401e94a..f5b3ba5a317d 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -36,8 +36,9 @@ typedef __s64 Elf64_Sxword; #define PT_NOTE 4 #define PT_SHLIB 5 #define PT_PHDR 6 -#define PT_LOOS 0x60000000 -#define PT_HIOS 0x6fffffff +#define PT_TLS 7 /* Thread local storage segment */ +#define PT_LOOS 0x60000000 /* OS-specific */ +#define PT_HIOS 0x6fffffff /* OS-specific */ #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff #define PT_GNU_EH_FRAME 0x6474e550 @@ -109,6 +110,8 @@ typedef __s64 Elf64_Sxword; */ #define EM_S390_OLD 0xA390 +#define EM_FRV 0x5441 /* Fujitsu FR-V */ + /* This is the info that is needed to parse the dynamic section of the file */ #define DT_NULL 0 #define DT_NEEDED 1 diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 5e0e52b0fc7e..f909e16a9645 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -195,7 +195,7 @@ struct ext3_group_desc */ #define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */ #define EXT3_STATE_NEW 0x00000002 /* inode is newly created */ - +#define EXT3_STATE_XATTR 0x00000004 /* has in-inode xattrs */ /* Used to pass group descriptor data when online resize is done */ struct ext3_new_group_input { @@ -293,6 +293,8 @@ struct ext3_inode { __u32 m_i_reserved2[2]; } masix2; } osd2; /* OS dependent 2 */ + __le16 i_extra_isize; + __le16 i_pad1; }; #define i_size_high i_dir_acl @@ -758,12 +760,12 @@ extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, in extern void ext3_read_inode (struct inode *); extern int ext3_write_inode (struct inode *, int); extern int ext3_setattr (struct dentry *, struct iattr *); -extern void ext3_put_inode (struct inode *); extern void ext3_delete_inode (struct inode *); extern int ext3_sync_inode (handle_t *, struct inode *); extern void ext3_discard_reservation (struct inode *); extern void ext3_dirty_inode(struct inode *); extern int ext3_change_inode_journal_flag(struct inode *, int); +extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); extern void ext3_truncate (struct inode *); extern void ext3_set_inode_flags(struct inode *); extern void ext3_set_aops(struct inode *inode); @@ -791,25 +793,15 @@ extern void ext3_error (struct super_block *, const char *, const char *, ...) extern void __ext3_std_error (struct super_block *, const char *, int); extern void ext3_abort (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); -extern NORET_TYPE void ext3_panic (struct super_block *, const char *, - const char *, ...) - __attribute__ ((NORET_AND format (printf, 3, 4))); extern void ext3_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); extern void ext3_update_dynamic_rev (struct super_block *sb); -extern void ext3_put_super (struct super_block *); -extern void ext3_write_super (struct super_block *); -extern void ext3_write_super_lockfs (struct super_block *); -extern void ext3_unlockfs (struct super_block *); -extern int ext3_remount (struct super_block *, int *, char *); -extern int ext3_statfs (struct super_block *, struct kstatfs *); #define ext3_std_error(sb, errno) \ do { \ if ((errno)) \ __ext3_std_error((sb), __FUNCTION__, (errno)); \ } while (0) -extern const char *ext3_decode_error(struct super_block *sb, int errno, char nbuf[16]); /* * Inodes and files operations diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 328cd40c5ea4..5e781aaff404 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h @@ -113,6 +113,9 @@ struct ext3_inode_info { */ loff_t i_disksize; + /* on-disk additional length */ + __u16 i_extra_isize; + /* * truncate_sem is for serialising ext3_truncate() against * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index da1c91ef0821..47445f93d4f7 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -46,8 +46,6 @@ EXT3_XATTR_TRANS_BLOCKS - 2 + \ 2*EXT3_QUOTA_TRANS_BLOCKS) -extern int ext3_writepage_trans_blocks(struct inode *inode); - /* Delete operations potentially hit one directory's namespace plus an * entire inode, plus arbitrary amounts of bitmap/indirection data. Be * generous. We can grow the delete transaction later if necessary. */ @@ -138,10 +136,13 @@ ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh, journal_release_buffer(handle, bh, credits); } -static inline void -ext3_journal_forget(handle_t *handle, struct buffer_head *bh) +static inline int +__ext3_journal_forget(const char *where, handle_t *handle, struct buffer_head *bh) { - journal_forget(handle, bh); + int err = journal_forget(handle, bh); + if (err) + ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err); + return err; } static inline int @@ -187,6 +188,8 @@ __ext3_journal_dirty_metadata(const char *where, __ext3_journal_get_create_access(__FUNCTION__, (handle), (bh)) #define ext3_journal_dirty_metadata(handle, bh) \ __ext3_journal_dirty_metadata(__FUNCTION__, (handle), (bh)) +#define ext3_journal_forget(handle, bh) \ + __ext3_journal_forget(__FUNCTION__, (handle), (bh)) int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); diff --git a/include/linux/fb.h b/include/linux/fb.h index c1bb3123bab3..2f8fd43c51dc 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -488,7 +488,8 @@ struct fb_cursor_user { #define FB_EVENT_GET_CONSOLE_MAP 0x06 /* set console to framebuffer mapping */ #define FB_EVENT_SET_CONSOLE_MAP 0x07 - +/* A display blank is requested */ +#define FB_EVENT_BLANK 0x08 struct fb_event { struct fb_info *info; @@ -690,7 +691,7 @@ struct fb_tile_ops { #define FBINFO_HWACCEL_YPAN 0x2000 /* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000 /* optional */ -#define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request +#define FBINFO_MISC_USEREVENT 0x10000 /* event request from userspace */ #define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */ #define FBINFO_MISC_MODESWITCHLATE 0x40000 /* init hardware later */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 3d1cc5dd9a94..9ca3c328b217 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -68,8 +68,6 @@ extern int dir_notify_enable; #endif #define NR_FILE 8192 /* this can well be larger on a larger system */ -#define NR_RESERVED_FILES 10 /* reserved for root */ -#define NR_SUPER 256 #define MAY_EXEC 1 #define MAY_WRITE 2 @@ -123,7 +121,6 @@ extern int dir_notify_enable; #define MS_REC 16384 #define MS_VERBOSE 32768 #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ -#define MS_ONE_SECOND (1<<17) /* fs has 1 sec a/m/ctime resolution */ #define MS_ACTIVE (1<<30) #define MS_NOUSER (1<<31) @@ -179,7 +176,6 @@ extern int dir_notify_enable; #define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME)) #define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) -#define IS_ONE_SECOND(inode) __IS_FLG(inode, MS_ONE_SECOND) #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) @@ -343,7 +339,7 @@ struct address_space { struct prio_tree_root i_mmap; /* tree of private and shared mappings */ struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ spinlock_t i_mmap_lock; /* protect tree, count, list */ - atomic_t truncate_count; /* Cover race condition with truncate */ + unsigned int truncate_count; /* Cover race condition with truncate */ unsigned long nrpages; /* number of total pages */ pgoff_t writeback_index;/* writeback starts here */ struct address_space_operations *a_ops; /* methods */ @@ -429,6 +425,7 @@ static inline int mapping_writably_mapped(struct address_space *mapping) struct inode { struct hlist_node i_hash; struct list_head i_list; + struct list_head i_sb_list; struct list_head i_dentry; unsigned long i_ino; atomic_t i_count; @@ -777,6 +774,7 @@ struct super_block { void *s_security; struct xattr_handler **s_xattr; + struct list_head s_inodes; /* all inodes */ struct list_head s_dirty; /* dirty inodes */ struct list_head s_io; /* parked for writeback */ struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ @@ -798,8 +796,14 @@ struct super_block { * even looking at it. You had been warned. */ struct semaphore s_vfs_rename_sem; /* Kludge */ + + /* Granuality of c/m/atime in ns. + Cannot be worse than a second */ + u32 s_time_gran; }; +extern struct timespec current_fs_time(struct super_block *sb); + /* * Snapshotting support. */ @@ -901,10 +905,16 @@ typedef struct { typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); +/* These macros are for out of kernel modules to test that + * the kernel supports the unlocked_ioctl and compat_ioctl + * fields in struct file_operations. */ +#define HAVE_COMPAT_IOCTL 1 +#define HAVE_UNLOCKED_IOCTL 1 + /* * NOTE: - * read, write, poll, fsync, readv, writev can be called - * without the big kernel lock held in all filesystems. + * read, write, poll, fsync, readv, writev, unlocked_ioctl and compat_ioctl + * can be called without the big kernel lock held in all filesystems. */ struct file_operations { struct module *owner; @@ -916,6 +926,8 @@ struct file_operations { int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); + long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); + long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *); @@ -1189,11 +1201,6 @@ extern long do_mount(char *, char *, char *, unsigned long, void *); extern int vfs_statfs(struct super_block *, struct kstatfs *); -/* Return value for VFS lock functions - tells locks.c to lock conventionally - * REALLY kosha for root NFS and nfs_lock - */ -#define LOCK_USE_CLNT 1 - #define FLOCK_VERIFY_READ 1 #define FLOCK_VERIFY_WRITE 2 @@ -1344,8 +1351,8 @@ static inline void invalidate_remote_inode(struct inode *inode) S_ISLNK(inode->i_mode)) invalidate_inode_pages(inode->i_mapping); } -extern void invalidate_inode_pages2(struct address_space *mapping); -extern void write_inode_now(struct inode *, int); +extern int invalidate_inode_pages2(struct address_space *mapping); +extern int write_inode_now(struct inode *, int); extern int filemap_fdatawrite(struct address_space *); extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 1c8417aff025..09d204709341 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h @@ -82,7 +82,6 @@ void gs_flush_chars(struct tty_struct *tty); void gs_stop(struct tty_struct *tty); void gs_start(struct tty_struct *tty); void gs_hangup(struct tty_struct *tty); -void gs_do_softint(void *private_); int gs_block_til_ready(void *port, struct file *filp); void gs_close(struct tty_struct *tty, struct file *filp); void gs_set_termios (struct tty_struct * tty, diff --git a/include/linux/genhd.h b/include/linux/genhd.h index ddde66abea1b..fc15d63f9947 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -218,6 +218,7 @@ static inline void free_disk_stats(struct gendisk *disk) extern void disk_round_stats(struct gendisk *disk); /* drivers/block/genhd.c */ +extern int get_blkdev_list(char *); extern void add_disk(struct gendisk *disk); extern void del_gendisk(struct gendisk *gp); extern void unlink_gendisk(struct gendisk *gp); diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 600f83c80aad..b526b21bad1c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -37,6 +37,7 @@ struct vm_area_struct; #define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */ #define __GFP_NO_GROW 0x2000 /* Slab internal usage */ #define __GFP_COMP 0x4000 /* Add compound page metadata */ +#define __GFP_ZERO 0x8000 /* Return zeroed page on success */ #define __GFP_BITS_SHIFT 16 /* Room for 16 __GFP_FOO bits */ #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index eae45cc3ea7a..ebc712e91066 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -4,6 +4,7 @@ #include <linux/config.h> #include <linux/smp_lock.h> #include <asm/hardirq.h> +#include <asm/system.h> /* * We put the hardirq and softirq counter into the preemption @@ -61,12 +62,16 @@ #define in_softirq() (softirq_count()) #define in_interrupt() (irq_count()) -#ifdef CONFIG_PREEMPT +#if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL) # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) +#else +# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) +#endif + +#ifdef CONFIG_PREEMPT # define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else -# define in_atomic() (preempt_count() != 0) # define preemptible() 0 # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET #endif @@ -77,12 +82,25 @@ extern void synchronize_irq(unsigned int irq); # define synchronize_irq(irq) barrier() #endif -#ifdef CONFIG_GENERIC_HARDIRQS -#define nmi_enter() (preempt_count() += HARDIRQ_OFFSET) -#define nmi_exit() (preempt_count() -= HARDIRQ_OFFSET) +#define nmi_enter() irq_enter() +#define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) -#define irq_enter() (preempt_count() += HARDIRQ_OFFSET) -extern void irq_exit(void); +#ifndef CONFIG_VIRT_CPU_ACCOUNTING +static inline void account_user_vtime(struct task_struct *tsk) +{ +} + +static inline void account_system_vtime(struct task_struct *tsk) +{ +} #endif +#define irq_enter() \ + do { \ + account_system_vtime(current); \ + add_preempt_count(HARDIRQ_OFFSET); \ + } while (0) + +extern void irq_exit(void); + #endif /* LINUX_HARDIRQ_H */ diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h new file mode 100644 index 000000000000..4a0113d64064 --- /dev/null +++ b/include/linux/i2c-algo-sgi.h @@ -0,0 +1,27 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License version 2 as published by the Free Software Foundation. + * + * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org> + */ + +#ifndef I2C_ALGO_SGI_H +#define I2C_ALGO_SGI_H 1 + +#include <linux/i2c.h> + +struct i2c_algo_sgi_data { + void *data; /* private data for lowlevel routines */ + unsigned (*getctrl)(void *data); + void (*setctrl)(void *data, unsigned val); + unsigned (*rdata)(void *data); + void (*wdata)(void *data, unsigned val); + + int xfer_timeout; + int ack_timeout; +}; + +int i2c_sgi_add_bus(struct i2c_adapter *); +int i2c_sgi_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_SGI_H */ diff --git a/include/linux/i2c-algo-sibyte.h b/include/linux/i2c-algo-sibyte.h new file mode 100644 index 000000000000..03914ded8614 --- /dev/null +++ b/include/linux/i2c-algo-sibyte.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2001,2002,2003 Broadcom Corporation + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef I2C_ALGO_SIBYTE_H +#define I2C_ALGO_SIBYTE_H 1 + +#include <linux/i2c.h> + +struct i2c_algo_sibyte_data { + void *data; /* private data */ + int bus; /* which bus */ + void *reg_base; /* CSR base */ +}; + +int i2c_sibyte_add_bus(struct i2c_adapter *, int speed); +int i2c_sibyte_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_SIBYTE_H */ diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c75219a37bb5..bfa2d557d47a 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -109,6 +109,7 @@ #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ #define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ +#define I2C_DRIVERID_SAA7114H 64 /* video decoder */ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ @@ -166,6 +167,7 @@ #define I2C_DRIVERID_ASB100 1043 #define I2C_DRIVERID_FSCHER 1046 #define I2C_DRIVERID_W83L785TS 1047 +#define I2C_DRIVERID_SMSC47B397 1050 /* * ---- Adapter types ---------------------------------------------------- @@ -193,9 +195,12 @@ #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */ #define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */ #define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */ -#define I2C_ALGO_OCP_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ +#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ #define I2C_ALGO_PCA 0x150000 /* PCA 9564 style adapters */ +#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */ +#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */ + #define I2C_ALGO_EXP 0x800000 /* experimental */ #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */ @@ -258,8 +263,15 @@ /* --- PowerPC on-chip adapters */ #define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ +/* --- Broadcom SiByte adapters */ +#define I2C_HW_SIBYTE 0x00 + +/* --- SGI adapters */ +#define I2C_HW_SGI_VINO 0x00 +#define I2C_HW_SGI_MACE 0x01 + /* --- XSCALE on-chip adapters */ -#define I2C_HW_IOP321 0x00 +#define I2C_HW_IOP3XX 0x00 /* --- SMBus only adapters */ #define I2C_HW_SMBUS_PIIX4 0x00 diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 229bb91364ad..ea9a3ad4b67f 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -23,7 +23,7 @@ #include <linux/i2o-dev.h> /* How many different OSM's are we allowing */ -#define I2O_MAX_DRIVERS 4 +#define I2O_MAX_DRIVERS 8 #include <asm/io.h> #include <asm/semaphore.h> /* Needed for MUTEX init macros */ @@ -631,15 +631,25 @@ static inline void i2o_dma_unmap(struct device *dev, struct i2o_dma *addr) extern int i2o_parm_field_get(struct i2o_device *, int, int, void *, int); extern int i2o_parm_table_get(struct i2o_device *, int, int, int, void *, int, void *, int); -/* FIXME: remove -extern int i2o_query_table(int, struct i2o_controller *, int, int, int, - void *, int, void *, int); -extern int i2o_clear_table(struct i2o_controller *, int, int); -extern int i2o_row_add_table(struct i2o_controller *, int, int, int, - void *, int); -extern int i2o_issue_params(int, struct i2o_controller *, int, void *, int, - void *, int); -*/ + +/* debugging and troubleshooting/diagnostic helpers. */ +#define osm_printk(level, format, arg...) \ + printk(level "%s: " format, OSM_NAME , ## arg) + +#ifdef DEBUG +#define osm_debug(format, arg...) \ + osm_printk(KERN_DEBUG, format , ## arg) +#else +#define osm_debug(format, arg...) \ + do { } while (0) +#endif + +#define osm_err(format, arg...) \ + osm_printk(KERN_ERR, format , ## arg) +#define osm_info(format, arg...) \ + osm_printk(KERN_INFO, format , ## arg) +#define osm_warn(format, arg...) \ + osm_printk(KERN_WARNING, format , ## arg) /* debugging functions */ extern void i2o_report_status(const char *, const char *, struct i2o_message *); diff --git a/include/linux/ide.h b/include/linux/ide.h index f11d04d235f2..567443038d9b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -723,7 +723,6 @@ typedef struct ide_drive_s { unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ u8 quirk_list; /* considered quirky, set for a specific host */ - u8 suspend_reset; /* drive suspend mode flag, soft-reset recovers */ u8 init_speed; /* transfer rate set at boot */ u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ u8 current_speed; /* current transfer rate set */ @@ -1097,9 +1096,8 @@ typedef struct ide_driver_s { int (*cleanup)(ide_drive_t *); ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); int (*end_request)(ide_drive_t *, int, int); - u8 (*sense)(ide_drive_t *, const char *, u8); - ide_startstop_t (*error)(ide_drive_t *, const char *, u8); - ide_startstop_t (*abort)(ide_drive_t *, const char *); + ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); + ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); void (*pre_reset)(ide_drive_t *); sector_t (*capacity)(ide_drive_t *); @@ -1147,12 +1145,7 @@ extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigne */ extern void ide_execute_command(ide_drive_t *, task_ioreg_t cmd, ide_handler_t *, unsigned int, ide_expiry_t *); -/* - * Error reporting, in human readable form (luxurious, but a memory hog). - * - * (drive, msg, status) - */ -byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat); +ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); /* * ide_error() takes action based on the error returned by the controller. @@ -1162,6 +1155,8 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat); */ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); +ide_startstop_t __ide_abort(ide_drive_t *, struct request *); + /* * Abort a running command on the controller triggering the abort * from a host side, non error situation @@ -1192,11 +1187,6 @@ extern void ide_fixstring(u8 *, const int, const int); extern int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); /* - * Return the current idea about the total capacity of this drive. - */ -extern sector_t current_capacity (ide_drive_t *drive); - -/* * Start a reset operation for an IDE interface. * The caller should return immediately after invoking this. */ @@ -1259,8 +1249,6 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); */ extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); -extern void try_to_flush_leftover_data(ide_drive_t *); - /* * Issue ATA command and wait for completion. * Use for implementing commands in kernel @@ -1453,12 +1441,12 @@ int __ide_dma_good_drive(ide_drive_t *); int ide_use_dma(ide_drive_t *); int __ide_dma_off(ide_drive_t *); void ide_dma_verbose(ide_drive_t *); +ide_startstop_t ide_dma_intr(ide_drive_t *); #ifdef CONFIG_BLK_DEV_IDEDMA_PCI extern int ide_build_sglist(ide_drive_t *, struct request *); extern int ide_build_dmatable(ide_drive_t *, struct request *); extern void ide_destroy_dmatable(ide_drive_t *); -extern ide_startstop_t ide_dma_intr(ide_drive_t *); extern int ide_release_dma(ide_hwif_t *); extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); @@ -1511,7 +1499,8 @@ extern int ide_dma_enable(ide_drive_t *drive); extern char *ide_xfer_verbose(u8 xfer_rate); extern void ide_toggle_bounce(ide_drive_t *drive, int on); extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); -extern byte ide_dump_atapi_status(ide_drive_t *drive, const char *msg, byte stat); + +u8 ide_dump_status(ide_drive_t *, const char *, u8); typedef struct ide_pio_timings_s { int setup_time; /* Address setup (ns) minimum */ diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 75c1a290c8c2..b5b58e9c054c 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -69,7 +69,7 @@ #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport * over Ethernet */ -#define ETH_P_EDP2 0x88A2 /* Coraid EDP2 */ +#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ /* * Non DIX types. Won't clash for 1500 types. diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index ad1e168004ee..386e1f91a1e1 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h @@ -45,6 +45,11 @@ struct tun_struct { struct fasync_struct *fasync; + unsigned long if_flags; + u8 dev_addr[ETH_ALEN]; + u32 chr_filter[2]; + u32 net_filter[2]; + #ifdef TUN_DEBUG int debug; #endif diff --git a/include/linux/in6.h b/include/linux/in6.h index 5b4e89b1ac68..f8256c582845 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -44,8 +44,10 @@ struct in6_addr * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined * in network byte order, not in host byte order as are the IPv4 equivalents */ +#if 0 extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } +#endif extern const struct in6_addr in6addr_loopback; #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } diff --git a/include/linux/init.h b/include/linux/init.h index 7a9f69992516..05c83e0521ca 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -64,8 +64,8 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -extern initcall_t __con_initcall_start, __con_initcall_end; -extern initcall_t __security_initcall_start, __security_initcall_end; +extern initcall_t __con_initcall_start[], __con_initcall_end[]; +extern initcall_t __security_initcall_start[], __security_initcall_end[]; /* Defined in init/main.c */ extern char saved_command_line[]; diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 803d8efb1c4a..714a678fc6c4 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -46,6 +46,7 @@ #define INIT_SIGNALS(sig) { \ .count = ATOMIC_INIT(1), \ + .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ .shared_pending = { \ .list = LIST_HEAD_INIT(sig.shared_pending.list), \ .signal = {{0}}}, \ @@ -88,7 +89,6 @@ extern struct group_info init_groups; .children = LIST_HEAD_INIT(tsk.children), \ .sibling = LIST_HEAD_INIT(tsk.sibling), \ .group_leader = &tsk, \ - .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\ .real_timer = { \ .function = it_real_fn \ }, \ diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 6ef18a885b96..d99e7aeb7d33 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -61,18 +61,36 @@ extern void enable_irq(unsigned int irq); * Temporary defines for UP kernels, until all code gets fixed. */ #ifndef CONFIG_SMP -# define cli() local_irq_disable() -# define sti() local_irq_enable() -# define save_flags(x) local_save_flags(x) -# define restore_flags(x) local_irq_restore(x) -# define save_and_cli(x) local_irq_save(x) -#endif +static inline void __deprecated cli(void) +{ + local_irq_disable(); +} +static inline void __deprecated sti(void) +{ + local_irq_enable(); +} +static inline void __deprecated save_flags(unsigned long *x) +{ + local_save_flags(*x); +} +#define save_flags(x) save_flags(&x); +static inline void __deprecated restore_flags(unsigned long x) +{ + local_irq_restore(x); +} + +static inline void __deprecated save_and_cli(unsigned long *x) +{ + local_irq_save(*x); +} +#define save_and_cli(x) save_and_cli(&x) +#endif /* CONFIG_SMP */ /* SoftIRQ primitives. */ #define local_bh_disable() \ - do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0) + do { add_preempt_count(SOFTIRQ_OFFSET); barrier(); } while (0) #define __local_bh_enable() \ - do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0) + do { barrier(); sub_preempt_count(SOFTIRQ_OFFSET); } while (0) extern void local_bh_enable(void); diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 2bc24f32d748..2ec265e1045f 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -253,7 +253,6 @@ static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) { msg->done(msg); } -struct ipmi_recv_msg *ipmi_alloc_recv_msg(void); struct ipmi_user_hndl { @@ -303,32 +302,6 @@ void ipmi_set_my_LUN(ipmi_user_t user, unsigned char ipmi_get_my_LUN(ipmi_user_t user); /* - * Send a command request from the given user. The address is the - * proper address for the channel type. If this is a command, then - * the message response comes back, the receive handler for this user - * will be called with the given msgid value in the recv msg. If this - * is a response to a command, then the msgid will be used as the - * sequence number for the response (truncated if necessary), so when - * sending a response you should use the sequence number you received - * in the msgid field of the received command. If the priority is > - * 0, the message will go into a high-priority queue and be sent - * first. Otherwise, it goes into a normal-priority queue. - * The user_msg_data field will be returned in any response to this - * message. - * - * Note that if you send a response (with the netfn lower bit set), - * you *will* get back a SEND_MSG response telling you what happened - * when the response was sent. You will not get back a response to - * the message itself. - */ -int ipmi_request(ipmi_user_t user, - struct ipmi_addr *addr, - long msgid, - struct kernel_ipmi_msg *msg, - void *user_msg_data, - int priority); - -/* * Like ipmi_request, but lets you specify the number of retries and * the retry time. The retries is the number of times the message * will be resent if no reply is received. If set to -1, the default @@ -351,18 +324,6 @@ int ipmi_request_settime(ipmi_user_t user, unsigned int retry_time_ms); /* - * Like ipmi_request, but lets you specify the slave return address. - */ -int ipmi_request_with_source(ipmi_user_t user, - struct ipmi_addr *addr, - long msgid, - struct kernel_ipmi_msg *msg, - void *user_msg_data, - int priority, - unsigned char source_address, - unsigned char source_lun); - -/* * Like ipmi_request, but with messages supplied. This will not * allocate any memory, and the messages may be statically allocated * (just make sure to do the "done" handling on them). Note that this @@ -381,16 +342,6 @@ int ipmi_request_supply_msgs(ipmi_user_t user, int priority); /* - * Do polling on the IPMI interface the user is attached to. This - * causes the IPMI code to do an immediate check for information from - * the driver and handle anything that is immediately pending. This - * will not block in anyway. This is useful if you need to implement - * polling from the user like you need to send periodic watchdog pings - * from a crash dump, or something like that. - */ -void ipmi_poll_interface(ipmi_user_t user); - -/* * When commands come in to the SMS, the user can register to receive * them. Only one user can be listening on a specific netfn/cmd pair * at a time, you will get an EBUSY error if the command is already @@ -420,17 +371,6 @@ void ipmi_user_set_run_to_completion(ipmi_user_t user, int val); int ipmi_set_gets_events(ipmi_user_t user, int val); /* - * Register the given user to handle all received IPMI commands. This - * will fail if anyone is registered as a command receiver or if - * another is already registered to receive all commands. NOTE THAT - * THIS IS FOR EMULATION USERS ONLY, DO NOT USER THIS FOR NORMAL - * STUFF. - */ -int ipmi_register_all_cmd_rcvr(ipmi_user_t user); -int ipmi_unregister_all_cmd_rcvr(ipmi_user_t user); - - -/* * Called when a new SMI is registered. This will also be called on * every existing interface when a new watcher is registered with * ipmi_smi_watcher_register(). @@ -463,9 +403,6 @@ unsigned int ipmi_addr_length(int addr_type); /* Validate that the given IPMI address is valid. */ int ipmi_validate_addr(struct ipmi_addr *addr, int len); -/* Return 1 if the given addresses are equal, 0 if not. */ -int ipmi_addr_equal(struct ipmi_addr *addr1, struct ipmi_addr *addr2); - #endif /* __KERNEL__ */ diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index f042ae186520..f80c4b3f84a3 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -262,14 +262,12 @@ struct raw6_sock { }; struct udp6_sock { - struct inet_sock inet; - struct udp_opt udp; + struct udp_sock udp; struct ipv6_pinfo inet6; }; struct tcp6_sock { - struct inet_sock inet; - struct tcp_opt tcp; + struct tcp_sock tcp; struct ipv6_pinfo inet6; }; diff --git a/include/linux/irq.h b/include/linux/irq.h index 20b1d9558a2b..c3ff4d101667 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -59,9 +59,10 @@ typedef struct hw_interrupt_type hw_irq_controller; * Pad this out to 32 bytes for cache and indexing reasons. */ typedef struct irq_desc { - unsigned int status; /* IRQ status */ hw_irq_controller *handler; + void *handler_data; struct irqaction *action; /* IRQ action list */ + unsigned int status; /* IRQ status */ unsigned int depth; /* nested irq disables */ unsigned int irq_count; /* For detecting broken interrupts */ unsigned int irqs_unhandled; diff --git a/include/linux/isicom.h b/include/linux/isicom.h index f9974634b833..7c6eae7f6ed7 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h @@ -125,179 +125,6 @@ typedef struct { #define ISI_TXOK 0x0001 -struct isi_board { - unsigned short base; - unsigned char irq; - unsigned char port_count; - unsigned short status; - unsigned short port_status; /* each bit represents a single port */ - unsigned short shift_count; - struct isi_port * ports; - signed char count; - unsigned char isa; -}; - -struct isi_port { - unsigned short magic; - unsigned int flags; - int count; - int blocked_open; - int close_delay; - unsigned short channel; - unsigned short status; - unsigned short closing_wait; - struct isi_board * card; - struct tty_struct * tty; - wait_queue_head_t close_wait; - wait_queue_head_t open_wait; - struct work_struct hangup_tq; - struct work_struct bh_tqueue; - unsigned char * xmit_buf; - int xmit_head; - int xmit_tail; - int xmit_cnt; -}; - - -/* - * ISI Card specific ops ... - */ - -static inline void raise_dtr(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: raise_dtr.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0504, base); - InterruptTheCard(base); - port->status |= ISI_DTR; -} - -static inline void drop_dtr(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: drop_dtr.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0404, base); - InterruptTheCard(base); - port->status &= ~ISI_DTR; -} -static inline void raise_rts(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in raise_rts.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: raise_rts.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0a04, base); - InterruptTheCard(base); - port->status |= ISI_RTS; -} -static inline void drop_rts(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in drop_rts.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: drop_rts.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0804, base); - InterruptTheCard(base); - port->status &= ~ISI_RTS; -} -static inline void raise_dtr_rts(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr_rts.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: raise_dtr_rts.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0f04, base); - InterruptTheCard(base); - port->status |= (ISI_DTR | ISI_RTS); -} -static inline void drop_dtr_rts(struct isi_port * port) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr_rts.\n"); - return; - } -#ifdef ISICOM_DEBUG_DTR_RTS - printk(KERN_DEBUG "ISICOM: drop_dtr_rts.\n"); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw(0x0c04, base); - InterruptTheCard(base); - port->status &= ~(ISI_RTS | ISI_DTR); -} - -static inline void kill_queue(struct isi_port * port, short queue) -{ - struct isi_board * card = port->card; - unsigned short base = card->base; - unsigned char channel = port->channel; - short wait=400; - while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0)); - if (wait <= 0) { - printk(KERN_WARNING "ISICOM: Card found busy in kill_queue.\n"); - return; - } -#ifdef ISICOM_DEBUG - printk(KERN_DEBUG "ISICOM: kill_queue 0x%x.\n", queue); -#endif - outw(0x8000 | (channel << card->shift_count) | 0x02 , base); - outw((queue << 8) | 0x06, base); - InterruptTheCard(base); -} - #endif /* __KERNEL__ */ #endif /* ISICOM_H */ diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 3d9451b62e5a..fbc8eb90ea6f 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -277,13 +277,15 @@ void buffer_assertion_failure(struct buffer_head *bh); #define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) #else #define __journal_expect(expr, why...) \ - do { \ - if (!(expr)) { \ + ({ \ + int val = (expr); \ + if (!val) { \ printk(KERN_ERR \ "EXT3-fs unexpected failure: %s;\n",# expr); \ - printk(KERN_ERR why); \ + printk(KERN_ERR why "\n"); \ } \ - } while (0) + val; \ + }) #define J_EXPECT(expr, why...) __journal_expect(expr, ## why) #define J_EXPECT_BH(bh, expr, why...) __journal_expect(expr, ## why) #define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) @@ -874,7 +876,7 @@ extern int journal_dirty_data (handle_t *, struct buffer_head *); extern int journal_dirty_metadata (handle_t *, struct buffer_head *); extern void journal_release_buffer (handle_t *, struct buffer_head *, int credits); -extern void journal_forget (handle_t *, struct buffer_head *); +extern int journal_forget (handle_t *, struct buffer_head *); extern void journal_sync_buffer (struct buffer_head *); extern int journal_invalidatepage(journal_t *, struct page *, unsigned long); diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 162f06ef56fe..419fc953ac16 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h @@ -3,12 +3,12 @@ * * Copyright (C) 2001-2003 Red Hat, Inc. * - * Created by David Woodhouse <dwmw2@redhat.com> + * Created by David Woodhouse <dwmw2@infradead.org> * * For licensing information, see the file 'LICENCE' in the * jffs2 directory. * - * $Id: jffs2.h,v 1.33 2004/05/25 11:31:55 havasi Exp $ + * $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $ * */ diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h index ee80d2520afb..4afc8d8c2e9e 100644 --- a/include/linux/jffs2_fs_sb.h +++ b/include/linux/jffs2_fs_sb.h @@ -1,4 +1,4 @@ -/* $Id: jffs2_fs_sb.h,v 1.45 2003/10/08 11:46:27 dwmw2 Exp $ */ +/* $Id: jffs2_fs_sb.h,v 1.48 2004/11/20 10:41:12 dwmw2 Exp $ */ #ifndef _JFFS2_FS_SB #define _JFFS2_FS_SB @@ -11,6 +11,7 @@ #include <linux/timer.h> #include <linux/wait.h> #include <linux/list.h> +#include <linux/rwsem.h> #define JFFS2_SB_FLAG_RO 1 #define JFFS2_SB_FLAG_MOUNTING 2 @@ -35,9 +36,7 @@ struct jffs2_sb_info { struct semaphore alloc_sem; /* Used to protect all the following fields, and also to protect against - out-of-order writing of nodes. - And GC. - */ + out-of-order writing of nodes. And GC. */ uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER (i.e. zero for OOB CLEANMARKER */ @@ -95,7 +94,7 @@ struct jffs2_sb_info { to an obsoleted node. I don't like this. Alternatives welcomed. */ struct semaphore erase_free_sem; -#ifdef CONFIG_JFFS2_FS_NAND +#if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC /* Write-behind buffer for NAND flash */ unsigned char *wbuf; uint32_t wbuf_ofs; @@ -103,6 +102,8 @@ struct jffs2_sb_info { uint32_t wbuf_pagesize; struct jffs2_inodirty *wbuf_inodes; + struct rw_semaphore wbuf_sem; /* Protects the write buffer */ + /* Information about out-of-band area usage... */ struct nand_oobinfo *oobinfo; uint32_t badblock_pos; diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index d45eff83b906..d882d689519a 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -70,13 +70,19 @@ /* a value TUSEC for TICK_USEC (can be set bij adjtimex) */ #define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8)) +/* some arch's have a small-data section that can be accessed register-relative + * but that can only take up to, say, 4-byte variables. jiffies being part of + * an 8-byte variable may not be correctly accessed unless we force the issue + */ +#define __jiffy_data __attribute__((section(".data"))) + /* * The 64-bit value is not volatile - you MUST NOT read it * without sampling the sequence number in xtime_lock. * get_jiffies_64() will do this for you as appropriate. */ -extern u64 jiffies_64; -extern unsigned long volatile jiffies; +extern u64 __jiffy_data jiffies_64; +extern unsigned long volatile __jiffy_data jiffies; #if (BITS_PER_LONG < 64) u64 get_jiffies_64(void); diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 1d33d8dcbc1b..806491a0ab59 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -16,6 +16,8 @@ #include <asm/byteorder.h> #include <asm/bug.h> +extern const char linux_banner[]; + #define INT_MAX ((int)(~0U>>1)) #define INT_MIN (-INT_MAX - 1) #define UINT_MAX (~0U) @@ -134,6 +136,7 @@ static inline void console_verbose(void) extern void bust_spinlocks(int yes); extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ +extern int panic_timeout; extern int panic_on_oops; extern int tainted; extern const char *print_tainted(void); diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 4594ccc4a7c1..dba27749b428 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -6,6 +6,7 @@ #include <linux/smp.h> #include <linux/threads.h> #include <linux/percpu.h> +#include <asm/cputime.h> /* * 'kernel_stat.h' contains the definitions needed for doing @@ -14,13 +15,14 @@ */ struct cpu_usage_stat { - u64 user; - u64 nice; - u64 system; - u64 softirq; - u64 irq; - u64 idle; - u64 iowait; + cputime64_t user; + cputime64_t nice; + cputime64_t system; + cputime64_t softirq; + cputime64_t irq; + cputime64_t idle; + cputime64_t iowait; + cputime64_t steal; }; struct kernel_stat { @@ -50,4 +52,8 @@ static inline int kstat_irqs(int irq) return sum; } +extern void account_user_time(struct task_struct *, cputime_t); +extern void account_system_time(struct task_struct *, int, cputime_t); +extern void account_steal_time(struct task_struct *, cputime_t); + #endif /* _LINUX_KERNEL_STAT_H */ diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 187ac79e1f17..c22c8724a8dc 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -167,6 +167,8 @@ struct subsystem _varname##_subsys = { \ } \ } +/* The global /sys/kernel/ subsystem for people to chain off of */ +extern struct subsystem kernel_subsys; /** * Helpers for setting the kset of registered objects. diff --git a/include/linux/lcd.h b/include/linux/lcd.h new file mode 100644 index 000000000000..d739b2e7eac2 --- /dev/null +++ b/include/linux/lcd.h @@ -0,0 +1,56 @@ +/* + * LCD Lowlevel Control Abstraction + * + * Copyright (C) 2003,2004 Hewlett-Packard Company + * + */ + +#ifndef _LINUX_LCD_H +#define _LINUX_LCD_H + +#include <linux/device.h> +#include <linux/notifier.h> + +struct lcd_device; +struct fb_info; + +/* This structure defines all the properties of a LCD flat panel. */ +struct lcd_properties { + /* Owner module */ + struct module *owner; + /* Get the LCD panel power status (0: full on, 1..3: controller + power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ + int (*get_power)(struct lcd_device *); + /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ + int (*set_power)(struct lcd_device *, int power); + /* The maximum value for contrast (read-only) */ + int max_contrast; + /* Get the current contrast setting (0-max_contrast) */ + int (*get_contrast)(struct lcd_device *); + /* Set LCD panel contrast */ + int (*set_contrast)(struct lcd_device *, int contrast); + /* Check if given framebuffer device is the one LCD is bound to; + return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ + int (*check_fb)(struct fb_info *); +}; + +struct lcd_device { + /* This protects the 'props' field. If 'props' is NULL, the driver that + registered this device has been unloaded, and if class_get_devdata() + points to something in the body of that driver, it is also invalid. */ + struct semaphore sem; + /* If this is NULL, the backing module is unloaded */ + struct lcd_properties *props; + /* The framebuffer notifier block */ + struct notifier_block fb_notif; + /* The class device structure */ + struct class_device class_dev; +}; + +extern struct lcd_device *lcd_device_register(const char *name, + void *devdata, struct lcd_properties *lp); +extern void lcd_device_unregister(struct lcd_device *ld); + +#define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) + +#endif diff --git a/include/linux/list.h b/include/linux/list.h index 7cad5322077c..dd7cd54fa831 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -326,8 +326,8 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = pos->next, prefetch(pos->next)) + for (pos = (head)->next; prefetch(pos->next), pos != (head); \ + pos = pos->next) /** * __list_for_each - iterate over a list @@ -348,8 +348,8 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ - for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ - pos = pos->prev, prefetch(pos->prev)) + for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ + pos = pos->prev) /** * list_for_each_safe - iterate over a list safe against removal of list entry @@ -368,11 +368,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + for (pos = list_entry((head)->next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_reverse - iterate backwards over list of given type. @@ -381,11 +379,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_reverse(pos, head, member) \ - for (pos = list_entry((head)->prev, typeof(*pos), member), \ - prefetch(pos->member.prev); \ - &pos->member != (head); \ - pos = list_entry(pos->member.prev, typeof(*pos), member), \ - prefetch(pos->member.prev)) + for (pos = list_entry((head)->prev, typeof(*pos), member); \ + prefetch(pos->member.prev), &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) /** * list_prepare_entry - prepare a pos entry for use as a start point in @@ -405,11 +401,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_continue(pos, head, member) \ - for (pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + for (pos = list_entry(pos->member.next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry @@ -434,8 +428,8 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_rcu(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = rcu_dereference(pos->next), prefetch(pos->next)) + for (pos = (head)->next; prefetch(pos->next), pos != (head); \ + pos = rcu_dereference(pos->next)) #define __list_for_each_rcu(pos, head) \ for (pos = (head)->next; pos != (head); \ @@ -467,12 +461,10 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_entry_rcu(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ pos = rcu_dereference(list_entry(pos->member.next, \ - typeof(*pos), member)), \ - prefetch(pos->member.next)) + typeof(*pos), member))) /** @@ -486,8 +478,8 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_continue_rcu(pos, head) \ - for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \ - (pos) = rcu_dereference((pos)->next), prefetch((pos)->next)) + for ((pos) = (pos)->next; prefetch((pos)->next), (pos) != (head); \ + (pos) = rcu_dereference((pos)->next)) /* * Double linked lists with a single pointer list head. diff --git a/include/linux/lp.h b/include/linux/lp.h index 521bcd2fecb1..7059b6b9878a 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -186,12 +186,6 @@ struct lp_struct { */ #define LP_DELAY 50 -/* - * function prototypes - */ - -extern int lp_init(void); - #endif #endif diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index 15a806ad61ee..8e5a10410a30 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h @@ -7,39 +7,22 @@ /* Hardwire the number of additional indexes */ #define MB_CACHE_INDEXES_COUNT 1 -struct mb_cache_entry; - -struct mb_cache_op { - int (*free)(struct mb_cache_entry *, int); -}; - -struct mb_cache { - struct list_head c_cache_list; - const char *c_name; - struct mb_cache_op c_op; - atomic_t c_entry_count; - int c_bucket_bits; -#ifndef MB_CACHE_INDEXES_COUNT - int c_indexes_count; -#endif - kmem_cache_t *c_entry_cache; - struct list_head *c_block_hash; - struct list_head *c_indexes_hash[0]; -}; - -struct mb_cache_entry_index { - struct list_head o_list; - unsigned int o_key; -}; - struct mb_cache_entry { struct list_head e_lru_list; struct mb_cache *e_cache; - atomic_t e_used; + unsigned short e_used; + unsigned short e_queued; struct block_device *e_bdev; sector_t e_block; struct list_head e_block_list; - struct mb_cache_entry_index e_indexes[0]; + struct { + struct list_head o_list; + unsigned int o_key; + } e_indexes[0]; +}; + +struct mb_cache_op { + int (*free)(struct mb_cache_entry *, int); }; /* Functions on caches */ @@ -54,7 +37,6 @@ void mb_cache_destroy(struct mb_cache *); struct mb_cache_entry *mb_cache_entry_alloc(struct mb_cache *); int mb_cache_entry_insert(struct mb_cache_entry *, struct block_device *, sector_t, unsigned int[]); -void mb_cache_entry_rehash(struct mb_cache_entry *, unsigned int[]); void mb_cache_entry_release(struct mb_cache_entry *); void mb_cache_entry_free(struct mb_cache_entry *); struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *, diff --git a/include/linux/mca-legacy.h b/include/linux/mca-legacy.h index ae5d7bda2773..f2bb770e530a 100644 --- a/include/linux/mca-legacy.h +++ b/include/linux/mca-legacy.h @@ -34,10 +34,6 @@ extern int mca_find_adapter(int id, int start); extern int mca_find_unused_adapter(int id, int start); -/* adapter state info - returns 0 if no */ -extern int mca_isadapter(int slot); -extern int mca_isenabled(int slot); - extern int mca_is_adapter_used(int slot); extern int mca_mark_as_used(int slot); extern void mca_mark_as_unused(int slot); @@ -50,7 +46,6 @@ extern unsigned char mca_read_stored_pos(int slot, int reg); * so we can have a more interesting /proc/mca. */ extern void mca_set_adapter_name(int slot, char* name); -extern char* mca_get_adapter_name(int slot); /* These routines actually mess with the hardware POS registers. They * temporarily disable the device (and interrupts), so make sure you know diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 209f6ffbd588..14ceebfc1efa 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -31,14 +31,15 @@ #define HPET_MINOR 228 struct device; +struct class_device; -struct miscdevice -{ +struct miscdevice { int minor; const char *name; struct file_operations *fops; struct list_head list; struct device *dev; + struct class_device *class; char devfs_name[64]; }; diff --git a/include/linux/mm.h b/include/linux/mm.h index 7b299240d5f3..75f5b8ed7231 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -85,7 +85,7 @@ struct vm_area_struct { struct vm_area_struct *head; } vm_set; - struct prio_tree_node prio_tree_node; + struct raw_prio_tree_node prio_tree_node; } shared; /* @@ -105,13 +105,34 @@ struct vm_area_struct { units, *not* PAGE_CACHE_SIZE */ struct file * vm_file; /* File we map to (can be NULL). */ void * vm_private_data; /* was vm_pte (shared mem) */ + unsigned long vm_truncate_count;/* truncate_count or restart_addr */ +#ifndef CONFIG_MMU + atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */ +#endif #ifdef CONFIG_NUMA struct mempolicy *vm_policy; /* NUMA policy for the VMA */ #endif }; /* + * This struct defines the per-mm list of VMAs for uClinux. If CONFIG_MMU is + * disabled, then there's a single shared list of VMAs maintained by the + * system, and mm's subscribe to these individually + */ +struct vm_list_struct { + struct vm_list_struct *next; + struct vm_area_struct *vma; +}; + +#ifndef CONFIG_MMU +extern struct rb_root nommu_vma_tree; +extern struct rw_semaphore nommu_vma_sem; + +extern unsigned int kobjsize(const void *objp); +#endif + +/* * vm_flags.. */ #define VM_READ 0x00000001 /* currently active flags */ @@ -211,6 +232,8 @@ struct page { * usually used for buffer_heads * if PagePrivate set; used for * swp_entry_t if PageSwapCache + * When page is free, this indicates + * order in the buddy system. */ struct address_space *mapping; /* If low bit clear, points to * inode address_space, or NULL. @@ -557,7 +580,9 @@ struct zap_details { struct address_space *check_mapping; /* Check page->mapping if set */ pgoff_t first_index; /* Lowest page->index to unmap */ pgoff_t last_index; /* Highest page->index to unmap */ - int atomic; /* May not schedule() */ + spinlock_t *i_mmap_lock; /* For unmap_mapping_range: */ + unsigned long break_addr; /* Where unmap_vmas stopped */ + unsigned long truncate_count; /* Compare vm_truncate_count */ }; void zap_page_range(struct vm_area_struct *vma, unsigned long address, @@ -603,6 +628,10 @@ int FASTCALL(set_page_dirty(struct page *page)); int set_page_dirty_lock(struct page *page); int clear_page_dirty_for_io(struct page *page); +extern unsigned long do_mremap(unsigned long addr, + unsigned long old_len, unsigned long new_len, + unsigned long flags, unsigned long new_addr); + /* * Prototype to add a shrinker callback for ageable caches. * @@ -635,6 +664,7 @@ extern void remove_shrinker(struct shrinker *shrinker); * The following ifdef needed to get the 4level-fixup.h header to work. * Remove it when 4level-fixup.h has been removed. */ +#ifdef CONFIG_MMU #ifndef __ARCH_HAS_4LEVEL_HACK static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) { @@ -650,6 +680,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a return pmd_offset(pud, address); } #endif +#endif /* CONFIG_MMU */ extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, pg_data_t *pgdat, @@ -680,6 +711,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma, } /* mmap.c */ +extern int __vm_enough_memory(long pages, int cap_sys_admin); extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); extern struct vm_area_struct *vma_merge(struct mm_struct *, @@ -778,16 +810,10 @@ extern struct page * vmalloc_to_page(void *addr); extern unsigned long vmalloc_to_pfn(void *addr); extern struct page * follow_page(struct mm_struct *mm, unsigned long address, int write); +extern int check_user_page_readable(struct mm_struct *mm, unsigned long address); int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, unsigned long, pgprot_t); -static inline __deprecated /* since 25 Sept 2004 -- wli */ -int remap_page_range(struct vm_area_struct *vma, unsigned long uvaddr, - unsigned long paddr, unsigned long size, pgprot_t prot) -{ - return remap_pfn_range(vma, uvaddr, paddr >> PAGE_SHIFT, size, prot); -} - #ifdef CONFIG_PROC_FS void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); #else @@ -809,6 +835,9 @@ static inline void vm_stat_unaccount(struct vm_area_struct *vma) -vma_pages(vma)); } +/* update per process rss and vm hiwater data */ +extern void update_mem_hiwater(void); + #ifndef CONFIG_DEBUG_PAGEALLOC static inline void kernel_map_pages(struct page *page, int numpages, int enable) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e048bbcacf67..1d46bd35ab78 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -22,7 +22,6 @@ struct free_area { struct list_head free_list; - unsigned long *map; unsigned long nr_free; }; @@ -272,7 +271,6 @@ typedef struct pglist_data { #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; void __get_zone_counts(unsigned long *active, unsigned long *inactive, @@ -311,7 +309,7 @@ static inline struct zone *next_zone(struct zone *zone) { pg_data_t *pgdat = zone->zone_pgdat; - if (zone - pgdat->node_zones < MAX_NR_ZONES - 1) + if (zone < pgdat->node_zones + MAX_NR_ZONES - 1) zone++; else if (pgdat->pgdat_next) { pgdat = pgdat->pgdat_next; @@ -357,12 +355,12 @@ static inline int is_normal_idx(int idx) */ static inline int is_highmem(struct zone *zone) { - return (is_highmem_idx(zone - zone->zone_pgdat->node_zones)); + return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; } static inline int is_normal(struct zone *zone) { - return (is_normal_idx(zone - zone->zone_pgdat->node_zones)); + return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; } /* These two functions are used to setup the per zone pages min values */ @@ -375,7 +373,7 @@ int lower_zone_protection_sysctl_handler(struct ctl_table *, int, struct file *, #include <linux/topology.h> /* Returns the number of the current Node. */ -#define numa_node_id() (cpu_to_node(smp_processor_id())) +#define numa_node_id() (cpu_to_node(_smp_processor_id())) #ifndef CONFIG_DISCONTIGMEM diff --git a/include/linux/module.h b/include/linux/module.h index c8dd7b8495c6..7c66600fc66b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -48,8 +48,9 @@ struct module; struct module_attribute { struct attribute attr; - ssize_t (*show)(struct module *, char *); - ssize_t (*store)(struct module *, const char *, size_t count); + ssize_t (*show)(struct module_attribute *, struct module *, char *); + ssize_t (*store)(struct module_attribute *, struct module *, + const char *, size_t count); }; struct module_kobject @@ -206,10 +207,6 @@ void *__symbol_get_gpl(const char *symbol); #endif -/* We don't mangle the actual symbol anymore, so no need for - * special casing EXPORT_SYMBOL_NOVERS. FIXME: Deprecated */ -#define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym) - struct module_ref { local_t count; @@ -226,18 +223,18 @@ enum module_state #define MODULE_SECT_NAME_LEN 32 struct module_sect_attr { - struct attribute attr; + struct module_attribute mattr; char name[MODULE_SECT_NAME_LEN]; unsigned long address; }; -struct module_sections +struct module_sect_attrs { - struct kobject kobj; + struct attribute_group grp; struct module_sect_attr attrs[0]; }; -struct param_kobject; +struct module_param_attrs; struct module { @@ -250,8 +247,8 @@ struct module char name[MODULE_NAME_LEN]; /* Sysfs stuff. */ - struct module_kobject *mkobj; - struct param_kobject *params_kobject; + struct module_kobject mkobj; + struct module_param_attrs *param_attrs; /* Exported symbols */ const struct kernel_symbol *syms; @@ -312,7 +309,7 @@ struct module char *strtab; /* Section attributes */ - struct module_sections *sect_attrs; + struct module_sect_attrs *sect_attrs; #endif /* Per-cpu data. */ @@ -449,7 +446,6 @@ void module_remove_driver(struct device_driver *); #else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL(sym) #define EXPORT_SYMBOL_GPL(sym) -#define EXPORT_SYMBOL_NOVERS(sym) /* Given an address, look for it in the exception tables. */ static inline const struct exception_table_entry * diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index ba4b0d649661..2ed8c585021e 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -1,7 +1,7 @@ /* Common Flash Interface structures * See http://support.intel.com/design/flash/technote/index.htm - * $Id: cfi.h,v 1.49 2004/11/15 20:56:32 nico Exp $ + * $Id: cfi.h,v 1.50 2004/11/20 12:46:51 dwmw2 Exp $ */ #ifndef __MTD_CFI_H__ @@ -349,14 +349,12 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr) static inline void cfi_udelay(int us) { - unsigned long t = us * HZ / 1000000; - if (t) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(t); - return; + if (us >= 1000) { + msleep((us+999)/1000); + } else { + udelay(us); + cond_resched(); } - udelay(us); - cond_resched(); } static inline void cfi_spin_lock(spinlock_t *mutex) diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 42646922b032..953e64fb8ac5 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h @@ -6,7 +6,7 @@ * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> * Copyright (C) 2002-2003 SnapGear Inc * - * $Id: doc2000.h,v 1.23 2004/09/16 23:26:08 gleixner Exp $ + * $Id: doc2000.h,v 1.24 2005/01/05 12:40:38 dwmw2 Exp $ * * Released under GPL */ diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index c3ac4df7273f..c66ba812bf90 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h @@ -6,7 +6,7 @@ * * (C) 2000 Red Hat. GPLd. * - * $Id: flashchip.h,v 1.14 2004/06/15 16:44:59 nico Exp $ + * $Id: flashchip.h,v 1.15 2004/11/05 22:41:06 nico Exp $ * */ @@ -37,6 +37,8 @@ typedef enum { FL_LOCKING, FL_UNLOCKING, FL_POINT, + FL_XIP_WHILE_ERASING, + FL_XIP_WHILE_WRITING, FL_UNKNOWN } flstate_t; diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h index f6208098660c..3d7bdec14f97 100644 --- a/include/linux/mtd/gen_probe.h +++ b/include/linux/mtd/gen_probe.h @@ -1,7 +1,7 @@ /* * (C) 2001, 2001 Red Hat, Inc. * GPL'd - * $Id: gen_probe.h,v 1.2 2003/11/08 00:51:21 dsaxena Exp $ + * $Id: gen_probe.h,v 1.3 2004/10/20 22:10:33 dwmw2 Exp $ */ #ifndef __LINUX_MTD_GEN_PROBE_H__ diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index a960be2cc33c..f0268b99c900 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -1,6 +1,6 @@ /* Overhauled routines for dealing with different mmap regions of flash */ -/* $Id: map.h,v 1.45 2004/09/21 14:31:17 bjd Exp $ */ +/* $Id: map.h,v 1.46 2005/01/05 17:09:44 dwmw2 Exp $ */ #ifndef __LINUX_MTD_MAP_H__ #define __LINUX_MTD_MAP_H__ @@ -322,7 +322,7 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig bitpos = (map_bankwidth(map)-1-i)*8; #endif orig.x[0] &= ~(0xff << bitpos); - orig.x[0] |= buf[i] << bitpos; + orig.x[0] |= buf[i-start] << bitpos; } } return orig; diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 9453cb58c683..9a19c65abd74 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -5,7 +5,7 @@ * Steven J. Hill <sjhill@realitydiluted.com> * Thomas Gleixner <tglx@linutronix.de> * - * $Id: nand.h,v 1.66 2004/10/02 10:07:08 gleixner Exp $ + * $Id: nand.h,v 1.68 2004/11/12 10:40:37 gleixner Exp $ * * 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 @@ -138,6 +138,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ #define NAND_ECC_HW6_512 4 /* Hardware ECC 8 byte ECC per 512 Byte data */ #define NAND_ECC_HW8_512 6 +/* Hardware ECC 12 byte ECC per 2048 Byte data */ +#define NAND_ECC_HW12_2048 7 /* * Constants for Hardware ECC @@ -253,6 +255,7 @@ struct nand_hw_control { * @scan_bbt: [REPLACEABLE] function to scan bad block table * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines * @eccsize: [INTERN] databytes used per ecc-calculation + * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step * @eccsteps: [INTERN] number of ecc calculation steps per page * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip @@ -277,6 +280,7 @@ struct nand_hw_control { * @bbt: [INTERN] bad block table pointer * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup * @bbt_md: [REPLACEABLE] bad block table mirror descriptor + * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices * @priv: [OPTIONAL] pointer to private chip date */ @@ -307,6 +311,7 @@ struct nand_chip { int (*scan_bbt)(struct mtd_info *mtd); int eccmode; int eccsize; + int eccbytes; int eccsteps; int chip_delay; spinlock_t chip_lock; @@ -330,6 +335,7 @@ struct nand_chip { uint8_t *bbt; struct nand_bbt_descr *bbt_td; struct nand_bbt_descr *bbt_md; + struct nand_bbt_descr *badblock_pattern; struct nand_hw_control *controller; void *priv; }; diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h new file mode 100644 index 000000000000..fc071125cbcc --- /dev/null +++ b/include/linux/mtd/xip.h @@ -0,0 +1,107 @@ +/* + * MTD primitives for XIP support + * + * Author: Nicolas Pitre + * Created: Nov 2, 2004 + * Copyright: (C) 2004 MontaVista Software, Inc. + * + * This XIP support for MTD has been loosely inspired + * by an earlier patch authored by David Woodhouse. + * + * 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. + * + * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $ + */ + +#ifndef __LINUX_MTD_XIP_H__ +#define __LINUX_MTD_XIP_H__ + +#include <linux/config.h> + +#ifdef CONFIG_MTD_XIP + +/* + * Function that are modifying the flash state away from array mode must + * obviously not be running from flash. The __xipram is therefore marking + * those functions so they get relocated to ram. + */ +#define __xipram __attribute__ ((__section__ (".data"))) + +/* + * We really don't want gcc to guess anything. + * We absolutely _need_ proper inlining. + */ +#include <linux/compiler.h> + +/* + * Each architecture has to provide the following macros. They must access + * the hardware directly and not rely on any other (XIP) functions since they + * won't be available when used (flash not in array mode). + * + * xip_irqpending() + * + * return non zero when any hardware interrupt is pending. + * + * xip_currtime() + * + * return a platform specific time reference to be used with + * xip_elapsed_since(). + * + * xip_elapsed_since(x) + * + * return in usecs the elapsed timebetween now and the reference x as + * returned by xip_currtime(). + * + * note 1: convertion to usec can be approximated, as long as the + * returned value is <= the real elapsed time. + * note 2: this should be able to cope with a few seconds without + * overflowing. + */ + +#if defined(CONFIG_ARCH_SA1100) || defined(CONFIG_ARCH_PXA) + +#include <asm/hardware.h> +#ifdef CONFIG_ARCH_PXA +#include <asm/arch/pxa-regs.h> +#endif + +#define xip_irqpending() (ICIP & ICMR) + +/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */ +#define xip_currtime() (OSCR) +#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4) + +#else + +#warning "missing IRQ and timer primitives for XIP MTD support" +#warning "some of the XIP MTD support code will be disabled" +#warning "your system will therefore be unresponsive when writing or erasing flash" + +#define xip_irqpending() (0) +#define xip_currtime() (0) +#define xip_elapsed_since(x) (0) + +#endif + +/* + * xip_cpu_idle() is used when waiting for a delay equal or larger than + * the system timer tick period. This should put the CPU into idle mode + * to save power and to be woken up only when some interrupts are pending. + * As above, this should not rely upon standard kernel code. + */ + +#if defined(CONFIG_CPU_XSCALE) +#define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1)) +#else +#define xip_cpu_idle() do { } while (0) +#endif + +#else + +#define __xipram + +#endif /* CONFIG_MTD_XIP */ + +#endif /* __LINUX_MTD_XIP_H__ */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 871bcbdf2abd..fca36de5e3fc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -522,7 +522,6 @@ extern struct net_device loopback_dev; /* The loopback */ extern struct net_device *dev_base; /* All devices */ extern rwlock_t dev_base_lock; /* Device list lock */ -extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index b0ee19e302de..0c267c89fa3e 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -175,10 +175,6 @@ extern void nf_reinject(struct sk_buff *skb, extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); -#ifdef CONFIG_NETFILTER_DEBUG -extern void nf_dump_skb(int pf, struct sk_buff *skb); -#endif - /* FIXME: Before cache is ever used, this must be implemented for real. */ extern void nf_invalidate_cache(int pf); diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index d6a7188b525c..b16b4799e27e 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h @@ -312,9 +312,6 @@ struct arpt_table /* A unique name... */ char name[ARPT_TABLE_MAXNAMELEN]; - /* Seed table: copied in register_table */ - struct arpt_replace *table; - /* What hooks you will enter on */ unsigned int valid_hooks; @@ -328,7 +325,8 @@ struct arpt_table struct module *me; }; -extern int arpt_register_table(struct arpt_table *table); +extern int arpt_register_table(struct arpt_table *table, + const struct arpt_replace *repl); extern void arpt_unregister_table(struct arpt_table *table); extern unsigned int arpt_do_table(struct sk_buff **pskb, unsigned int hook, diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 72945cf62370..b88b52c33db7 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h @@ -224,9 +224,8 @@ struct ip_conntrack /* get master conntrack via master expectation */ #define master_ct(conntr) (conntr->master ? conntr->master->expectant : NULL) -/* Alter reply tuple (maybe alter helper). If it's already taken, - return 0 and don't do alteration. */ -extern int +/* Alter reply tuple (maybe alter helper). */ +extern void ip_conntrack_alter_reply(struct ip_conntrack *conntrack, const struct ip_conntrack_tuple *newreply); diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 16fc49298174..06e5ad38683e 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h @@ -41,10 +41,10 @@ struct ip_nat_range union ip_conntrack_manip_proto min, max; }; -/* A range consists of an array of 1 or more ip_nat_range */ -struct ip_nat_multi_range +/* For backwards compat: don't use in modern code. */ +struct ip_nat_multi_range_compat { - unsigned int rangesize; + unsigned int rangesize; /* Must be 1. */ /* hangs off end. */ struct ip_nat_range range[1]; @@ -86,7 +86,7 @@ struct ip_nat_info /* Manipulations to be done on this conntrack. */ struct ip_nat_info_manip manips[IP_NAT_MAX_MANIPS]; - struct list_head bysource, byipsproto; + struct list_head bysource; /* Helper (NULL if none). */ struct ip_nat_helper *helper; @@ -96,7 +96,7 @@ struct ip_nat_info /* Set up the info structure to map into this range. */ extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack, - const struct ip_nat_multi_range *mr, + const struct ip_nat_range *range, unsigned int hooknum); /* Is this tuple already taken? (not by us)*/ @@ -107,5 +107,7 @@ extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple, extern u_int16_t ip_nat_cheat_check(u_int32_t oldvalinv, u_int32_t newval, u_int16_t oldcheck); +#else /* !__KERNEL__: iptables wants this to compile. */ +#define ip_nat_multi_range ip_nat_multi_range_compat #endif /*__KERNEL__*/ #endif diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 642fb5c614cb..91f3594d3bfd 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -53,7 +53,9 @@ struct ipt_entry_match u_int16_t match_size; /* Used by userspace */ - char name[IPT_FUNCTION_MAXNAMELEN]; + char name[IPT_FUNCTION_MAXNAMELEN-1]; + + u_int8_t revision; } user; struct { u_int16_t match_size; @@ -76,7 +78,9 @@ struct ipt_entry_target u_int16_t target_size; /* Used by userspace */ - char name[IPT_FUNCTION_MAXNAMELEN]; + char name[IPT_FUNCTION_MAXNAMELEN-1]; + + u_int8_t revision; } user; struct { u_int16_t target_size; @@ -152,9 +156,11 @@ struct ipt_entry #define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1) #define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS -#define IPT_SO_GET_INFO (IPT_BASE_CTL) -#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) -#define IPT_SO_GET_MAX IPT_SO_GET_ENTRIES +#define IPT_SO_GET_INFO (IPT_BASE_CTL) +#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) +#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2) +#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) +#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET /* CONTINUE verdict for targets */ #define IPT_CONTINUE 0xFFFFFFFF @@ -284,6 +290,15 @@ struct ipt_get_entries struct ipt_entry entrytable[0]; }; +/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision + * kernel supports, if >= revision. */ +struct ipt_get_revision +{ + char name[IPT_FUNCTION_MAXNAMELEN-1]; + + u_int8_t revision; +}; + /* Standard return verdict, or do jump. */ #define IPT_STANDARD_TARGET "" /* Error verdict. */ @@ -344,7 +359,9 @@ struct ipt_match { struct list_head list; - const char name[IPT_FUNCTION_MAXNAMELEN]; + const char name[IPT_FUNCTION_MAXNAMELEN-1]; + + u_int8_t revision; /* Return true or false: return FALSE and set *hotdrop = 1 to force immediate packet drop. */ @@ -378,7 +395,9 @@ struct ipt_target { struct list_head list; - const char name[IPT_FUNCTION_MAXNAMELEN]; + const char name[IPT_FUNCTION_MAXNAMELEN-1]; + + u_int8_t revision; /* Called when user tries to insert an entry of this type: hook_mask is a bitmask of hooks from which it can be @@ -413,10 +432,6 @@ extern void ipt_unregister_target(struct ipt_target *target); extern int ipt_register_match(struct ipt_match *match); extern void ipt_unregister_match(struct ipt_match *match); -extern struct ipt_target * -__ipt_find_target_lock(const char *name, int *error); -extern void __ipt_mutex_up(void); - /* Furniture shopping... */ struct ipt_table { @@ -425,9 +440,6 @@ struct ipt_table /* A unique name... */ char name[IPT_TABLE_MAXNAMELEN]; - /* Seed table: copied in register_table */ - struct ipt_replace *table; - /* What hooks you will enter on */ unsigned int valid_hooks; @@ -441,7 +453,30 @@ struct ipt_table struct module *me; }; -extern int ipt_register_table(struct ipt_table *table); +/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */ +extern struct ipt_target *ipt_find_target(const char *name, u8 revision); + +/* Standard entry. */ +struct ipt_standard +{ + struct ipt_entry entry; + struct ipt_standard_target target; +}; + +struct ipt_error_target +{ + struct ipt_entry_target target; + char errorname[IPT_FUNCTION_MAXNAMELEN]; +}; + +struct ipt_error +{ + struct ipt_entry entry; + struct ipt_error_target target; +}; + +extern int ipt_register_table(struct ipt_table *table, + const struct ipt_replace *repl); extern void ipt_unregister_table(struct ipt_table *table); extern unsigned int ipt_do_table(struct sk_buff **pskb, unsigned int hook, diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h index 481e12846208..d25f782e57d1 100644 --- a/include/linux/netfilter_ipv4/ipt_LOG.h +++ b/include/linux/netfilter_ipv4/ipt_LOG.h @@ -4,7 +4,8 @@ #define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ #define IPT_LOG_IPOPT 0x04 /* Log IP options */ -#define IPT_LOG_MASK 0x07 +#define IPT_LOG_UID 0x08 /* Log UID owning local socket */ +#define IPT_LOG_MASK 0x0f struct ipt_log_info { unsigned char level; diff --git a/include/linux/netfilter_ipv4/ipt_MARK.h b/include/linux/netfilter_ipv4/ipt_MARK.h index cc57ae7a3416..f47485790ed4 100644 --- a/include/linux/netfilter_ipv4/ipt_MARK.h +++ b/include/linux/netfilter_ipv4/ipt_MARK.h @@ -1,8 +1,20 @@ #ifndef _IPT_MARK_H_target #define _IPT_MARK_H_target +/* Version 0 */ struct ipt_mark_target_info { unsigned long mark; }; +/* Version 1 */ +enum { + IPT_MARK_SET=0, + IPT_MARK_AND, + IPT_MARK_OR +}; + +struct ipt_mark_target_info_v1 { + unsigned long mark; + u_int8_t mode; +}; #endif /*_IPT_MARK_H_target*/ diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h index f6e50ae92793..1b7c85072799 100644 --- a/include/linux/netfilter_ipv4/ipt_multiport.h +++ b/include/linux/netfilter_ipv4/ipt_multiport.h @@ -18,4 +18,12 @@ struct ipt_multiport u_int8_t count; /* Number of ports */ u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ }; + +struct ipt_multiport_v1 +{ + u_int8_t flags; /* Type of comparison */ + u_int8_t count; /* Number of ports */ + u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ + u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */ +}; #endif /*_IPT_MULTIPORT_H*/ diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index d6ac08c14dc1..8fa1bf0104ee 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h @@ -429,9 +429,6 @@ struct ip6t_table /* A unique name... */ char name[IP6T_TABLE_MAXNAMELEN]; - /* Seed table: copied in register_table */ - struct ip6t_replace *table; - /* What hooks you will enter on */ unsigned int valid_hooks; @@ -445,7 +442,8 @@ struct ip6t_table struct module *me; }; -extern int ip6t_register_table(struct ip6t_table *table); +extern int ip6t_register_table(struct ip6t_table *table, + const struct ip6t_replace *repl); extern void ip6t_unregister_table(struct ip6t_table *table); extern unsigned int ip6t_do_table(struct sk_buff **pskb, unsigned int hook, diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h index 0646a107702a..42996a43bb39 100644 --- a/include/linux/netfilter_ipv6/ip6t_LOG.h +++ b/include/linux/netfilter_ipv6/ip6t_LOG.h @@ -4,7 +4,8 @@ #define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ -#define IP6T_LOG_MASK 0x07 +#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ +#define IP6T_LOG_MASK 0x0f struct ip6t_log_info { unsigned char level; diff --git a/include/linux/netlink.h b/include/linux/netlink.h index ee36f08c341e..9cad6dfd86b0 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -116,7 +116,6 @@ struct netlink_skb_parms #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) -extern int netlink_post(int unit, struct sk_buff *skb); extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len)); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index a9e4817c416e..ccf1ccb80972 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -24,7 +24,6 @@ struct netpoll { }; void netpoll_poll(struct netpoll *np); -void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); void netpoll_send_udp(struct netpoll *np, const char *msg, int len); int netpoll_parse_options(struct netpoll *np, char *opt); int netpoll_setup(struct netpoll *np); diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 0ccc263aacf5..542466ca4d69 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -30,6 +30,7 @@ #include <linux/nfs_xdr.h> #include <linux/rwsem.h> #include <linux/workqueue.h> +#include <linux/mempool.h> /* * Enable debugging support for nfs client. @@ -201,6 +202,7 @@ struct nfs_inode { #define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */ #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ +#define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ static inline struct nfs_inode *NFS_I(struct inode *inode) { @@ -239,7 +241,7 @@ static inline int nfs_caches_unstable(struct inode *inode) static inline void NFS_CACHEINV(struct inode *inode) { if (!nfs_caches_unstable(inode)) - NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR; + NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; } static inline int nfs_server_capable(struct inode *inode, int cap) @@ -424,6 +426,44 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page) return nfs_wb_page_priority(inode, page, 0); } +/* + * Allocate and free nfs_write_data structures + */ +extern mempool_t *nfs_wdata_mempool; +extern mempool_t *nfs_commit_mempool; + +static inline struct nfs_write_data *nfs_writedata_alloc(void) +{ + struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS); + if (p) { + memset(p, 0, sizeof(*p)); + INIT_LIST_HEAD(&p->pages); + } + return p; +} + +static inline void nfs_writedata_free(struct nfs_write_data *p) +{ + mempool_free(p, nfs_wdata_mempool); +} + +extern void nfs_writedata_release(struct rpc_task *task); + +static inline struct nfs_write_data *nfs_commit_alloc(void) +{ + struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, SLAB_NOFS); + if (p) { + memset(p, 0, sizeof(*p)); + INIT_LIST_HEAD(&p->pages); + } + return p; +} + +static inline void nfs_commit_free(struct nfs_write_data *p) +{ + mempool_free(p, nfs_commit_mempool); +} + /* Hack for future NFS swap support */ #ifndef IS_SWAPFILE # define IS_SWAPFILE(inode) (0) @@ -439,6 +479,26 @@ extern int nfs_pagein_list(struct list_head *, int); extern void nfs_readpage_result(struct rpc_task *); /* + * Allocate and free nfs_read_data structures + */ +extern mempool_t *nfs_rdata_mempool; + +static inline struct nfs_read_data *nfs_readdata_alloc(void) +{ + struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS); + if (p) + memset(p, 0, sizeof(*p)); + return p; +} + +static inline void nfs_readdata_free(struct nfs_read_data *p) +{ + mempool_free(p, nfs_rdata_mempool); +} + +extern void nfs_readdata_release(struct rpc_task *task); + +/* * linux/fs/mount_clnt.c * (Used only by nfsroot module) */ @@ -651,8 +711,7 @@ extern int nfs4_proc_setclientid_confirm(struct nfs4_client *); extern int nfs4_open_reclaim(struct nfs4_state_owner *, struct nfs4_state *); extern int nfs4_proc_async_renew(struct nfs4_client *); extern int nfs4_proc_renew(struct nfs4_client *); -extern int nfs4_do_close(struct inode *, struct nfs4_state *); -extern int nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mode_t mode); +extern int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode); extern int nfs4_wait_clnt_recover(struct rpc_clnt *, struct nfs4_client *); extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *); extern int nfs4_open_revalidate(struct inode *, struct dentry *, int); diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index f1402347c509..a73f8a990b24 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -681,7 +681,7 @@ struct nfs_rpc_ops { int (*read) (struct nfs_read_data *); int (*write) (struct nfs_write_data *); int (*commit) (struct nfs_write_data *); - struct inode * (*create) (struct inode *, struct qstr *, + struct inode * (*create) (struct inode *, struct dentry *, struct iattr *, int); int (*remove) (struct inode *, struct qstr *); int (*unlink_setup) (struct rpc_message *, diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index a56399b985a4..d08cf66f244a 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h @@ -67,6 +67,41 @@ extern stateid_t onestateid; #define ZERO_STATEID(stateid) (!memcmp((stateid), &zerostateid, sizeof(stateid_t))) #define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t))) +/* Delegation recall states */ +#define NFS4_NO_RECALL 0x000 +#define NFS4_RECALL_IN_PROGRESS 0x001 +#define NFS4_RECALL_COMPLETE 0x002 +#define NFS4_REAP_DELEG 0x004 + +struct nfs4_cb_recall { + u32 cbr_ident; + int cbr_trunc; + stateid_t cbr_stateid; + u32 cbr_fhlen; + u32 cbr_fhval[NFS4_FHSIZE]; + struct nfs4_delegation *cbr_dp; +}; + +struct nfs4_delegation { + struct list_head dl_del_perfile; /* nfs4_file->fi_del_perfile */ + struct list_head dl_del_perclnt; /* nfs4_client->cl_del_perclnt*/ + struct list_head dl_recall_lru; /* delegation recalled */ + atomic_t dl_recall_cnt; /* resend cb_recall only once */ + atomic_t dl_count; /* ref count */ + atomic_t dl_state; /* recall state */ + struct nfs4_client *dl_client; + struct nfs4_file *dl_file; + struct file_lock *dl_flock; + struct nfs4_stateid *dl_stp; + u32 dl_type; + time_t dl_time; + struct nfs4_cb_recall dl_recall; +}; + +#define dl_stateid dl_recall.cbr_stateid +#define dl_fhlen dl_recall.cbr_fhlen +#define dl_fhval dl_recall.cbr_fhval + /* client delegation callback info */ struct nfs4_callback { /* SETCLIENTID info */ @@ -75,9 +110,8 @@ struct nfs4_callback { unsigned short cb_port; u32 cb_prog; u32 cb_ident; - struct xdr_netobj cb_netid; /* RPC client info */ - u32 cb_set; /* successful CB_NULL call */ + atomic_t cb_set; /* successful CB_NULL call */ struct rpc_program cb_program; struct rpc_stat cb_stat; struct rpc_clnt * cb_client; @@ -97,6 +131,7 @@ struct nfs4_client { struct list_head cl_idhash; /* hash by cl_clientid.id */ struct list_head cl_strhash; /* hash by cl_name */ struct list_head cl_perclient; /* list: stateowners */ + struct list_head cl_del_perclnt; /* list: delegations */ struct list_head cl_lru; /* tail queue */ struct xdr_netobj cl_name; /* id generated by client */ nfs4_verifier cl_verifier; /* generated by client */ @@ -107,6 +142,7 @@ struct nfs4_client { nfs4_verifier cl_confirm; /* generated by server */ struct nfs4_callback cl_callback; /* callback info */ time_t cl_first_state; /* first state aquisition*/ + atomic_t cl_count; /* ref count */ }; /* struct nfs4_client_reset @@ -194,6 +230,7 @@ struct nfs4_stateowner { struct nfs4_file { struct list_head fi_hash; /* hash by "struct inode *" */ struct list_head fi_perfile; /* list: nfs4_stateid */ + struct list_head fi_del_perfile; /* list: nfs4_delegation */ struct inode *fi_inode; u32 fi_id; /* used with stateowner->so_id * for stateid_hashtbl hash */ @@ -231,8 +268,10 @@ struct nfs4_stateid { #define CONFIRM 0x00000002 #define OPEN_STATE 0x00000004 #define LOCK_STATE 0x00000008 -#define RDWR_STATE 0x00000010 -#define CLOSE_STATE 0x00000020 +#define RD_STATE 0x00000010 +#define WR_STATE 0x00000020 +#define CLOSE_STATE 0x00000040 +#define DELEG_RET 0x00000080 #define seqid_mutating_err(err) \ (((err) != nfserr_stale_clientid) && \ @@ -243,14 +282,17 @@ struct nfs4_stateid { extern time_t nfs4_laundromat(void); extern int nfsd4_renew(clientid_t *clid); extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh, - stateid_t *stateid, int flags, struct nfs4_stateid **stpp); + stateid_t *stateid, int flags); extern int nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type); extern void nfs4_lock_state(void); extern void nfs4_unlock_state(void); extern int nfs4_in_grace(void); extern int nfs4_check_open_reclaim(clientid_t *clid); +extern void put_nfs4_client(struct nfs4_client *clp); extern void nfs4_free_stateowner(struct kref *kref); +extern void nfsd4_probe_callback(struct nfs4_client *clp); +extern int nfsd4_cb_recall(struct nfs4_delegation *dp); static inline void nfs4_put_stateowner(struct nfs4_stateowner *so) diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index d629b5e55d90..a63238354be7 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h @@ -44,16 +44,6 @@ #define NFSD4_MAX_TAGLEN 128 #define XDR_LEN(n) (((n) + 3) & ~3) -typedef u32 delegation_zero_t; -typedef u32 delegation_boot_t; -typedef u64 delegation_id_t; - -typedef struct { - delegation_zero_t ds_zero; - delegation_boot_t ds_boot; - delegation_id_t ds_id; -} delegation_stateid_t; - struct nfsd4_change_info { u32 atomic; u32 before_ctime_sec; @@ -104,6 +94,10 @@ struct nfsd4_create { #define cr_specdata1 u.dev.specdata1 #define cr_specdata2 u.dev.specdata2 +struct nfsd4_delegreturn { + stateid_t dr_stateid; +}; + struct nfsd4_getattr { u32 ga_bmval[2]; /* request */ struct svc_fh *ga_fhp; /* response */ @@ -202,13 +196,13 @@ struct nfsd4_open { u32 op_claim_type; /* request */ struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */ u32 op_delegate_type; /* request - CLAIM_PREV only */ - delegation_stateid_t op_delegate_stateid; /* request - CLAIM_DELEGATE_CUR only */ + stateid_t op_delegate_stateid; /* request - response */ u32 op_create; /* request */ u32 op_createmode; /* request */ u32 op_bmval[2]; /* request */ union { /* request */ - struct iattr iattr; /* UNCHECKED4,GUARDED4 */ - nfs4_verifier verf; /* EXCLUSIVE4 */ + struct iattr iattr; /* UNCHECKED4,GUARDED4 */ + nfs4_verifier verf; /* EXCLUSIVE4 */ } u; clientid_t op_clientid; /* request */ struct xdr_netobj op_owner; /* request */ @@ -345,6 +339,7 @@ struct nfsd4_op { struct nfsd4_close close; struct nfsd4_commit commit; struct nfsd4_create create; + struct nfsd4_delegreturn delegreturn; struct nfsd4_getattr getattr; struct svc_fh * getfh; struct nfsd4_link link; @@ -456,6 +451,8 @@ extern int nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *rlockowner); extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); +extern int nfsd4_delegreturn(struct svc_rqst *rqstp, + struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); #endif /* diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 4de843d94147..5f7f8b932cf2 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -38,6 +38,8 @@ * * int first_node(mask) Number lowest set bit, or MAX_NUMNODES * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES + * int first_unset_node(mask) First node not set in mask, or + * MAX_NUMNODES. * * nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set * NODE_MASK_ALL Initializer - all bits set @@ -211,16 +213,19 @@ static inline void __nodes_shift_left(nodemask_t *dstp, bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); } -#define first_node(src) __first_node(&(src), MAX_NUMNODES) -static inline int __first_node(const nodemask_t *srcp, int nbits) +/* FIXME: better would be to fix all architectures to never return + > MAX_NUMNODES, then the silly min_ts could be dropped. */ + +#define first_node(src) __first_node(&(src)) +static inline int __first_node(const nodemask_t *srcp) { - return min_t(int, nbits, find_first_bit(srcp->bits, nbits)); + return min_t(int, MAX_NUMNODES, find_first_bit(srcp->bits, MAX_NUMNODES)); } -#define next_node(n, src) __next_node((n), &(src), MAX_NUMNODES) -static inline int __next_node(int n, const nodemask_t *srcp, int nbits) +#define next_node(n, src) __next_node((n), &(src)) +static inline int __next_node(int n, const nodemask_t *srcp) { - return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1)); + return min_t(int,MAX_NUMNODES,find_next_bit(srcp->bits, MAX_NUMNODES, n+1)); } #define nodemask_of_node(node) \ @@ -235,6 +240,13 @@ static inline int __next_node(int n, const nodemask_t *srcp, int nbits) m; \ }) +#define first_unset_node(mask) __first_unset_node(&(mask)) +static inline int __first_unset_node(const nodemask_t *maskp) +{ + return min_t(int,MAX_NUMNODES, + find_first_zero_bit(maskp->bits, MAX_NUMNODES)); +} + #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES) #if MAX_NUMNODES <= BITS_PER_LONG diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index f17c89c37c72..d6a47c85e603 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h @@ -20,6 +20,7 @@ struct super_block; struct dentry; struct file_operations; +struct pt_regs; /* Operations structure to be filled in */ struct oprofile_operations { @@ -34,6 +35,8 @@ struct oprofile_operations { int (*start)(void); /* Stop delivering interrupts. */ void (*stop)(void); + /* Initiate a stack backtrace. Optional. */ + void (*backtrace)(struct pt_regs * const regs, unsigned int depth); /* CPU identification string. */ char * cpu_type; }; @@ -41,11 +44,11 @@ struct oprofile_operations { /** * One-time initialisation. *ops must be set to a filled-in * operations structure. This is called even in timer interrupt - * mode. + * mode so an arch can set a backtrace callback. * - * Return 0 on success. + * If an error occurs, the fields should be left untouched. */ -int oprofile_arch_init(struct oprofile_operations ** ops); +void oprofile_arch_init(struct oprofile_operations * ops); /** * One-time exit/cleanup for the arch. @@ -56,8 +59,15 @@ void oprofile_arch_exit(void); * Add a sample. This may be called from any context. Pass * smp_processor_id() as cpu. */ -extern void oprofile_add_sample(unsigned long eip, unsigned int is_kernel, - unsigned long event, int cpu); +void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); + +/* Use this instead when the PC value is not from the regs. Doesn't + * backtrace. */ +void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); + +/* add a backtrace entry, to be called from the ->backtrace callback */ +void oprofile_add_trace(unsigned long eip); + /** * Create a file of the given name as a child of the given root, with diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 4ac9f8c49d24..f11387a4cc50 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -239,6 +239,8 @@ extern unsigned long __read_page_state(unsigned offset); #define SetPagePrivate(page) set_bit(PG_private, &(page)->flags) #define ClearPagePrivate(page) clear_bit(PG_private, &(page)->flags) #define PagePrivate(page) test_bit(PG_private, &(page)->flags) +#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags) +#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags) #define PageWriteback(page) test_bit(PG_writeback, &(page)->flags) #define SetPageWriteback(page) \ @@ -291,7 +293,11 @@ extern unsigned long __read_page_state(unsigned offset); #define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags) #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) +#ifdef CONFIG_HUGETLB_PAGE #define PageCompound(page) test_bit(PG_compound, &(page)->flags) +#else +#define PageCompound(page) 0 +#endif #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index 0682cb927170..7825c76cbd00 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -228,12 +228,6 @@ extern void parport_pc_release_resources(struct parport *p); extern int parport_pc_claim_resources(struct parport *p); -extern void parport_pc_init_state(struct pardevice *, struct parport_state *s); - -extern void parport_pc_save_state(struct parport *p, struct parport_state *s); - -extern void parport_pc_restore_state(struct parport *p, struct parport_state *s); - /* PCMCIA code will want to get us to look at a port. Provide a mechanism. */ extern struct parport *parport_pc_probe_port (unsigned long base, unsigned long base_hi, diff --git a/include/linux/pci.h b/include/linux/pci.h index 6e0973f334b1..5d38124ff4ac 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -364,6 +364,20 @@ #define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ #define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ +#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ +#define PCI_EXP_LNKCTL 16 /* Link Control */ +#define PCI_EXP_LNKSTA 18 /* Link Status */ +#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ +#define PCI_EXP_SLTCTL 24 /* Slot Control */ +#define PCI_EXP_SLTSTA 26 /* Slot Status */ +#define PCI_EXP_RTCTL 28 /* Root Control */ +#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ +#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ +#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ +#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ +#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ +#define PCI_EXP_RTCAP 30 /* Root Capabilities */ +#define PCI_EXP_RTSTA 32 /* Root Status */ /* Extended Capabilities (PCI-X 2.0 and Express) */ #define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) @@ -480,6 +494,14 @@ enum pci_mmap_state { #define DEVICE_COUNT_COMPATIBLE 4 #define DEVICE_COUNT_RESOURCE 12 +typedef int __bitwise pci_power_t; + +#define PCI_D0 ((pci_power_t __force) 0) +#define PCI_D1 ((pci_power_t __force) 1) +#define PCI_D2 ((pci_power_t __force) 2) +#define PCI_D3hot ((pci_power_t __force) 3) +#define PCI_D3cold ((pci_power_t __force) 4) + /* * The pci_dev structure is used to describe PCI devices. */ @@ -508,7 +530,7 @@ struct pci_dev { this if your device has broken DMA or supports 64-bit transfers. */ - u32 current_state; /* Current operating state. In ACPI-speak, + pci_power_t current_state; /* Current operating state. In ACPI-speak, this is D0-D3, D0 being fully functional, and D3 being off. */ @@ -539,6 +561,7 @@ struct pci_dev { u32 saved_config_space[16]; /* config space saved at suspend time */ struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled; /* has display of the rom attribute been enabled? */ + struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ #ifdef CONFIG_PCI_NAMES #define PCI_NAME_SIZE 96 #define PCI_NAME_HALF __stringify(43) /* less than half to handle slop */ @@ -593,6 +616,8 @@ struct pci_bus { unsigned short pad2; struct device *bridge; struct class_device class_dev; + struct bin_attribute *legacy_io; /* legacy I/O for this bus */ + struct bin_attribute *legacy_mem; /* legacy mem */ }; #define pci_bus_b(n) list_entry(n, struct pci_bus, node) @@ -797,8 +822,9 @@ void pci_remove_rom(struct pci_dev *pdev); /* Power management related routines */ int pci_save_state(struct pci_dev *dev); int pci_restore_state(struct pci_dev *dev); -int pci_set_power_state(struct pci_dev *dev, int state); -int pci_enable_wake(struct pci_dev *dev, u32 state, int enable); +int pci_set_power_state(struct pci_dev *dev, pci_power_t state); +pci_power_t pci_choose_state(struct pci_dev *dev, u32 state); +int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ void pci_bus_assign_resources(struct pci_bus *bus); @@ -925,8 +951,9 @@ static inline const struct pci_device_id *pci_match_device(const struct pci_devi /* Power management related routines */ static inline int pci_save_state(struct pci_dev *dev) { return 0; } static inline int pci_restore_state(struct pci_dev *dev) { return 0; } -static inline int pci_set_power_state(struct pci_dev *dev, int state) { return 0; } -static inline int pci_enable_wake(struct pci_dev *dev, u32 state, int enable) { return 0; } +static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { return 0; } +static inline pci_power_t pci_choose_state(struct pci_dev *dev, u32 state) { return PCI_D0; } +static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } #define isa_bridge ((struct pci_dev *)NULL) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d607c59b3851..9f6d4812646a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -353,8 +353,9 @@ #define PCI_DEVICE_ID_ATI_RS300_166 0x5832 #define PCI_DEVICE_ID_ATI_RS300_200 0x5833 /* ATI IXP Chipset */ -#define PCI_DEVICE_ID_ATI_IXP_IDE 0x4349 -#define PCI_DEVICE_ID_ATI_IXP2_IDE 0x4369 /* True name not yet sure */ +#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 +#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 +#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 #define PCI_VENDOR_ID_VLSI 0x1004 #define PCI_DEVICE_ID_VLSI_82C592 0x0005 @@ -506,6 +507,8 @@ # define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449 #define PCI_DEVICE_ID_AMD_8111_LAN 0x7462 #define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 +#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a +#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d #define PCI_DEVICE_ID_AMD_8151_0 0x7454 #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 @@ -595,6 +598,7 @@ #define PCI_DEVICE_ID_SI_6202 0x0002 #define PCI_DEVICE_ID_SI_503 0x0008 #define PCI_DEVICE_ID_SI_ACPI 0x0009 +#define PCI_DEVICE_ID_SI_SMBUS 0x0016 #define PCI_DEVICE_ID_SI_LPC 0x0018 #define PCI_DEVICE_ID_SI_5597_VGA 0x0200 #define PCI_DEVICE_ID_SI_6205 0x0205 @@ -690,7 +694,7 @@ #define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 -#define PCI_DEVICE_ID_HP_CISS 0x3210 +#define PCI_DEVICE_ID_HP_CISSA 0x3220 #define PCI_VENDOR_ID_PCTECH 0x1042 #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 @@ -1110,7 +1114,6 @@ #define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0 #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da -#define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 #define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 @@ -1118,6 +1121,7 @@ #define PCI_DEVICE_ID_NVIDIA_NVENET_7 0x00df #define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5 #define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee @@ -1146,6 +1150,7 @@ #define PCI_DEVICE_ID_NVIDIA_IGEFORCE2 0x01a0 #define PCI_DEVICE_ID_NVIDIA_NFORCE 0x01a4 #define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO 0x01b1 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4 #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc #define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3 #define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0 @@ -2074,9 +2079,11 @@ #define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902 #define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01 #define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10 +#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 #define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01 #define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02 #define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03 +#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 #define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 #define PCI_VENDOR_ID_DUNORD 0x5544 @@ -2172,6 +2179,7 @@ #define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b #define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c #define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 +#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1 #define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2 #define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 #define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4 @@ -2397,6 +2405,9 @@ #define PCI_DEVICE_ID_TIGERJET_300 0x0001 #define PCI_DEVICE_ID_TIGERJET_100 0x0002 +#define PCI_VENDOR_ID_TTTECH 0x0357 +#define PCI_DEVICE_ID_TTTECH_MC322 0x000A + #define PCI_VENDOR_ID_ARK 0xedd8 #define PCI_DEVICE_ID_ARK_STING 0xa091 #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 diff --git a/include/linux/personality.h b/include/linux/personality.h index db31c5828e4a..7cef4670ac05 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -18,6 +18,9 @@ extern int __set_personality(unsigned long); * These occupy the top three bytes. */ enum { + FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors + * (signal handling) + */ MMAP_PAGE_ZERO = 0x0100000, ADDR_COMPAT_LAYOUT = 0x0200000, READ_IMPLIES_EXEC = 0x0400000, @@ -43,6 +46,7 @@ enum { enum { PER_LINUX = 0x0000, PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, + PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 407c0e0b3e84..36725e7c02c6 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -2,10 +2,27 @@ #define _LINUX_PIPE_FS_I_H #define PIPEFS_MAGIC 0x50495045 + +#define PIPE_BUFFERS (16) + +struct pipe_buffer { + struct page *page; + unsigned int offset, len; + struct pipe_buf_operations *ops; +}; + +struct pipe_buf_operations { + int can_merge; + void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); + void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); + void (*release)(struct pipe_inode_info *, struct pipe_buffer *); +}; + struct pipe_inode_info { wait_queue_head_t wait; - char *base; - unsigned int len; + unsigned int nrbufs, curbuf; + struct pipe_buffer bufs[PIPE_BUFFERS]; + struct page *tmp_page; unsigned int start; unsigned int readers; unsigned int writers; @@ -33,16 +50,10 @@ struct pipe_inode_info { #define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers)) #define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers)) -#define PIPE_EMPTY(inode) (PIPE_LEN(inode) == 0) -#define PIPE_FULL(inode) (PIPE_LEN(inode) == PIPE_SIZE) -#define PIPE_FREE(inode) (PIPE_SIZE - PIPE_LEN(inode)) -#define PIPE_END(inode) ((PIPE_START(inode) + PIPE_LEN(inode)) & (PIPE_SIZE-1)) -#define PIPE_MAX_RCHUNK(inode) (PIPE_SIZE - PIPE_START(inode)) -#define PIPE_MAX_WCHUNK(inode) (PIPE_SIZE - PIPE_END(inode)) - /* Drop the inode semaphore and wait for a pipe event, atomically */ void pipe_wait(struct inode * inode); struct inode* pipe_new(struct inode* inode); +void free_pipe_info(struct inode* inode); #endif diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 45ed903d247c..3101ef5000ad 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h @@ -249,6 +249,7 @@ enum TCA_RSVP_SRC, TCA_RSVP_PINFO, TCA_RSVP_POLICE, + TCA_RSVP_ACT, __TCA_RSVP_MAX }; @@ -280,6 +281,7 @@ enum TCA_ROUTE4_FROM, TCA_ROUTE4_IIF, TCA_ROUTE4_POLICE, + TCA_ROUTE4_ACT, __TCA_ROUTE4_MAX }; @@ -311,6 +313,7 @@ enum TCA_TCINDEX_FALL_THROUGH, TCA_TCINDEX_CLASSID, TCA_TCINDEX_POLICE, + TCA_TCINDEX_ACT, __TCA_TCINDEX_MAX }; diff --git a/include/linux/pm.h b/include/linux/pm.h index 68da2eae8547..1d106a3edad5 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -28,44 +28,28 @@ #include <asm/atomic.h> /* - * Power management requests + * Power management requests... these are passed to pm_send_all() and friends. + * + * these functions are old and deprecated, see below. */ -enum -{ - PM_SUSPEND, /* enter D1-D3 */ - PM_RESUME, /* enter D0 */ +typedef int __bitwise pm_request_t; - PM_SAVE_STATE, /* save device's state */ +#define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */ +#define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ - /* enable wake-on */ - PM_SET_WAKEUP, - - /* bus resource management */ - PM_GET_RESOURCES, - PM_SET_RESOURCES, - - /* base station management */ - PM_EJECT, - PM_LOCK, -}; - -typedef int pm_request_t; /* - * Device types + * Device types... these are passed to pm_register */ -enum -{ - PM_UNKNOWN_DEV = 0, /* generic */ - PM_SYS_DEV, /* system device (fan, KB controller, ...) */ - PM_PCI_DEV, /* PCI device */ - PM_USB_DEV, /* USB device */ - PM_SCSI_DEV, /* SCSI device */ - PM_ISA_DEV, /* ISA device */ - PM_MTD_DEV, /* Memory Technology Device */ -}; +typedef int __bitwise pm_dev_t; -typedef int pm_dev_t; +#define PM_UNKNOWN_DEV ((__force pm_dev_t) 0) /* generic */ +#define PM_SYS_DEV ((__force pm_dev_t) 1) /* system device (fan, KB controller, ...) */ +#define PM_PCI_DEV ((__force pm_dev_t) 2) /* PCI device */ +#define PM_USB_DEV ((__force pm_dev_t) 3) /* USB device */ +#define PM_SCSI_DEV ((__force pm_dev_t) 4) /* SCSI device */ +#define PM_ISA_DEV ((__force pm_dev_t) 5) /* ISA device */ +#define PM_MTD_DEV ((__force pm_dev_t) 6) /* Memory Technology Device */ /* * System device hardware ID (PnP) values @@ -119,32 +103,27 @@ extern int pm_active; /* * Register a device with power management */ -struct pm_dev *pm_register(pm_dev_t type, - unsigned long id, - pm_callback callback); +struct pm_dev __deprecated *pm_register(pm_dev_t type, unsigned long id, pm_callback callback); /* * Unregister a device with power management */ -void pm_unregister(struct pm_dev *dev); +void __deprecated pm_unregister(struct pm_dev *dev); /* * Unregister all devices with matching callback */ -void pm_unregister_all(pm_callback callback); +void __deprecated pm_unregister_all(pm_callback callback); /* * Send a request to a single device */ -int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data); +int __deprecated pm_send(struct pm_dev *dev, pm_request_t rqst, void *data); /* * Send a request to all devices */ -int pm_send_all(pm_request_t rqst, void *data); - -static inline void pm_access(struct pm_dev *dev) {} -static inline void pm_dev_idle(struct pm_dev *dev) {} +int __deprecated pm_send_all(pm_request_t rqst, void *data); #else /* CONFIG_PM */ @@ -171,16 +150,10 @@ static inline int pm_send_all(pm_request_t rqst, void *data) return 0; } -static inline struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from) -{ - return 0; -} - -static inline void pm_access(struct pm_dev *dev) {} -static inline void pm_dev_idle(struct pm_dev *dev) {} - #endif /* CONFIG_PM */ +/* Functions above this comment are list-based old-style power + * managment. Please avoid using them. */ /* * Callbacks for platform drivers to implement. @@ -222,10 +195,34 @@ extern int pm_suspend(suspend_state_t state); struct device; +typedef u32 __bitwise pm_message_t; + +/* + * There are 4 important states driver can be in: + * ON -- driver is working + * FREEZE -- stop operations and apply whatever policy is applicable to a suspended driver + * of that class, freeze queues for block like IDE does, drop packets for + * ethernet, etc... stop DMA engine too etc... so a consistent image can be + * saved; but do not power any hardware down. + * SUSPEND - like FREEZE, but hardware is doing as much powersaving as possible. Roughly + * pci D3. + * + * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 (SUSPEND). + * We'll need to fix the drivers. So yes, putting 3 to all diferent defines is intentional, + * and will go away as soon as drivers are fixed. Also note that typedef is neccessary, + * we'll probably want to switch to + * typedef struct pm_message_t { int event; int flags; } pm_message_t + * or something similar soon. + */ + +#define PMSG_FREEZE ((__force pm_message_t) 3) +#define PMSG_SUSPEND ((__force pm_message_t) 3) +#define PMSG_ON ((__force pm_message_t) 0) + struct dev_pm_info { - u32 power_state; + pm_message_t power_state; #ifdef CONFIG_PM - u32 prev_state; + pm_message_t prev_state; void * saved_state; atomic_t pm_users; struct device * pm_parent; @@ -235,8 +232,8 @@ struct dev_pm_info { extern void device_pm_set_parent(struct device * dev, struct device * parent); -extern int device_suspend(u32 state); -extern int device_power_down(u32 state); +extern int device_suspend(pm_message_t state); +extern int device_power_down(pm_message_t state); extern void device_power_up(void); extern void device_resume(void); diff --git a/include/linux/prctl.h b/include/linux/prctl.h index edb036b43597..bf022c43a18e 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h @@ -50,5 +50,6 @@ process timing */ #define PR_SET_NAME 15 /* Set process name */ +#define PR_GET_NAME 16 /* Get process name */ #endif /* _LINUX_PRCTL_H */ diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a7ad90136d64..dd98c54a23b4 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -9,17 +9,18 @@ #include <linux/config.h> #include <linux/linkage.h> -#define preempt_count() (current_thread_info()->preempt_count) +#ifdef CONFIG_DEBUG_PREEMPT + extern void fastcall add_preempt_count(int val); + extern void fastcall sub_preempt_count(int val); +#else +# define add_preempt_count(val) do { preempt_count() += (val); } while (0) +# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) +#endif -#define inc_preempt_count() \ -do { \ - preempt_count()++; \ -} while (0) +#define inc_preempt_count() add_preempt_count(1) +#define dec_preempt_count() sub_preempt_count(1) -#define dec_preempt_count() \ -do { \ - preempt_count()--; \ -} while (0) +#define preempt_count() (current_thread_info()->preempt_count) #ifdef CONFIG_PREEMPT diff --git a/include/linux/prio_tree.h b/include/linux/prio_tree.h index 6356a511f9ee..db04abb557e0 100644 --- a/include/linux/prio_tree.h +++ b/include/linux/prio_tree.h @@ -1,15 +1,38 @@ #ifndef _LINUX_PRIO_TREE_H #define _LINUX_PRIO_TREE_H +/* + * K&R 2nd ed. A8.3 somewhat obliquely hints that initial sequences of struct + * fields with identical types should end up at the same location. We'll use + * this until we can scrap struct raw_prio_tree_node. + * + * Note: all this could be done more elegantly by using unnamed union/struct + * fields. However, gcc 2.95.3 and apparently also gcc 3.0.4 don't support this + * language extension. + */ + +struct raw_prio_tree_node { + struct prio_tree_node *left; + struct prio_tree_node *right; + struct prio_tree_node *parent; +}; + struct prio_tree_node { struct prio_tree_node *left; struct prio_tree_node *right; struct prio_tree_node *parent; + unsigned long start; + unsigned long last; /* last location _in_ interval */ }; struct prio_tree_root { struct prio_tree_node *prio_tree_node; - unsigned int index_bits; + unsigned short index_bits; + unsigned short raw; + /* + * 0: nodes are of type struct prio_tree_node + * 1: nodes are of type raw_prio_tree_node + */ }; struct prio_tree_iter { @@ -29,14 +52,19 @@ static inline void prio_tree_iter_init(struct prio_tree_iter *iter, iter->root = root; iter->r_index = r_index; iter->h_index = h_index; + iter->cur = NULL; } -#define INIT_PRIO_TREE_ROOT(ptr) \ +#define __INIT_PRIO_TREE_ROOT(ptr, _raw) \ do { \ (ptr)->prio_tree_node = NULL; \ (ptr)->index_bits = 1; \ + (ptr)->raw = (_raw); \ } while (0) +#define INIT_PRIO_TREE_ROOT(ptr) __INIT_PRIO_TREE_ROOT(ptr, 0) +#define INIT_RAW_PRIO_TREE_ROOT(ptr) __INIT_PRIO_TREE_ROOT(ptr, 1) + #define INIT_PRIO_TREE_NODE(ptr) \ do { \ (ptr)->left = (ptr)->right = (ptr)->parent = (ptr); \ @@ -73,4 +101,20 @@ static inline int prio_tree_right_empty(const struct prio_tree_node *node) return node->right == node; } + +struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root, + struct prio_tree_node *old, struct prio_tree_node *node); +struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root, + struct prio_tree_node *node); +void prio_tree_remove(struct prio_tree_root *root, struct prio_tree_node *node); +struct prio_tree_node *prio_tree_next(struct prio_tree_iter *iter); + +#define raw_prio_tree_replace(root, old, node) \ + prio_tree_replace(root, (struct prio_tree_node *) (old), \ + (struct prio_tree_node *) (node)) +#define raw_prio_tree_insert(root, node) \ + prio_tree_insert(root, (struct prio_tree_node *) (node)) +#define raw_prio_tree_remove(root, node) \ + prio_tree_remove(root, (struct prio_tree_node *) (node)) + #endif /* _LINUX_PRIO_TREE_H */ diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 14b0b41e5ecc..59e505261fd6 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -231,13 +231,8 @@ extern struct proc_dir_entry proc_root; static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) { } -static inline struct kcore_list * kclist_del(void *addr) -{ - return NULL; -} #else extern void kclist_add(struct kcore_list *, void *, size_t); -extern struct kcore_list *kclist_del(void *); #endif struct proc_inode { diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index f18247125091..a373fc254df2 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -87,6 +87,7 @@ extern void ptrace_notify(int exit_code); extern void __ptrace_link(struct task_struct *child, struct task_struct *new_parent); extern void __ptrace_unlink(struct task_struct *child); +extern void ptrace_untrace(struct task_struct *child); static inline void ptrace_link(struct task_struct *child, struct task_struct *new_parent) diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index e951b2bb9cdf..e04c4fe45b53 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h @@ -11,14 +11,9 @@ struct dev_info { typedef struct dev_info dev_info_t; -struct linear_hash -{ - dev_info_t *dev0, *dev1; -}; - struct linear_private_data { - struct linear_hash *hash_table; + dev_info_t **hash_table; dev_info_t *smallest; int nr_zones; dev_info_t disks[0]; diff --git a/include/linux/random.h b/include/linux/random.h index bb7c6e64e3eb..c6f95fc1de13 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -44,8 +44,8 @@ struct rand_pool_info { extern void rand_initialize_irq(int irq); -extern void add_keyboard_randomness(unsigned char scancode); -extern void add_mouse_randomness(__u32 mouse_data); +extern void add_input_randomness(unsigned int type, unsigned int code, + unsigned int value); extern void add_interrupt_randomness(int irq); extern void get_random_bytes(void *buf, int nbytes); diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 91057d6fafd0..4d747433916b 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -65,7 +65,6 @@ struct rcu_ctrlblk { long cur; /* Current batch number. */ long completed; /* Number of the last completed batch */ int next_pending; /* Is the next batch already waiting? */ - seqcount_t lock; /* For atomic reads of cur and next_pending. */ } ____cacheline_maxaligned_in_smp; /* Is batch a before batch b ? */ @@ -88,9 +87,7 @@ static inline int rcu_batch_after(long a, long b) struct rcu_data { /* 1) quiescent state handling : */ long quiescbatch; /* Batch # for grace period */ - long qsctr; /* User-mode/idle loop etc. */ - long last_qsctr; /* value of qsctr at beginning */ - /* of rcu grace period */ + int passed_quiesc; /* User-mode/idle loop etc. */ int qs_pending; /* core waits for quiesc state */ /* 2) batch handling */ @@ -110,17 +107,20 @@ extern struct rcu_ctrlblk rcu_ctrlblk; extern struct rcu_ctrlblk rcu_bh_ctrlblk; /* - * Increment the quiscent state counter. + * Increment the quiescent state counter. + * The counter is a bit degenerated: We do not need to know + * how many quiescent states passed, just if there was at least + * one since the start of the grace period. Thus just a flag. */ static inline void rcu_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_data, cpu); - rdp->qsctr++; + rdp->passed_quiesc = 1; } static inline void rcu_bh_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu); - rdp->qsctr++; + rdp->passed_quiesc = 1; } static inline int __rcu_pending(struct rcu_ctrlblk *rcp, diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index acfde2d1d152..a57e973af0bd 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h @@ -50,7 +50,6 @@ static inline int reiserfs_acl_count(size_t size) #ifdef CONFIG_REISERFS_FS_POSIX_ACL struct posix_acl * reiserfs_get_acl(struct inode *inode, int type); -int reiserfs_set_acl(struct inode *inode, int type, struct posix_acl *acl); int reiserfs_acl_chmod (struct inode *inode); int reiserfs_inherit_default_acl (struct inode *dir, struct dentry *dentry, struct inode *inode); int reiserfs_cache_default_acl (struct inode *dir); @@ -60,7 +59,6 @@ extern struct reiserfs_xattr_handler posix_acl_default_handler; extern struct reiserfs_xattr_handler posix_acl_access_handler; #else -#define reiserfs_set_acl NULL #define reiserfs_get_acl NULL #define reiserfs_cache_default_acl(inode) 0 diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 6a6062e50689..bccff8b17dc4 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -243,10 +243,6 @@ struct reiserfs_super_block #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" -extern const char reiserfs_3_5_magic_string[]; -extern const char reiserfs_3_6_magic_string[]; -extern const char reiserfs_jr_magic_string[]; - int is_reiserfs_3_5 (struct reiserfs_super_block * rs); int is_reiserfs_3_6 (struct reiserfs_super_block * rs); int is_reiserfs_jr (struct reiserfs_super_block * rs); @@ -1559,8 +1555,6 @@ struct item_operations { }; -extern struct item_operations stat_data_ops, indirect_ops, direct_ops, - direntry_ops; extern struct item_operations * item_ops [TYPE_ANY + 1]; #define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize) @@ -1576,11 +1570,7 @@ extern struct item_operations * item_ops [TYPE_ANY + 1]; - - -#define COMP_KEYS comp_keys #define COMP_SHORT_KEYS comp_short_keys -/*#define keys_of_same_object comp_short_keys*/ /* number of blocks pointed to by the indirect item */ #define I_UNFM_NUM(p_s_ih) ( ih_item_len(p_s_ih) / UNFM_P_SIZE ) @@ -1835,23 +1825,14 @@ int reiserfs_convert_objectid_map_v1(struct super_block *) ; /* stree.c */ int B_IS_IN_TREE(const struct buffer_head *); -extern inline void copy_short_key (void * to, const void * from); extern void copy_item_head(struct item_head * p_v_to, const struct item_head * p_v_from); // first key is in cpu form, second - le -extern int comp_keys (const struct reiserfs_key * le_key, - const struct cpu_key * cpu_key); extern int comp_short_keys (const struct reiserfs_key * le_key, const struct cpu_key * cpu_key); extern void le_key2cpu_key (struct cpu_key * to, const struct reiserfs_key * from); -// both are cpu keys -extern int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *); -extern int comp_short_cpu_keys (const struct cpu_key *, - const struct cpu_key *); -extern void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *); - // both are in le form extern int comp_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); extern int comp_short_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); @@ -1881,8 +1862,6 @@ static inline void copy_key (struct reiserfs_key *to, const struct reiserfs_key int comp_items (const struct item_head * stored_ih, const struct path * p_s_path); const struct reiserfs_key * get_rkey (const struct path * p_s_chk_path, const struct super_block * p_s_sb); -inline int bin_search (const void * p_v_key, const void * p_v_base, - int p_n_num, int p_n_width, int * p_n_pos); int search_by_key (struct super_block *, const struct cpu_key *, struct path *, int); #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) @@ -1960,7 +1939,6 @@ struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data, int reiserfs_encode_fh( struct dentry *dentry, __u32 *data, int *lenp, int connectable ); -int reiserfs_prepare_write(struct file *, struct page *, unsigned, unsigned) ; int reiserfs_truncate_file(struct inode *, int update_timestamps) ; void make_cpu_key (struct cpu_key * cpu_key, struct inode * inode, loff_t offset, int type, int key_length); @@ -1976,9 +1954,6 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th, const char * symname, loff_t i_size, struct dentry *dentry, struct inode *inode); -int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, - struct inode * inode); - void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, struct inode * inode, loff_t size); @@ -2077,15 +2052,12 @@ static inline void reiserfs_kfree(const void *vp, size_t size, int fix_nodes (int n_op_mode, struct tree_balance * p_s_tb, struct item_head * p_s_ins_ih, const void *); void unfix_nodes (struct tree_balance *); -void free_buffers_in_tb (struct tree_balance * p_s_tb); /* prints.c */ void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) ); void reiserfs_info (struct super_block *s, const char * fmt, ...); -void reiserfs_printk (const char * fmt, ...); void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...); -void print_virtual_node (struct virtual_node * vn); void print_indirect_item (struct buffer_head * bh, int item_num); void store_print_tb (struct tree_balance * tb); void print_cur_tb (char * mes); @@ -2095,7 +2067,6 @@ void print_bi (struct buffer_info * bi, char * mes); #define PRINT_DIRECTORY_ITEMS 2 /* print directory items */ #define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */ void print_block (struct buffer_head * bh, ...); -void print_path (struct tree_balance * tb, struct path * path); void print_bmap (struct super_block * s, int silent); void print_bmap_block (int i, char * data, int size, int silent); /*void print_super_block (struct super_block * s, char * mes);*/ @@ -2136,8 +2107,6 @@ void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * int get_left_neighbor_position (struct tree_balance * tb, int h); int get_right_neighbor_position (struct tree_balance * tb, int h); void replace_key (struct tree_balance * tb, struct buffer_head *, int, struct buffer_head *, int); -void replace_lkey (struct tree_balance *, int, struct item_head *); -void replace_rkey (struct tree_balance *, int, struct item_head *); void make_empty_node (struct buffer_info *); struct buffer_head * get_FEB (struct tree_balance *); @@ -2262,7 +2231,6 @@ __u32 r5_hash (const signed char *msg, int len); /* prototypes from ioctl.c */ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, unsigned long arg); -int reiserfs_unpack (struct inode * inode, struct file * filp); /* ioctl's command */ #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 84a5728cafa1..37a3a7afbec7 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -501,7 +501,6 @@ enum reiserfs_mount_options { #define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC)) #define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO)) -#define reiserfs_error_continue(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_CONTINUE)) void reiserfs_file_buffer (struct buffer_head * bh, int list); extern struct file_system_type reiserfs_fs_type; diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 354e5f88e4f8..c3d5d043a5ca 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -748,6 +748,7 @@ struct tcamsg #include <linux/config.h> +extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) { int len = strlen(str) + 1; @@ -756,6 +757,9 @@ static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); +#define rtattr_parse_nested(tb, max, rta) \ + rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) + extern struct sock *rtnl; struct rtnetlink_link @@ -765,7 +769,6 @@ struct rtnetlink_link }; extern struct rtnetlink_link * rtnetlink_links[NPROTO]; -extern int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb); extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); @@ -806,6 +809,7 @@ extern struct semaphore rtnl_sem; } while(0) extern void rtnl_lock(void); +extern int rtnl_lock_interruptible(void); extern void rtnl_unlock(void); extern void rtnetlink_init(void); diff --git a/include/linux/sched.h b/include/linux/sched.h index ea0c48e75bcd..b15db5dc354c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -13,12 +13,14 @@ #include <linux/rbtree.h> #include <linux/thread_info.h> #include <linux/cpumask.h> +#include <linux/errno.h> #include <asm/system.h> #include <asm/semaphore.h> #include <asm/page.h> #include <asm/ptrace.h> #include <asm/mmu.h> +#include <asm/cputime.h> #include <linux/smp.h> #include <linux/sem.h> @@ -85,9 +87,7 @@ extern unsigned long avenrun[]; /* Load averages */ load += n*(FIXED_1-exp); \ load >>= FSHIFT; -#define CT_TO_SECS(x) ((x) / HZ) -#define CT_TO_USECS(x) (((x) % HZ) * 1000000/HZ) - +extern unsigned long total_forks; extern int nr_threads; extern int last_pid; DECLARE_PER_CPU(unsigned long, process_counts); @@ -121,6 +121,9 @@ extern unsigned long nr_iowait(void); #define set_current_state(state_value) \ set_mb(current->state, (state_value)) +/* Task command name length */ +#define TASK_COMM_LEN 16 + /* * Scheduling policies */ @@ -169,7 +172,7 @@ long io_schedule_timeout(long timeout); extern void cpu_init (void); extern void trap_init(void); extern void update_process_times(int user); -extern void scheduler_tick(int user_tick, int system); +extern void scheduler_tick(void); extern unsigned long cache_decay_ticks; /* Attach to any functions which should be ignored in wchan output. */ @@ -250,6 +253,9 @@ struct mm_struct { struct kioctx *ioctx_list; struct kioctx default_kioctx; + + unsigned long hiwater_rss; /* High-water RSS usage */ + unsigned long hiwater_vm; /* High-water virtual memory usage */ }; struct sighand_struct { @@ -269,6 +275,8 @@ struct signal_struct { atomic_t count; atomic_t live; + wait_queue_head_t wait_chldexit; /* for wait4() */ + /* current thread group signal load-balancing target: */ task_t *curr_target; @@ -276,7 +284,6 @@ struct signal_struct { struct sigpending shared_pending; /* thread group exit support */ - int group_exit; int group_exit_code; /* overloaded: * - notify group_exit_task when ->count is equal to notify_count @@ -288,8 +295,7 @@ struct signal_struct { /* thread group stop support, overloads group_exit_code too */ int group_stop_count; - /* 1 if group stopped since last SIGCONT, -1 if SIGCONT since report */ - int stop_state; + unsigned int flags; /* see SIGNAL_* flags below */ /* POSIX.1b Interval Timers */ struct list_head posix_timers; @@ -309,7 +315,7 @@ struct signal_struct { * Live threads maintain their own counters and add to these * in __exit_signal, except for the group leader. */ - unsigned long utime, stime, cutime, cstime; + cputime_t utime, stime, cutime, cstime; unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; @@ -326,6 +332,15 @@ struct signal_struct { }; /* + * Bits in flags field of signal_struct. + */ +#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */ +#define SIGNAL_STOP_DEQUEUED 0x00000002 /* stop signal dequeued */ +#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ +#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ + + +/* * Priority of a process goes from 0..MAX_PRIO-1, valid RT * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL tasks are * in the range MAX_RT_PRIO..MAX_PRIO-1. Priority values @@ -524,7 +539,6 @@ struct task_struct { prio_array_t *array; unsigned long sleep_avg; - long interactive_credit; unsigned long long timestamp, last_ran; int activated; @@ -574,16 +588,16 @@ struct task_struct { /* PID/PID hash table linkage. */ struct pid pids[PIDTYPE_MAX]; - wait_queue_head_t wait_chldexit; /* for wait4() */ struct completion *vfork_done; /* for vfork() */ int __user *set_child_tid; /* CLONE_CHILD_SETTID */ int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ unsigned long rt_priority; - unsigned long it_real_value, it_prof_value, it_virt_value; - unsigned long it_real_incr, it_prof_incr, it_virt_incr; + unsigned long it_real_value, it_real_incr; + cputime_t it_virt_value, it_virt_incr; + cputime_t it_prof_value, it_prof_incr; struct timer_list real_timer; - unsigned long utime, stime; + cputime_t utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ struct timespec start_time; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ @@ -601,7 +615,7 @@ struct task_struct { struct key *thread_keyring; /* keyring private to this thread */ #endif unsigned short used_math; - char comm[16]; + char comm[TASK_COMM_LEN]; /* file system info */ int link_count, total_link_count; /* ipc stuff */ @@ -660,6 +674,13 @@ struct task_struct { * to a stack based synchronous wait) if its doing sync IO. */ wait_queue_t *io_wait; +/* i/o counters(bytes read/written, #syscalls */ + u64 rchar, wchar, syscr, syscw; +#if defined(CONFIG_BSD_PROCESS_ACCT) + u64 acct_rss_mem1; /* accumulated rss usage */ + u64 acct_vm_mem1; /* accumulated virtual memory usage */ + clock_t acct_stimexpd; /* clock_t-converted stime since last update */ +#endif #ifdef CONFIG_NUMA struct mempolicy *mempolicy; short il_next; /* could be shared with used_math */ @@ -706,7 +727,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */ #define PF_FLUSHER 0x00002000 /* responsible for disk writeback */ -#define PF_FREEZE 0x00004000 /* this task should be frozen for suspend */ +#define PF_FREEZE 0x00004000 /* this task is being frozen for suspend now */ #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ #define PF_FROZEN 0x00010000 /* frozen for system suspend */ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ @@ -721,6 +742,8 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); #else static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) { + if (!cpus_intersects(new_mask, cpu_online_map)) + return -EINVAL; return 0; } #endif @@ -734,12 +757,19 @@ extern void sched_exec(void); #define sched_exec() {} #endif +#ifdef CONFIG_HOTPLUG_CPU +extern void idle_task_exit(void); +#else +static inline void idle_task_exit(void) {} +#endif + extern void sched_idle_next(void); extern void set_user_nice(task_t *p, long nice); extern int task_prio(const task_t *p); extern int task_nice(const task_t *p); extern int task_curr(const task_t *p); extern int idle_cpu(int cpu); +extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); extern task_t *idle_task(int cpu); void yield(void); @@ -1043,29 +1073,36 @@ static inline int need_resched(void) return unlikely(test_thread_flag(TIF_NEED_RESCHED)); } -extern void __cond_resched(void); -static inline void cond_resched(void) -{ - if (need_resched()) - __cond_resched(); -} +/* + * cond_resched() and cond_resched_lock(): latency reduction via + * explicit rescheduling in places that are safe. The return + * value indicates whether a reschedule was done in fact. + * cond_resched_lock() will drop the spinlock before scheduling, + * cond_resched_softirq() will enable bhs before scheduling. + */ +extern int cond_resched(void); +extern int cond_resched_lock(spinlock_t * lock); +extern int cond_resched_softirq(void); /* - * cond_resched_lock() - if a reschedule is pending, drop the given lock, - * call schedule, and on return reacquire the lock. - * - * This works OK both with and without CONFIG_PREEMPT. We do strange low-level - * operations here to prevent schedule() from being called twice (once via - * spin_unlock(), once by hand). + * Does a critical section need to be broken due to another + * task waiting?: + */ +#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) +# define need_lockbreak(lock) ((lock)->break_lock) +#else +# define need_lockbreak(lock) 0 +#endif + +/* + * Does a critical section need to be broken due to another + * task waiting or preemption being signalled: */ -static inline void cond_resched_lock(spinlock_t * lock) +static inline int lock_need_resched(spinlock_t *lock) { - if (need_resched()) { - _raw_spin_unlock(lock); - preempt_enable_no_resched(); - __cond_resched(); - spin_lock(lock); - } + if (need_lockbreak(lock) || need_resched()) + return 1; + return 0; } /* Reevaluate whether the task has signals pending delivery. diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 1ed3da0cb9d0..6ec66dec29f7 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -364,7 +364,7 @@ typedef struct sctp_heartbeat_chunk { */ typedef struct sctp_abort_chunk { sctp_chunkhdr_t uh; -} __attribute__((packed)) sctp_abort_chunkt_t; +} __attribute__((packed)) sctp_abort_chunk_t; /* For the graceful shutdown we must carry the tag (in common header) diff --git a/include/linux/security.h b/include/linux/security.h index 4e0795b5a276..2b048ec62e9c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -109,13 +109,20 @@ struct swap_info_struct; * and the information saved in @bprm->security by the set_security hook. * Since this hook function (and its caller) are void, this hook can not * return an error. However, it can leave the security attributes of the - * process unchanged if an access failure occurs at this point. It can - * also perform other state changes on the process (e.g. closing open - * file descriptors to which access is no longer granted if the attributes - * were changed). + * process unchanged if an access failure occurs at this point. * bprm_apply_creds is called under task_lock. @unsafe indicates various * reasons why it may be unsafe to change security state. * @bprm contains the linux_binprm structure. + * @bprm_post_apply_creds: + * Runs after bprm_apply_creds with the task_lock dropped, so that + * functions which cannot be called safely under the task_lock can + * be used. This hook is a good place to perform state changes on + * the process such as closing open file descriptors to which access + * is no longer granted if the attributes were changed. + * Note that a security module might need to save state between + * bprm_apply_creds and bprm_post_apply_creds to store the decision + * on whether the process may proceed. + * @bprm contains the linux_binprm structure. * @bprm_set_security: * Save security information in the bprm->security field, typically based * on information about the bprm->file, for later use by the apply_creds @@ -1042,6 +1049,7 @@ struct security_operations { int (*bprm_alloc_security) (struct linux_binprm * bprm); void (*bprm_free_security) (struct linux_binprm * bprm); void (*bprm_apply_creds) (struct linux_binprm * bprm, int unsafe); + void (*bprm_post_apply_creds) (struct linux_binprm * bprm); int (*bprm_set_security) (struct linux_binprm * bprm); int (*bprm_check_security) (struct linux_binprm * bprm); int (*bprm_secureexec) (struct linux_binprm * bprm); @@ -1314,6 +1322,10 @@ static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int uns { security_ops->bprm_apply_creds (bprm, unsafe); } +static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm) +{ + security_ops->bprm_post_apply_creds (bprm); +} static inline int security_bprm_set (struct linux_binprm *bprm) { return security_ops->bprm_set_security (bprm); @@ -1992,6 +2004,11 @@ static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int uns cap_bprm_apply_creds (bprm, unsafe); } +static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm) +{ + return; +} + static inline int security_bprm_set (struct linux_binprm *bprm) { return cap_bprm_set_security (bprm); diff --git a/include/linux/selection.h b/include/linux/selection.h index 059c958951f3..ed3408b400f1 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -10,7 +10,7 @@ #include <linux/tiocl.h> #include <linux/vt_buffer.h> -extern int sel_cons; +extern struct vc_data *sel_cons; extern void clear_selection(void); extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); @@ -19,11 +19,6 @@ extern int sel_loadlut(char __user *p); extern int mouse_reporting(void); extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry); -#define video_num_columns (vc_cons[currcons].d->vc_cols) -#define video_num_lines (vc_cons[currcons].d->vc_rows) -#define video_size_row (vc_cons[currcons].d->vc_size_row) -#define can_do_color (vc_cons[currcons].d->vc_can_do_color) - extern int console_blanked; extern unsigned char color_table[]; @@ -31,15 +26,15 @@ extern int default_red[]; extern int default_grn[]; extern int default_blu[]; -extern unsigned short *screen_pos(int currcons, int w_offset, int viewed); -extern u16 screen_glyph(int currcons, int offset); -extern void complement_pos(int currcons, int offset); -extern void invert_screen(int currcons, int offset, int count, int shift); +extern unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed); +extern u16 screen_glyph(struct vc_data *vc, int offset); +extern void complement_pos(struct vc_data *vc, int offset); +extern void invert_screen(struct vc_data *vc, int offset, int count, int shift); -extern void getconsxy(int currcons, unsigned char *p); -extern void putconsxy(int currcons, unsigned char *p); +extern void getconsxy(struct vc_data *vc, unsigned char *p); +extern void putconsxy(struct vc_data *vc, unsigned char *p); -extern u16 vcs_scr_readw(int currcons, const u16 *org); -extern void vcs_scr_writew(int currcons, u16 val, u16 *org); +extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org); +extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org); #endif diff --git a/include/linux/sem.h b/include/linux/sem.h index c365f7989928..2d8516be9fd7 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -109,6 +109,7 @@ struct sem_queue { int id; /* internal sem id */ struct sembuf * sops; /* array of pending operations */ int nsops; /* number of operations */ + int alter; /* does the operation alter the array? */ }; /* Each task has a list of undo requests. They are executed automatically diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9666c572f65b..84d80cfe7b41 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -100,6 +100,9 @@ /* Motorola i.MX SoC */ #define PORT_IMX 62 +/* Marvell MPSC */ +#define PORT_MPSC 63 + #ifdef __KERNEL__ #include <linux/config.h> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b1d0c472d19c..a6b744bccdc8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1086,14 +1086,9 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err); extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait); -extern int skb_copy_datagram(const struct sk_buff *from, - int offset, char __user *to, int size); extern int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, struct iovec *to, int size); -extern int skb_copy_and_csum_datagram(const struct sk_buff *skb, - int offset, u8 __user *to, - int len, unsigned int *csump); extern int skb_copy_and_csum_datagram_iovec(const struct sk_buff *skb, int hlen, diff --git a/include/linux/slab.h b/include/linux/slab.h index 93c8264fe67b..0c7ae4f678a2 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -118,7 +118,6 @@ extern kmem_cache_t *mm_cachep; extern kmem_cache_t *names_cachep; extern kmem_cache_t *files_cachep; extern kmem_cache_t *filp_cachep; -extern kmem_cache_t *dquot_cachep; extern kmem_cache_t *fs_cachep; extern kmem_cache_t *signal_cachep; extern kmem_cache_t *sighand_cachep; diff --git a/include/linux/smp.h b/include/linux/smp.h index 312ec58a4025..c438ec9880e9 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -8,6 +8,8 @@ #include <linux/config.h> +extern void cpu_idle(void); + #ifdef CONFIG_SMP #include <linux/preempt.h> @@ -95,8 +97,10 @@ void smp_prepare_boot_cpu(void); /* * These macros fold the SMP functionality into a single CPU system */ - -#define smp_processor_id() 0 + +#if !defined(__smp_processor_id) || !defined(CONFIG_PREEMPT) +# define smp_processor_id() 0 +#endif #define hard_smp_processor_id() 0 #define smp_threads_ready 1 #define smp_call_function(func,info,retry,wait) ({ 0; }) @@ -107,6 +111,33 @@ static inline void smp_send_reschedule(int cpu) { } #endif /* !SMP */ +/* + * DEBUG_PREEMPT support: check whether smp_processor_id() is being + * used in a preemption-safe way. + * + * An architecture has to enable this debugging code explicitly. + * It can do so by renaming the smp_processor_id() macro to + * __smp_processor_id(). This should only be done after some minimal + * testing, because usually there are a number of false positives + * that an architecture will trigger. + * + * To fix a false positive (i.e. smp_processor_id() use that the + * debugging code reports but which use for some reason is legal), + * change the smp_processor_id() reference to _smp_processor_id(), + * which is the nondebug variant. NOTE: don't use this to hack around + * real bugs. + */ +#ifdef __smp_processor_id +# if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT) + extern unsigned int smp_processor_id(void); +# else +# define smp_processor_id() __smp_processor_id() +# endif +# define _smp_processor_id() __smp_processor_id() +#else +# define _smp_processor_id() smp_processor_id() +#endif + #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) #define put_cpu() preempt_enable() #define put_cpu_no_resched() preempt_enable_no_resched() diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 8a142e0311a2..b63ce7014093 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h @@ -9,15 +9,15 @@ #define kernel_locked() (current->lock_depth >= 0) -extern int __lockfunc get_kernel_lock(void); -extern void __lockfunc put_kernel_lock(void); +extern int __lockfunc __reacquire_kernel_lock(void); +extern void __lockfunc __release_kernel_lock(void); /* * Release/re-acquire global kernel lock for the scheduler */ #define release_kernel_lock(tsk) do { \ if (unlikely((tsk)->lock_depth >= 0)) \ - put_kernel_lock(); \ + __release_kernel_lock(); \ } while (0) /* @@ -26,16 +26,16 @@ extern void __lockfunc put_kernel_lock(void); * reacquire_kernel_lock() so that the compiler can see * it at compile-time. */ -#ifdef CONFIG_SMP -#define return_value_on_smp return +#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_BKL) +# define return_value_on_smp return #else -#define return_value_on_smp +# define return_value_on_smp #endif static inline int reacquire_kernel_lock(struct task_struct *task) { if (unlikely(task->lock_depth >= 0)) - return_value_on_smp get_kernel_lock(); + return_value_on_smp __reacquire_kernel_lock(); return 0; } diff --git a/include/linux/socket.h b/include/linux/socket.h index 4c7d11301abf..769ff4fc01b0 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -286,7 +286,6 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); -extern void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len); extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen); extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr); extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 41220e075bca..b8224ded2d97 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -41,6 +41,7 @@ #include <asm/spinlock.h> int __lockfunc _spin_trylock(spinlock_t *lock); +int __lockfunc _read_trylock(rwlock_t *lock); int __lockfunc _write_trylock(rwlock_t *lock); void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); @@ -73,6 +74,7 @@ void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(rwlock_t); void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(rwlock_t); int __lockfunc _spin_trylock_bh(spinlock_t *lock); +int __lockfunc generic_raw_read_trylock(rwlock_t *lock); int in_lock_functions(unsigned long addr); #else @@ -219,11 +221,15 @@ typedef struct { #define _raw_read_unlock(lock) do { (void)(lock); } while(0) #define _raw_write_lock(lock) do { (void)(lock); } while(0) #define _raw_write_unlock(lock) do { (void)(lock); } while(0) +#define _raw_read_trylock(lock) ({ (void)(lock); (1); }) #define _raw_write_trylock(lock) ({ (void)(lock); (1); }) #define _spin_trylock(lock) ({preempt_disable(); _raw_spin_trylock(lock) ? \ 1 : ({preempt_enable(); 0;});}) +#define _read_trylock(lock) ({preempt_disable();_raw_read_trylock(lock) ? \ + 1 : ({preempt_enable(); 0;});}) + #define _write_trylock(lock) ({preempt_disable(); _raw_write_trylock(lock) ? \ 1 : ({preempt_enable(); 0;});}) @@ -425,16 +431,12 @@ do { \ * methods are defined as nops in the case they are not required. */ #define spin_trylock(lock) __cond_lock(_spin_trylock(lock)) +#define read_trylock(lock) __cond_lock(_read_trylock(lock)) #define write_trylock(lock) __cond_lock(_write_trylock(lock)) -/* Where's read_trylock? */ - #define spin_lock(lock) _spin_lock(lock) #define write_lock(lock) _write_lock(lock) #define read_lock(lock) _read_lock(lock) -#define spin_unlock(lock) _spin_unlock(lock) -#define write_unlock(lock) _write_unlock(lock) -#define read_unlock(lock) _read_unlock(lock) #ifdef CONFIG_SMP #define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) @@ -454,6 +456,11 @@ do { \ #define write_lock_irq(lock) _write_lock_irq(lock) #define write_lock_bh(lock) _write_lock_bh(lock) + +#define spin_unlock(lock) _spin_unlock(lock) +#define write_unlock(lock) _write_unlock(lock) +#define read_unlock(lock) _read_unlock(lock) + #define spin_unlock_irqrestore(lock, flags) _spin_unlock_irqrestore(lock, flags) #define spin_unlock_irq(lock) _spin_unlock_irq(lock) #define spin_unlock_bh(lock) _spin_unlock_bh(lock) @@ -468,6 +475,20 @@ do { \ #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) +#define spin_trylock_irq(lock) \ +({ \ + local_irq_disable(); \ + _spin_trylock(lock) ? \ + 1 : ({local_irq_enable(); 0; }); \ +}) + +#define spin_trylock_irqsave(lock, flags) \ +({ \ + local_irq_save(flags); \ + _spin_trylock(lock) ? \ + 1 : ({local_irq_restore(flags); 0;}); \ +}) + #ifdef CONFIG_LOCKMETER extern void _metered_spin_lock (spinlock_t *lock); extern void _metered_spin_unlock (spinlock_t *lock); @@ -476,6 +497,7 @@ extern void _metered_read_lock (rwlock_t *lock); extern void _metered_read_unlock (rwlock_t *lock); extern void _metered_write_lock (rwlock_t *lock); extern void _metered_write_unlock (rwlock_t *lock); +extern int _metered_read_trylock (rwlock_t *lock); extern int _metered_write_trylock(rwlock_t *lock); #endif @@ -505,8 +527,11 @@ static inline void bit_spin_lock(int bitnum, unsigned long *addr) preempt_disable(); #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) while (test_and_set_bit(bitnum, addr)) { - while (test_bit(bitnum, addr)) + while (test_bit(bitnum, addr)) { + preempt_enable(); cpu_relax(); + preempt_disable(); + } } #endif __acquire(bitlock); @@ -556,4 +581,7 @@ static inline int bit_spin_is_locked(int bitnum, unsigned long *addr) #endif } +#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED +#define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED + #endif /* __LINUX_SPINLOCK_H */ diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 97976c431d0b..f6d27720962e 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -51,7 +51,6 @@ struct rpc_cred { }; #define RPCAUTH_CRED_LOCKED 0x0001 #define RPCAUTH_CRED_UPTODATE 0x0002 -#define RPCAUTH_CRED_DEAD 0x0004 #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 @@ -131,7 +130,6 @@ int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, int rpcauth_refreshcred(struct rpc_task *); void rpcauth_invalcred(struct rpc_task *); int rpcauth_uptodatecred(struct rpc_task *); -int rpcauth_deadcred(struct rpc_task *); void rpcauth_init_credcache(struct rpc_auth *); void rpcauth_free_credcache(struct rpc_auth *); diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 71d710450e84..933eeb005f09 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -11,7 +11,9 @@ #include <linux/timer.h> #include <linux/sunrpc/types.h> +#include <linux/spinlock.h> #include <linux/wait.h> +#include <linux/workqueue.h> #include <linux/sunrpc/xdr.h> /* @@ -25,11 +27,18 @@ struct rpc_message { struct rpc_cred * rpc_cred; /* Credentials */ }; +struct rpc_wait_queue; +struct rpc_wait { + struct list_head list; /* wait queue links */ + struct list_head links; /* Links to related tasks */ + wait_queue_head_t waitq; /* sync: sleep on this q */ + struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */ +}; + /* * This is the RPC task struct */ struct rpc_task { - struct list_head tk_list; /* wait queue links */ #ifdef RPC_DEBUG unsigned long tk_magic; /* 0xf00baa */ #endif @@ -37,7 +46,6 @@ struct rpc_task { struct rpc_clnt * tk_client; /* RPC client */ struct rpc_rqst * tk_rqstp; /* RPC request */ int tk_status; /* result of last operation */ - struct rpc_wait_queue * tk_rpcwait; /* RPC wait queue we're on */ /* * RPC call state @@ -70,13 +78,18 @@ struct rpc_task { * you have a pathological interest in kernel oopses. */ struct timer_list tk_timer; /* kernel timer */ - wait_queue_head_t tk_wait; /* sync: sleep on this q */ unsigned long tk_timeout; /* timeout for rpc_sleep() */ unsigned short tk_flags; /* misc flags */ unsigned char tk_active : 1;/* Task has been activated */ unsigned char tk_priority : 2;/* Task priority */ unsigned long tk_runstate; /* Task run status */ - struct list_head tk_links; /* links to related tasks */ + struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could + * be any workqueue + */ + union { + struct work_struct tk_work; /* Async task work queue */ + struct rpc_wait tk_wait; /* RPC wait */ + } u; #ifdef RPC_DEBUG unsigned short tk_pid; /* debugging aid */ #endif @@ -87,11 +100,11 @@ struct rpc_task { /* support walking a list of tasks on a wait queue */ #define task_for_each(task, pos, head) \ list_for_each(pos, head) \ - if ((task=list_entry(pos, struct rpc_task, tk_list)),1) + if ((task=list_entry(pos, struct rpc_task, u.tk_wait.list)),1) #define task_for_first(task, head) \ if (!list_empty(head) && \ - ((task=list_entry((head)->next, struct rpc_task, tk_list)),1)) + ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) /* .. and walking list of all tasks */ #define alltask_for_each(task, pos, head) \ @@ -126,22 +139,39 @@ typedef void (*rpc_action)(struct rpc_task *); #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) #define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR) -#define RPC_TASK_SLEEPING 0 -#define RPC_TASK_RUNNING 1 -#define RPC_IS_SLEEPING(t) (test_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate)) -#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) +#define RPC_TASK_RUNNING 0 +#define RPC_TASK_QUEUED 1 +#define RPC_TASK_WAKEUP 2 +#define RPC_TASK_HAS_TIMER 3 +#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) -#define rpc_clear_running(t) (clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) +#define rpc_test_and_set_running(t) \ + (test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) +#define rpc_clear_running(t) \ + do { \ + smp_mb__before_clear_bit(); \ + clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate); \ + smp_mb__after_clear_bit(); \ + } while (0) -#define rpc_set_sleeping(t) (set_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate)) +#define RPC_IS_QUEUED(t) (test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) +#define rpc_set_queued(t) (set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) +#define rpc_clear_queued(t) \ + do { \ + smp_mb__before_clear_bit(); \ + clear_bit(RPC_TASK_QUEUED, &(t)->tk_runstate); \ + smp_mb__after_clear_bit(); \ + } while (0) -#define rpc_clear_sleeping(t) \ +#define rpc_start_wakeup(t) \ + (test_and_set_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate) == 0) +#define rpc_finish_wakeup(t) \ do { \ smp_mb__before_clear_bit(); \ - clear_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate); \ + clear_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate); \ smp_mb__after_clear_bit(); \ - } while(0) + } while (0) /* * Task priorities. @@ -157,6 +187,7 @@ typedef void (*rpc_action)(struct rpc_task *); * RPC synchronization objects */ struct rpc_wait_queue { + spinlock_t lock; struct list_head tasks[RPC_NR_PRIORITY]; /* task queue for each priority level */ unsigned long cookie; /* cookie of last task serviced */ unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ @@ -177,6 +208,7 @@ struct rpc_wait_queue { #ifndef RPC_DEBUG # define RPC_WAITQ_INIT(var,qname) { \ + .lock = SPIN_LOCK_UNLOCKED, \ .tasks = { \ [0] = LIST_HEAD_INIT(var.tasks[0]), \ [1] = LIST_HEAD_INIT(var.tasks[1]), \ @@ -185,6 +217,7 @@ struct rpc_wait_queue { } #else # define RPC_WAITQ_INIT(var,qname) { \ + .lock = SPIN_LOCK_UNLOCKED, \ .tasks = { \ [0] = LIST_HEAD_INIT(var.tasks[0]), \ [1] = LIST_HEAD_INIT(var.tasks[1]), \ @@ -209,13 +242,10 @@ void rpc_killall_tasks(struct rpc_clnt *); int rpc_execute(struct rpc_task *); void rpc_run_child(struct rpc_task *parent, struct rpc_task *child, rpc_action action); -int rpc_add_wait_queue(struct rpc_wait_queue *, struct rpc_task *); -void rpc_remove_wait_queue(struct rpc_task *); void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, rpc_action action, rpc_action timer); -void rpc_add_timer(struct rpc_task *, rpc_action); void rpc_wake_up_task(struct rpc_task *); void rpc_wake_up(struct rpc_wait_queue *); struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 4e4c2962809f..898ed7dada2d 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -1,7 +1,7 @@ #ifndef _LINUX_SWSUSP_H #define _LINUX_SWSUSP_H -#ifdef CONFIG_X86 +#if defined(CONFIG_X86) || defined(CONFIG_FRV) #include <asm/suspend.h> #endif #include <linux/swap.h> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 06a76c25f096..757cd9be7743 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -63,7 +63,7 @@ struct mq_attr; #include <linux/quota.h> #include <linux/key.h> -asmlinkage long sys_time(int __user *tloc); +asmlinkage long sys_time(time_t __user *tloc); asmlinkage long sys_stime(time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz); diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index d12ee2b1eaef..6f502ff7902a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -2,6 +2,7 @@ * sysfs.h - definitions for the device driver filesystem * * Copyright (c) 2001,2002 Patrick Mochel + * Copyright (c) 2004 Silicon Graphics, Inc. * * Please see Documentation/filesystems/sysfs.txt for more information. */ @@ -47,11 +48,16 @@ struct attribute_group { #define attr_name(_attr) (_attr).attr.name +struct vm_area_struct; + struct bin_attribute { struct attribute attr; size_t size; + void *private; ssize_t (*read)(struct kobject *, char *, loff_t, size_t); ssize_t (*write)(struct kobject *, char *, loff_t, size_t); + int (*mmap)(struct kobject *, struct bin_attribute *attr, + struct vm_area_struct *vma); }; struct sysfs_ops { diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 61de59d3cef4..b8d7df3916a5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -214,7 +214,9 @@ enum tcp_congestion_algo { TCP_BIC, }; -struct tcp_opt { +struct tcp_sock { + /* inet_sock has to be the first member of tcp_sock */ + struct inet_sock inet; int tcp_header_len; /* Bytes of tcp header to send */ /* @@ -438,15 +440,9 @@ struct tcp_opt { } bictcp; }; -/* WARNING: don't change the layout of the members in tcp_sock! */ -struct tcp_sock { - struct inet_sock inet; - struct tcp_opt tcp; -}; - -static inline struct tcp_opt * tcp_sk(const struct sock *__sk) +static inline struct tcp_sock *tcp_sk(const struct sock *sk) { - return &((struct tcp_sock *)__sk)->tcp; + return (struct tcp_sock *)sk; } #endif diff --git a/include/linux/time.h b/include/linux/time.h index 0814ed4a4586..5634497ff5df 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -90,6 +90,7 @@ static inline unsigned long get_seconds(void) struct timespec current_kernel_time(void); #define CURRENT_TIME (current_kernel_time()) +#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) extern void do_gettimeofday(struct timeval *tv); extern int do_settimeofday(struct timespec *tv); @@ -103,6 +104,8 @@ extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ov extern int do_getitimer(int which, struct itimerval *value); extern void getnstimeofday (struct timespec *tv); +extern struct timespec timespec_trunc(struct timespec t, unsigned gran); + static inline void set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) { diff --git a/include/linux/topology.h b/include/linux/topology.h index 1206d5a983a9..295f4c05c7f5 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -43,16 +43,9 @@ }) #endif -static inline int __next_node_with_cpus(int node) -{ - do - ++node; - while (node < numnodes && !nr_cpus_node(node)); - return node; -} - -#define for_each_node_with_cpus(node) \ - for (node = 0; node < numnodes; node = __next_node_with_cpus(node)) +#define for_each_node_with_cpus(node) \ + for_each_online_node(node) \ + if (nr_cpus_node(node)) #ifndef node_distance /* Conform to ACPI 2.0 SLIT distance definitions */ @@ -116,13 +109,14 @@ static inline int __next_node_with_cpus(int node) .max_interval = 4, \ .busy_factor = 64, \ .imbalance_pct = 125, \ - .cache_hot_time = (5*1000/2), \ + .cache_hot_time = (5*1000000/2), \ .cache_nice_tries = 1, \ .per_cpu_gain = 100, \ .flags = SD_LOAD_BALANCE \ | SD_BALANCE_NEWIDLE \ | SD_BALANCE_EXEC \ | SD_WAKE_AFFINE \ + | SD_WAKE_IDLE \ | SD_WAKE_BALANCE, \ .last_balance = jiffies, \ .balance_interval = 1, \ diff --git a/include/linux/udp.h b/include/linux/udp.h index 831a3f532a10..b60e0b4a25c4 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -40,26 +40,22 @@ struct udphdr { #include <net/sock.h> #include <linux/ip.h> -struct udp_opt { - int pending; /* Any pending frames ? */ - unsigned int corkflag; /* Cork is required */ - __u16 encap_type; /* Is this an Encapsulation socket? */ +struct udp_sock { + /* inet_sock has to be the first member */ + struct inet_sock inet; + int pending; /* Any pending frames ? */ + unsigned int corkflag; /* Cork is required */ + __u16 encap_type; /* Is this an Encapsulation socket? */ /* * Following member retains the infomation to create a UDP header * when the socket is uncorked. */ - __u16 len; /* total length of pending frames */ -}; - -/* WARNING: don't change the layout of the members in udp_sock! */ -struct udp_sock { - struct inet_sock inet; - struct udp_opt udp; + __u16 len; /* total length of pending frames */ }; -static inline struct udp_opt * udp_sk(const struct sock *__sk) +static inline struct udp_sock *udp_sk(const struct sock *sk) { - return &((struct udp_sock *)__sk)->udp; + return (struct udp_sock *)sk; } #endif diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h deleted file mode 100644 index 67c25693db66..000000000000 --- a/include/linux/umsdos_fs.h +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef LINUX_UMSDOS_FS_H -#define LINUX_UMSDOS_FS_H - - -/*#define UMS_DEBUG 1 // define for check_* functions */ -/*#define UMSDOS_DEBUG 1*/ -#define UMSDOS_PARANOIA 1 - -#define UMSDOS_VERSION 0 -#define UMSDOS_RELEASE 4 - -#define UMSDOS_ROOT_INO 1 - -/* This is the file acting as a directory extension */ -#define UMSDOS_EMD_FILE "--linux-.---" -#define UMSDOS_EMD_NAMELEN 12 -#define UMSDOS_PSDROOT_NAME "linux" -#define UMSDOS_PSDROOT_LEN 5 - -#ifndef _LINUX_TYPES_H -#include <linux/types.h> -#endif -#ifndef _LINUX_LIMITS_H -#include <linux/limits.h> -#endif -#ifndef _LINUX_DIRENT_H -#include <linux/dirent.h> -#endif -#ifndef _LINUX_IOCTL_H -#include <linux/ioctl.h> -#endif - - -#ifdef __KERNEL__ -/* #Specification: convention / PRINTK Printk and printk - * Here is the convention for the use of printk inside fs/umsdos - * - * printk carry important message (error or status). - * Printk is for debugging (it is a macro defined at the beginning of - * most source. - * PRINTK is a nulled Printk macro. - * - * This convention makes the source easier to read, and Printk easier - * to shut off. - */ -# define PRINTK(x) -# ifdef UMSDOS_DEBUG -# define Printk(x) printk x -# else -# define Printk(x) -# endif -#endif /* __KERNEL__ */ - - -struct umsdos_fake_info { - char fname[13]; - int len; -}; - -#define UMSDOS_MAXNAME 220 -/* This structure is 256 bytes large, depending on the name, only part */ -/* of it is written to disk */ -/* nice though it would be, I can't change this and preserve backward compatibility */ -struct umsdos_dirent { - unsigned char name_len; /* if == 0, then this entry is not used */ - unsigned char flags; /* UMSDOS_xxxx */ - unsigned short nlink; /* How many hard links point to this entry */ - __kernel_uid_t uid; /* Owner user id */ - __kernel_gid_t gid; /* Group id */ - time_t atime; /* Access time */ - time_t mtime; /* Last modification time */ - time_t ctime; /* Creation time */ - unsigned short rdev; /* major and minor of a device special file */ - umode_t mode; /* Standard UNIX permissions bits + type of */ - char spare[12]; /* unused bytes for future extensions */ - /* file, see linux/stat.h */ - char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */ - /* but '\0' padded, so it will allow */ - /* for adding news fields in this record */ - /* by reducing the size of name[] */ -}; - -#define UMSDOS_HIDDEN 1 /* Never show this entry in directory search */ -#define UMSDOS_HLINK 2 /* It is a (pseudo) hard link */ - -/* #Specification: EMD file / record size - * Entry are 64 bytes wide in the EMD file. It allows for a 30 characters - * name. If a name is longer, contiguous entries are allocated. So a - * umsdos_dirent may span multiple records. - */ - -#define UMSDOS_REC_SIZE 64 - -/* Translation between MSDOS name and UMSDOS name */ - -struct umsdos_info { - int msdos_reject; /* Tell if the file name is invalid for MSDOS */ - /* See umsdos_parse */ - struct umsdos_fake_info fake; - struct umsdos_dirent entry; - off_t f_pos; /* offset of the entry in the EMD file - * or offset where the entry may be store - * if it is a new entry - */ - int recsize; /* Record size needed to store entry */ -}; - -/* Definitions for ioctl (number randomly chosen) - * The next ioctl commands operate only on the DOS directory - * The file umsdos_progs/umsdosio.c contain a string table - * based on the order of those definition. Keep it in sync - */ -#define UMSDOS_READDIR_DOS _IO(0x04,210) /* Do a readdir of the DOS directory */ -#define UMSDOS_UNLINK_DOS _IO(0x04,211) /* Erase in the DOS directory only */ -#define UMSDOS_RMDIR_DOS _IO(0x04,212) /* rmdir in the DOS directory only */ -#define UMSDOS_STAT_DOS _IO(0x04,213) /* Get info about a file */ - -/* The next ioctl commands operate only on the EMD file */ -#define UMSDOS_CREAT_EMD _IO(0x04,214) /* Create a file */ -#define UMSDOS_UNLINK_EMD _IO(0x04,215) /* unlink (rmdir) a file */ -#define UMSDOS_READDIR_EMD _IO(0x04,216) /* read the EMD file only. */ -#define UMSDOS_GETVERSION _IO(0x04,217) /* Get the release number of UMSDOS */ -#define UMSDOS_INIT_EMD _IO(0x04,218) /* Create the EMD file if not there */ -#define UMSDOS_DOS_SETUP _IO(0x04,219) /* Set the defaults of the MS-DOS driver. */ - -#define UMSDOS_RENAME_DOS _IO(0x04,220) /* rename a file/directory in the DOS - * directory only */ -struct umsdos_ioctl { - struct dirent dos_dirent; - struct umsdos_dirent umsdos_dirent; - /* The following structure is used to exchange some data with - * utilities (umsdos_progs/util/umsdosio.c). The first releases - * were using struct stat from "sys/stat.h". This was causing - * some problem for cross compilation of the kernel. - * Since I am not really using the structure stat, but only - * some fields of it, I have decided to replicate the structure - * here for compatibility with the binaries out there. - * FIXME PTW 1998, this has probably changed - */ - - struct { - unsigned long st_dev; - ino_t st_ino; /* used */ - umode_t st_mode; /* used */ - nlink_t st_nlink; - __kernel_uid_t st_uid; - __kernel_gid_t st_gid; - unsigned long st_rdev; - off_t st_size; /* used */ - unsigned long st_blksize; - unsigned long st_blocks; - time_t st_atime; /* used */ - unsigned long __unused1; - time_t st_mtime; /* used */ - unsigned long __unused2; - time_t st_ctime; /* used */ - unsigned long __unused3; - uid_t st_uid32; - gid_t st_gid32; - } stat; - char version, release; -}; - -/* Different macros to access struct umsdos_dirent */ -#define EDM_ENTRY_ISUSED(e) ((e)->name_len!=0) - -#ifdef __KERNEL__ - -#ifndef LINUX_FS_H -#include <linux/fs.h> -#endif - -extern struct inode_operations umsdos_dir_inode_operations; -extern struct inode_operations umsdos_rdir_inode_operations; -extern struct file_operations umsdos_dir_operations; -extern struct file_operations umsdos_rdir_operations; - -#include <linux/umsdos_fs.p> - -#endif /* __KERNEL__ */ - -#endif diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p deleted file mode 100644 index 1c284c5a7aec..000000000000 --- a/include/linux/umsdos_fs.p +++ /dev/null @@ -1,100 +0,0 @@ -/* check.c 23/01/95 03.38.30 */ -void check_page_tables (void); - -/* dir.c 22/06/95 00.22.12 */ -int dummy_dir_read ( struct file *filp, - char *buf, - size_t size, - loff_t *count); -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 nameidata *); -struct dentry *umsdos_lookup_dentry(struct dentry *, char *, int, int); -struct dentry *umsdos_covered(struct dentry *, char *, int); - -struct dentry *umsdos_solve_hlink (struct dentry *hlink); - -/* emd.c 22/06/95 00.22.04 */ -struct dentry *umsdos_get_emd_dentry(struct dentry *); -int umsdos_have_emd(struct dentry *); -int umsdos_make_emd(struct dentry *); -int umsdos_emd_dir_readentry (struct dentry *, loff_t *, struct umsdos_dirent *); -int umsdos_newentry (struct dentry *, struct umsdos_info *); -int umsdos_newhidden (struct dentry *, struct umsdos_info *); -int umsdos_delentry (struct dentry *, struct umsdos_info *, int); -int umsdos_findentry (struct dentry *, struct umsdos_info *, int); -int umsdos_isempty (struct dentry *); -int umsdos_writeentry (struct dentry *, struct umsdos_info *, int); - -/* file.c 25/01/95 02.25.38 */ - -/* inode.c 12/06/95 09.49.40 */ -void fill_new_filp (struct file *filp, struct dentry *dentry); -void UMSDOS_read_inode (struct inode *); -void UMSDOS_write_inode (struct inode *, int); -int UMSDOS_notify_change (struct dentry *, struct iattr *attr); -int umsdos_notify_change_locked(struct dentry *, struct iattr *attr); -void UMSDOS_put_inode (struct inode *); -int UMSDOS_statfs (struct super_block *, struct statfs *); -struct super_block *UMSDOS_read_super (struct super_block *, void *, int); -void UMSDOS_put_super (struct super_block *); - -void umsdos_setup_dir(struct dentry *); -void umsdos_set_dirinfo_new(struct dentry *, off_t); -void umsdos_patch_dentry_inode (struct dentry *, off_t); -int umsdos_get_dirowner (struct inode *inode, struct inode **result); - -/* ioctl.c 22/06/95 00.22.08 */ -int UMSDOS_ioctl_dir (struct inode *dir, - struct file *filp, - unsigned int cmd, - unsigned long data); - -/* mangle.c 25/01/95 02.25.38 */ -void umsdos_manglename (struct umsdos_info *info); -int umsdos_evalrecsize (int len); -int umsdos_parse (const char *name,int len, struct umsdos_info *info); - -/* namei.c 25/01/95 02.25.38 */ -void umsdos_lockcreate (struct inode *dir); -void umsdos_startlookup (struct inode *dir); -void umsdos_unlockcreate (struct inode *dir); -void umsdos_endlookup (struct inode *dir); - -int umsdos_readlink_x ( struct dentry *dentry, - char *buffer, - int bufsiz); -int UMSDOS_symlink (struct inode *dir, - struct dentry *dentry, - const char *symname); -int UMSDOS_link (struct dentry *olddentry, - struct inode *dir, - struct dentry *dentry); -int UMSDOS_create (struct inode *dir, - struct dentry *dentry, - int mode); - -int UMSDOS_mkdir (struct inode *dir, - struct dentry *dentry, - int mode); -int UMSDOS_mknod (struct inode *dir, - struct dentry *dentry, - int mode, - dev_t rdev); -int UMSDOS_rmdir (struct inode *dir,struct dentry *dentry); -int UMSDOS_unlink (struct inode *dir, struct dentry *dentry); -int UMSDOS_rename (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry); - -/* 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 nameidata *nd); - -static inline struct umsdos_inode_info *UMSDOS_I(struct inode *inode) -{ - return &inode->u.umsdos_i; -} diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h deleted file mode 100644 index f4c992b44cd2..000000000000 --- a/include/linux/umsdos_fs_i.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef UMSDOS_FS_I_H -#define UMSDOS_FS_I_H - -#ifndef _LINUX_TYPES_H -#include <linux/types.h> -#endif - -#include <linux/msdos_fs_i.h> -#include <linux/pipe_fs_i.h> - -/* #Specification: strategy / in memory inode - * Here is the information specific to the inode of the UMSDOS file - * system. This information is added to the end of the standard struct - * inode. Each file system has its own extension to struct inode, - * so do the umsdos file system. - * - * The strategy is to have the umsdos_inode_info as a superset of - * the msdos_inode_info, since most of the time the job is done - * by the msdos fs code. - * - * So we duplicate the msdos_inode_info, and add our own info at the - * end. - * - * The offset in this EMD file of the entry: pos - * - * For directory, we have dir_locking_info to help synchronise - * file creation and file lookup. See also msdos_fs_i.h for more - * information about msdos_inode_info. - * - * Special file and fifo do have an inode which correspond to an - * empty MSDOS file. - * - * symlink are processed mostly like regular file. The content is the - * link. - * - * The UMSDOS specific extension is placed after the union. - */ - -struct dir_locking_info { - wait_queue_head_t p; - short int looking; /* How many process doing a lookup */ - short int creating; /* Is there any creation going on here - * Only one at a time, although one - * may recursively lock, so it is a counter - */ - long pid; /* pid of the process owning the creation - * lock */ -}; - -struct umsdos_inode_info { - struct msdos_inode_info msdos_info; - struct dir_locking_info dir_info; - int i_patched; /* Inode has been patched */ - int i_is_hlink; /* Resolved hardlink inode? */ - off_t pos; /* Entry offset in the emd_owner file */ -}; - -#endif diff --git a/include/linux/usb.h b/include/linux/usb.h index 18ee0751a32b..7dbcc054c7dc 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -40,9 +40,22 @@ struct usb_driver; * Devices may also have class-specific or vendor-specific descriptors. */ -/* host-side wrapper for parsed endpoint descriptors */ +/** + * struct usb_host_endpoint - host-side endpoint descriptor and queue + * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder + * @urb_list: urbs queued to this endpoint; maintained by usbcore + * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) + * with one or more transfer descriptors (TDs) per urb + * @extra: descriptors following this endpoint in the configuration + * @extralen: how many bytes of "extra" are valid + * + * USB requests are always queued to a given endpoint, identified by a + * descriptor within an active interface in a given USB configuration. + */ struct usb_host_endpoint { struct usb_endpoint_descriptor desc; + struct list_head urb_list; + void *hcpriv; unsigned char *extra; /* Extra descriptors */ int extralen; @@ -224,11 +237,6 @@ struct usb_host_config { int extralen; }; -// FIXME remove; exported only for drivers/usb/misc/auserwald.c -// prefer usb_device->epnum[0..31] -extern struct usb_endpoint_descriptor * - usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum); - int __usb_get_extra_descriptor(char *buffer, unsigned size, unsigned char type, void **ptr); #define usb_get_extra_descriptor(ifpoint,type,ptr)\ @@ -311,25 +319,25 @@ struct usb_device { struct semaphore serialize; unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */ - int epmaxpacketin[16]; /* INput endpoint specific maximums */ - int epmaxpacketout[16]; /* OUTput endpoint specific maximums */ struct usb_device *parent; /* our hub, unless we're the root */ struct usb_bus *bus; /* Bus we're part of */ + struct usb_host_endpoint ep0; struct device dev; /* Generic device interface */ struct usb_device_descriptor descriptor;/* Descriptor */ struct usb_host_config *config; /* All of the configs */ + struct usb_host_config *actconfig;/* the active configuration */ + struct usb_host_endpoint *ep_in[16]; + struct usb_host_endpoint *ep_out[16]; char **rawdescriptors; /* Raw descriptors for each config */ int have_langid; /* whether string_langid is valid yet */ int string_langid; /* language ID for strings */ - void *hcpriv; /* Host Controller private data */ - struct list_head filelist; struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ @@ -360,6 +368,8 @@ extern int usb_reset_device(struct usb_device *dev); extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); +/*-------------------------------------------------------------------------*/ + /* for drivers using iso endpoints */ extern int usb_get_current_frame_number (struct usb_device *usb_dev); @@ -729,8 +739,8 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); * to poll for transfers. After the URB has been submitted, the interval * field reflects how the transfer was actually scheduled. * The polling interval may be more frequent than requested. - * For example, some controllers have a maximum interval of 32 microseconds, - * while others support intervals of up to 1024 microseconds. + * For example, some controllers have a maximum interval of 32 milliseconds, + * while others support intervals of up to 1024 milliseconds. * Isochronous URBs also have transfer intervals. (Note that for isochronous * endpoints, as well as high speed interrupt endpoints, the encoding of * the transfer interval in the endpoint descriptor is logarithmic. @@ -1040,55 +1050,35 @@ void usb_sg_wait (struct usb_sg_request *io); /* -------------------------------------------------------------------------- */ /* - * Calling this entity a "pipe" is glorifying it. A USB pipe - * is something embarrassingly simple: it basically consists - * of the following information: - * - device number (7 bits) - * - endpoint number (4 bits) - * - current Data0/1 state (1 bit) [Historical; now gone] - * - direction (1 bit) - * - speed (1 bit) [Historical and specific to USB 1.1; now gone.] - * - max packet size (2 bits: 8, 16, 32 or 64) [Historical; now gone.] - * - pipe type (2 bits: control, interrupt, bulk, isochronous) - * - * That's 18 bits. Really. Nothing more. And the USB people have - * documented these eighteen bits as some kind of glorious - * virtual data structure. - * - * Let's not fall in that trap. We'll just encode it as a simple - * unsigned int. The encoding is: + * For various legacy reasons, Linux has a small cookie that's paired with + * a struct usb_device to identify an endpoint queue. Queue characteristics + * are defined by the endpoint's descriptor. This cookie is called a "pipe", + * an unsigned int encoded as: * - * - max size: bits 0-1 [Historical; now gone.] * - direction: bit 7 (0 = Host-to-Device [Out], * 1 = Device-to-Host [In] ... * like endpoint bEndpointAddress) - * - device: bits 8-14 ... bit positions known to uhci-hcd + * - device address: bits 8-14 ... bit positions known to uhci-hcd * - endpoint: bits 15-18 ... bit positions known to uhci-hcd - * - Data0/1: bit 19 [Historical; now gone. ] - * - lowspeed: bit 26 [Historical; now gone. ] * - pipe type: bits 30-31 (00 = isochronous, 01 = interrupt, * 10 = control, 11 = bulk) * - * Why? Because it's arbitrary, and whatever encoding we select is really - * up to us. This one happens to share a lot of bit positions with the UHCI - * specification, so that much of the uhci driver can just mask the bits - * appropriately. + * Given the device address and endpoint descriptor, pipes are redundant. */ /* NOTE: these are not the standard USB_ENDPOINT_XFER_* values!! */ +/* (yet ... they're the values used by usbfs) */ #define PIPE_ISOCHRONOUS 0 #define PIPE_INTERRUPT 1 #define PIPE_CONTROL 2 #define PIPE_BULK 3 -#define usb_maxpacket(dev, pipe, out) (out \ - ? (dev)->epmaxpacketout[usb_pipeendpoint(pipe)] \ - : (dev)->epmaxpacketin [usb_pipeendpoint(pipe)] ) - #define usb_pipein(pipe) ((pipe) & USB_DIR_IN) #define usb_pipeout(pipe) (!usb_pipein(pipe)) + #define usb_pipedevice(pipe) (((pipe) >> 8) & 0x7f) #define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf) + #define usb_pipetype(pipe) (((pipe) >> 30) & 3) #define usb_pipeisoc(pipe) (usb_pipetype((pipe)) == PIPE_ISOCHRONOUS) #define usb_pipeint(pipe) (usb_pipetype((pipe)) == PIPE_INTERRUPT) @@ -1116,6 +1106,28 @@ static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int en #define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) #define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) +/*-------------------------------------------------------------------------*/ + +static inline __u16 +usb_maxpacket(struct usb_device *udev, int pipe, int is_out) +{ + struct usb_host_endpoint *ep; + unsigned epnum = usb_pipeendpoint(pipe); + + if (is_out) { + WARN_ON(usb_pipein(pipe)); + ep = udev->ep_out[epnum]; + } else { + WARN_ON(usb_pipeout(pipe)); + ep = udev->ep_in[epnum]; + } + if (!ep) + return 0; + + /* NOTE: only 0x07ff bits are for packet size... */ + return le16_to_cpu(ep->desc.wMaxPacketSize); +} + /* -------------------------------------------------------------------------- */ #ifdef DEBUG diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index c1aa8d8f67ce..f5fe94e09a03 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -79,6 +79,7 @@ #define USB_DEVICE_B_HNP_ENABLE 3 /* dev may initiate HNP */ #define USB_DEVICE_A_HNP_SUPPORT 4 /* RH port supports HNP */ #define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* other RH port does */ +#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ @@ -156,14 +157,14 @@ struct usb_device_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 bcdUSB; + __le16 bcdUSB; __u8 bDeviceClass; __u8 bDeviceSubClass; __u8 bDeviceProtocol; __u8 bMaxPacketSize0; - __u16 idVendor; - __u16 idProduct; - __u16 bcdDevice; + __le16 idVendor; + __le16 idProduct; + __le16 bcdDevice; __u8 iManufacturer; __u8 iProduct; __u8 iSerialNumber; @@ -208,7 +209,7 @@ struct usb_config_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 wTotalLength; + __le16 wTotalLength; __u8 bNumInterfaces; __u8 bConfigurationValue; __u8 iConfiguration; @@ -264,7 +265,7 @@ struct usb_endpoint_descriptor { __u8 bEndpointAddress; __u8 bmAttributes; - __u16 wMaxPacketSize; + __le16 wMaxPacketSize; __u8 bInterval; // NOTE: these two are _only_ in audio endpoints. @@ -297,7 +298,7 @@ struct usb_qualifier_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 bcdUSB; + __le16 bcdUSB; __u8 bDeviceClass; __u8 bDeviceSubClass; __u8 bDeviceProtocol; @@ -323,6 +324,18 @@ struct usb_otg_descriptor { /*-------------------------------------------------------------------------*/ +/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */ +struct usb_debug_descriptor { + __u8 bLength; + __u8 bDescriptorType; + + /* bulk endpoints with 8 byte maxpacket */ + __u8 bDebugInEndpoint; + __u8 bDebugOutEndpoint; +}; + +/*-------------------------------------------------------------------------*/ + /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ struct usb_interface_assoc_descriptor { __u8 bLength; diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 8c68717810c3..9af7ad38c08d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -8,6 +8,7 @@ #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ #define VM_ALLOC 0x00000002 /* vmalloc() */ #define VM_MAP 0x00000004 /* vmap()ed pages */ +/* bits [20..32] reserved for arch specific ioremap internals */ struct vm_struct { void *addr; |
