diff options
Diffstat (limited to 'include/linux')
43 files changed, 514 insertions, 202 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 683513e310de..bb881c3219fa 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -156,7 +156,6 @@ header-y += video_encoder.h header-y += videotext.h header-y += vt.h header-y += wireless.h -header-y += xattr.h header-y += x25.h unifdef-y += acct.h @@ -336,6 +335,7 @@ unifdef-y += wait.h unifdef-y += wanrouter.h unifdef-y += watchdog.h unifdef-y += wireless.h +unifdef-y += xattr.h unifdef-y += xfrm.h objhdr-y += version.h diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild index 56499ab9e32e..79bedddfd9ca 100644 --- a/include/linux/byteorder/Kbuild +++ b/include/linux/byteorder/Kbuild @@ -1,7 +1,5 @@ header-y += big_endian.h header-y += little_endian.h -header-y += pdp_endian.h unifdef-y += generic.h -unifdef-y += swabb.h unifdef-y += swab.h diff --git a/include/linux/byteorder/pdp_endian.h b/include/linux/byteorder/pdp_endian.h deleted file mode 100644 index 618631cbc6e3..000000000000 --- a/include/linux/byteorder/pdp_endian.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _LINUX_BYTEORDER_PDP_ENDIAN_H -#define _LINUX_BYTEORDER_PDP_ENDIAN_H - -/* - * Could have been named NUXI-endian, but we use the same name as in glibc. - * hopefully only the PDP and its evolutions (old VAXen in compatibility mode) - * should ever use this braindead byteorder. - * This file *should* work, but has not been tested. - * - * little-endian is 1234; big-endian is 4321; nuxi/pdp-endian is 3412 - * - * I thought vaxen were NUXI-endian, but was told they were correct-endian - * (little-endian), though indeed there existed NUXI-endian machines - * (DEC PDP-11 and old VAXen in compatibility mode). - * This makes this file a bit useless, but as a proof-of-concept. - * - * But what does a __u64 look like: is it 34127856 or 78563412 ??? - * I don't dare imagine! Hence, no 64-bit byteorder support yet. - * Hopefully, there 64-bit pdp-endian support shouldn't ever be required. - * - */ - -#ifndef __PDP_ENDIAN -#define __PDP_ENDIAN 3412 -#endif -#ifndef __PDP_ENDIAN_BITFIELD -#define __PDP_ENDIAN_BITFIELD -#endif - -#include <linux/byteorder/swab.h> -#include <linux/byteorder/swabb.h> - -#define __constant_htonl(x) ___constant_swahb32((x)) -#define __constant_ntohl(x) ___constant_swahb32((x)) -#define __constant_htons(x) ___constant_swab16((x)) -#define __constant_ntohs(x) ___constant_swab16((x)) -#define __constant_cpu_to_le64(x) I DON'T KNOW -#define __constant_le64_to_cpu(x) I DON'T KNOW -#define __constant_cpu_to_le32(x) ___constant_swahw32((x)) -#define __constant_le32_to_cpu(x) ___constant_swahw32((x)) -#define __constant_cpu_to_le16(x) ((__u16)(x) -#define __constant_le16_to_cpu(x) ((__u16)(x) -#define __constant_cpu_to_be64(x) I DON'T KNOW -#define __constant_be64_to_cpu(x) I DON'T KNOW -#define __constant_cpu_to_be32(x) ___constant_swahb32((x)) -#define __constant_be32_to_cpu(x) ___constant_swahb32((x)) -#define __constant_cpu_to_be16(x) ___constant_swab16((x)) -#define __constant_be16_to_cpu(x) ___constant_swab16((x)) -#define __cpu_to_le64(x) I DON'T KNOW -#define __le64_to_cpu(x) I DON'T KNOW -#define __cpu_to_le32(x) ___swahw32((x)) -#define __le32_to_cpu(x) ___swahw32((x)) -#define __cpu_to_le16(x) ((__u16)(x) -#define __le16_to_cpu(x) ((__u16)(x) -#define __cpu_to_be64(x) I DON'T KNOW -#define __be64_to_cpu(x) I DON'T KNOW -#define __cpu_to_be32(x) __swahb32((x)) -#define __be32_to_cpu(x) __swahb32((x)) -#define __cpu_to_be16(x) __swab16((x)) -#define __be16_to_cpu(x) __swab16((x)) -#define __cpu_to_le64p(x) I DON'T KNOW -#define __le64_to_cpup(x) I DON'T KNOW -#define __cpu_to_le32p(x) ___swahw32p((x)) -#define __le32_to_cpup(x) ___swahw32p((x)) -#define __cpu_to_le16p(x) (*(__u16*)(x)) -#define __le16_to_cpup(x) (*(__u16*)(x)) -#define __cpu_to_be64p(x) I DON'T KNOW -#define __be64_to_cpup(x) I DON'T KNOW -#define __cpu_to_be32p(x) __swahb32p((x)) -#define __be32_to_cpup(x) __swahb32p((x)) -#define __cpu_to_be16p(x) __swab16p((x)) -#define __be16_to_cpup(x) __swab16p((x)) -#define __cpu_to_le64s(x) I DON'T KNOW -#define __le64_to_cpus(x) I DON'T KNOW -#define __cpu_to_le32s(x) ___swahw32s((x)) -#define __le32_to_cpus(x) ___swahw32s((x)) -#define __cpu_to_le16s(x) do {} while (0) -#define __le16_to_cpus(x) do {} while (0) -#define __cpu_to_be64s(x) I DON'T KNOW -#define __be64_to_cpus(x) I DON'T KNOW -#define __cpu_to_be32s(x) __swahb32s((x)) -#define __be32_to_cpus(x) __swahb32s((x)) -#define __cpu_to_be16s(x) __swab16s((x)) -#define __be16_to_cpus(x) __swab16s((x)) - -#include <linux/byteorder/generic.h> - -#endif /* _LINUX_BYTEORDER_PDP_ENDIAN_H */ diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index ae5e5f914bf4..8c780c7d779e 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h @@ -25,6 +25,8 @@ * */ +#include <linux/types.h> + #define ___swahw32(x) \ ({ \ __u32 __x = (x); \ @@ -77,19 +79,14 @@ /* * Allow constant folding */ -#if defined(__GNUC__) && defined(__OPTIMIZE__) -# define __swahw32(x) \ +#define __swahw32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___swahw32((x)) : \ __fswahw32((x))) -# define __swahb32(x) \ +#define __swahb32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___swahb32((x)) : \ __fswahb32((x))) -#else -# define __swahw32(x) __fswahw32(x) -# define __swahb32(x) __fswahb32(x) -#endif /* OPTIMIZE */ static inline __u32 __fswahw32(__u32 x) @@ -128,13 +125,11 @@ static inline void __swahb32s(__u32 *addr) */ #endif /* __BYTEORDER_HAS_U64__ */ -#if defined(__KERNEL__) #define swahw32 __swahw32 #define swahb32 __swahb32 #define swahw32p __swahw32p #define swahb32p __swahb32p #define swahw32s __swahw32s #define swahb32s __swahb32s -#endif #endif /* _LINUX_BYTEORDER_SWABB_H */ diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h new file mode 100644 index 000000000000..0bc45e69da5a --- /dev/null +++ b/include/linux/cfag12864b.h @@ -0,0 +1,77 @@ +/* + * Filename: cfag12864b.h + * Version: 0.1.0 + * Description: cfag12864b LCD driver header + * License: GPLv2 + * + * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> + * Date: 2006-10-12 + * + * 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. + * + * 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 _CFAG12864B_H_ +#define _CFAG12864B_H_ + +#define CFAG12864B_WIDTH (128) +#define CFAG12864B_HEIGHT (64) +#define CFAG12864B_CONTROLLERS (2) +#define CFAG12864B_PAGES (8) +#define CFAG12864B_ADDRESSES (64) +#define CFAG12864B_SIZE ((CFAG12864B_CONTROLLERS) * \ + (CFAG12864B_PAGES) * \ + (CFAG12864B_ADDRESSES)) + +/* + * The driver will blit this buffer to the LCD + * + * Its size is CFAG12864B_SIZE. + */ +extern unsigned char * cfag12864b_buffer; + +/* + * Get the refresh rate of the LCD + * + * Returns the refresh rate (hertzs). + */ +extern unsigned int cfag12864b_getrate(void); + +/* + * Enable refreshing + * + * Returns 0 if successful (anyone was using it), + * or != 0 if failed (someone is using it). + */ +extern unsigned char cfag12864b_enable(void); + +/* + * Disable refreshing + * + * You should call this only when you finish using the LCD. + */ +extern void cfag12864b_disable(void); + +/* + * Is enabled refreshing? (is anyone using the module?) + * + * Returns 0 if refreshing is not enabled (anyone is using it), + * or != 0 if refreshing is enabled (someone is using it). + * + * Useful for buffer read-only modules. + */ +extern unsigned char cfag12864b_isenabled(void); + +#endif /* _CFAG12864B_H_ */ + diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 6e1c44a935d4..9008eabb9c3d 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -27,6 +27,13 @@ #define __inline__ __inline__ __attribute__((always_inline)) #define __inline __inline __attribute__((always_inline)) #define __deprecated __attribute__((deprecated)) +#define __packed __attribute__((packed)) +#define __weak __attribute__((weak)) +#define __naked __attribute__((naked)) +#define __noreturn __attribute__((noreturn)) +#define __pure __attribute__((pure)) +#define __aligned(x) __attribute__((aligned(x))) +#define __printf(a,b) __attribute__((format(printf,a,b))) #define noinline __attribute__((noinline)) #define __attribute_pure__ __attribute__((pure)) #define __attribute_const__ __attribute__((__const__)) diff --git a/include/linux/console.h b/include/linux/console.h index 7d0420274de0..de25ee3b7919 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -21,6 +21,7 @@ struct vc_data; struct console_font_op; struct console_font; struct module; +struct tty_struct; /* * this is what the terminal answers to a ESC-Z or csi0c query. @@ -132,6 +133,9 @@ static inline void resume_console(void) {} int mda_console_init(void); void prom_con_init(void); +void vcs_make_sysfs(struct tty_struct *tty); +void vcs_remove_sysfs(struct tty_struct *tty); + /* Some debug stub to catch some of the obvious races in the VT code */ #if 1 #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index ed6c0fee1ac7..a86162b26c0d 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -11,6 +11,7 @@ #include <linux/wait.h> #include <linux/vt.h> +#include <linux/workqueue.h> struct vt_struct; @@ -103,6 +104,7 @@ struct vc_data { struct vc { struct vc_data *d; + struct work_struct SAK_work; /* might add scrmem, vt_struct, kbd at some time, to have everything in one place - the disadvantage @@ -110,6 +112,7 @@ struct vc { }; extern struct vc vc_cons [MAX_NR_CONSOLES]; +extern void vc_SAK(struct work_struct *work); #define CUR_DEF 0 #define CUR_NONE 1 diff --git a/include/linux/dn.h b/include/linux/dn.h index 10b6a6fd5837..02bba040fcfb 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h @@ -113,7 +113,7 @@ struct accessdata_dn * DECnet logical link information structure */ struct linkinfo_dn { - __le16 idn_segsize; /* Segment size for link */ + __u16 idn_segsize; /* Segment size for link */ __u8 idn_linkstate; /* Logical link state */ }; diff --git a/include/linux/fs.h b/include/linux/fs.h index 1410e5330c8d..20fd1619ccfb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -169,6 +169,7 @@ extern int dir_notify_enable; #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) +#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME) #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) @@ -1572,12 +1573,18 @@ extern int invalidate_partition(struct gendisk *, int); extern int invalidate_inodes(struct super_block *); unsigned long invalidate_mapping_pages(struct address_space *mapping, pgoff_t start, pgoff_t end); -unsigned long invalidate_inode_pages(struct address_space *mapping); + +static inline unsigned long __deprecated +invalidate_inode_pages(struct address_space *mapping) +{ + return invalidate_mapping_pages(mapping, 0, ~0UL); +} + static inline void invalidate_remote_inode(struct inode *inode) { if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) - invalidate_inode_pages(inode->i_mapping); + invalidate_mapping_pages(inode->i_mapping, 0, -1); } extern int invalidate_inode_pages2(struct address_space *mapping); extern int invalidate_inode_pages2_range(struct address_space *mapping, diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 247734f7881f..2c65da7cabb2 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -23,6 +23,8 @@ enum { SUN_WHOLE_DISK = DOS_EXTENDED_PARTITION, LINUX_SWAP_PARTITION = 0x82, + LINUX_DATA_PARTITION = 0x83, + LINUX_LVM_PARTITION = 0x8e, LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 063799ea6be0..2a7d15bcde46 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -85,8 +85,10 @@ struct vm_area_struct; static inline enum zone_type gfp_zone(gfp_t flags) { +#ifdef CONFIG_ZONE_DMA if (flags & __GFP_DMA) return ZONE_DMA; +#endif #ifdef CONFIG_ZONE_DMA32 if (flags & __GFP_DMA32) return ZONE_DMA32; diff --git a/include/linux/init.h b/include/linux/init.h index 5a593a1dec1e..c65f5107d512 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -172,7 +172,7 @@ void __init parse_early_param(void); * module_init() - driver initialization entry point * @x: function to be run at kernel boot time or module insertion * - * module_init() will either be called during do_initcalls (if + * module_init() will either be called during do_initcalls() (if * builtin) or at module insertion time (if a module). There can only * be one per module. */ diff --git a/include/linux/io.h b/include/linux/io.h index 9e419ebfc98b..c244a0cc9319 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -43,12 +43,6 @@ void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, unsigned long size); void devm_iounmap(struct device *dev, void __iomem *addr); -void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); -void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); -void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); - -int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); - /** * check_signature - find BIOS signatures * @io_addr: mmio address to check diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 63fb18dcac30..e91dce75bbcc 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -176,6 +176,7 @@ static inline void console_verbose(void) } extern void bust_spinlocks(int yes); +extern void wake_up_klogd(void); 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; @@ -200,6 +201,7 @@ extern enum system_states { #define TAINT_FORCED_RMMOD (1<<3) #define TAINT_MACHINE_CHECK (1<<4) #define TAINT_BAD_PAGE (1<<5) +#define TAINT_USER (1<<6) extern void dump_stack(void); @@ -312,6 +314,9 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * (void)__tmp; \ }) +struct sysinfo; +extern int do_sysinfo(struct sysinfo *info); + #endif /* __KERNEL__ */ #define SI_LOAD_SHIFT 16 diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 48eccd865bd8..404f4464cb1a 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h @@ -74,7 +74,7 @@ static inline void kfifo_reset(struct kfifo *fifo) * @buffer: the data to be added. * @len: the length of the data to be added. * - * This function copies at most 'len' bytes from the 'buffer' into + * This function copies at most @len bytes from the @buffer into * the FIFO depending on the free space, and returns the number of * bytes copied. */ @@ -99,8 +99,8 @@ static inline unsigned int kfifo_put(struct kfifo *fifo, * @buffer: where the data must be copied. * @len: the size of the destination buffer. * - * This function copies at most 'len' bytes from the FIFO into the - * 'buffer' and returns the number of copied bytes. + * This function copies at most @len bytes from the FIFO into the + * @buffer and returns the number of copied bytes. */ static inline unsigned int kfifo_get(struct kfifo *fifo, unsigned char *buffer, unsigned int len) diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h new file mode 100644 index 000000000000..8047d4b17bf1 --- /dev/null +++ b/include/linux/ks0108.h @@ -0,0 +1,46 @@ +/* + * Filename: ks0108.h + * Version: 0.1.0 + * Description: ks0108 LCD Controller driver header + * License: GPLv2 + * + * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> + * Date: 2006-10-31 + * + * 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. + * + * 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 _KS0108_H_ +#define _KS0108_H_ + +/* Write a byte to the data port */ +extern void ks0108_writedata(unsigned char byte); + +/* Write a byte to the control port */ +extern void ks0108_writecontrol(unsigned char byte); + +/* Set the controller's current display state (0..1) */ +extern void ks0108_displaystate(unsigned char state); + +/* Set the controller's current startline (0..63) */ +extern void ks0108_startline(unsigned char startline); + +/* Set the controller's current address (0..63) */ +extern void ks0108_address(unsigned char address); + +/* Set the controller's current page (0..7) */ +extern void ks0108_page(unsigned char page); + +#endif /* _KS0108_H_ */ diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 611f17f79eef..7444a6326231 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -163,7 +163,7 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) * @add1: addend1 * @add2: addend2 * - * Returns the sum of addend1 and addend2 + * Returns the sum of @add1 and @add2. */ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) { @@ -189,7 +189,7 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) * @kt: addend * @nsec: the scalar nsec value to add * - * Returns the sum of kt and nsec in ktime_t format + * Returns the sum of @kt and @nsec in ktime_t format */ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); @@ -246,7 +246,7 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt) * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds * @kt: the ktime_t variable to convert * - * Returns the scalar nanoseconds representation of kt + * Returns the scalar nanoseconds representation of @kt */ static inline s64 ktime_to_ns(const ktime_t kt) { diff --git a/include/linux/list.h b/include/linux/list.h index 611059d633f4..f9d71eab05ee 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -161,7 +161,7 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) /** * list_del - deletes entry from list. * @entry: the element to delete from the list. - * Note: list_empty on entry does not return true after this, the entry is + * Note: list_empty() on entry does not return true after this, the entry is * in an undefined state. */ #ifndef CONFIG_DEBUG_LIST @@ -179,7 +179,7 @@ extern void list_del(struct list_head *entry); * list_del_rcu - deletes entry from list without re-initialization * @entry: the element to delete from the list. * - * Note: list_empty on entry does not return true after this, + * Note: list_empty() on entry does not return true after this, * the entry is in an undefined state. It is useful for RCU based * lockfree traversal. * @@ -209,7 +209,8 @@ static inline void list_del_rcu(struct list_head *entry) * list_replace - replace old entry by new one * @old : the element to be replaced * @new : the new element to insert - * Note: if 'old' was empty, it will be overwritten. + * + * If @old was empty, it will be overwritten. */ static inline void list_replace(struct list_head *old, struct list_head *new) @@ -360,6 +361,62 @@ static inline void list_splice_init(struct list_head *list, } /** + * list_splice_init_rcu - splice an RCU-protected list into an existing list. + * @list: the RCU-protected list to splice + * @head: the place in the list to splice the first list into + * @sync: function to sync: synchronize_rcu(), synchronize_sched(), ... + * + * @head can be RCU-read traversed concurrently with this function. + * + * Note that this function blocks. + * + * Important note: the caller must take whatever action is necessary to + * prevent any other updates to @head. In principle, it is possible + * to modify the list as soon as sync() begins execution. + * If this sort of thing becomes necessary, an alternative version + * based on call_rcu() could be created. But only if -really- + * needed -- there is no shortage of RCU API members. + */ +static inline void list_splice_init_rcu(struct list_head *list, + struct list_head *head, + void (*sync)(void)) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + struct list_head *at = head->next; + + if (list_empty(head)) + return; + + /* "first" and "last" tracking list, so initialize it. */ + + INIT_LIST_HEAD(list); + + /* + * At this point, the list body still points to the source list. + * Wait for any readers to finish using the list before splicing + * the list body into the new list. Any new readers will see + * an empty list. + */ + + sync(); + + /* + * Readers are finished with the source list, so perform splice. + * The order is important if the new list is global and accessible + * to concurrent RCU readers. Note that RCU readers are not + * permitted to traverse the prev pointers without excluding + * this function. + */ + + last->next = at; + smp_wmb(); + head->next = first; + first->prev = head; + at->prev = last; +} + +/** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. @@ -432,12 +489,12 @@ static inline void list_splice_init(struct list_head *list, pos = list_entry(pos->member.prev, typeof(*pos), member)) /** - * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue + * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() * @pos: the type * to use as a start point * @head: the head of the list * @member: the name of the list_struct within the struct. * - * Prepares a pos entry for use as a start point in list_for_each_entry_continue. + * Prepares a pos entry for use as a start point in list_for_each_entry_continue(). */ #define list_prepare_entry(pos, head, member) \ ((pos) ? : list_entry(head, typeof(*pos), member)) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index ea097dddc44f..7e1160dde5e7 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -132,6 +132,7 @@ struct lock_list { struct list_head entry; struct lock_class *class; struct stack_trace trace; + int distance; }; /* diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index 432b2fa24929..bdc01127dced 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h @@ -18,6 +18,16 @@ #ifdef __KERNEL__ #include <linux/spinlock.h> /* spinlock_t */ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */ + +/* Some RTCs extend the mc146818 register set to support alarms of more + * than 24 hours in the future; or dates that include a century code. + * This platform_data structure can pass this information to the driver. + */ +struct cmos_rtc_board_info { + u8 rtc_day_alarm; /* zero, or register index */ + u8 rtc_mon_alarm; /* zero, or register index */ + u8 rtc_century; /* zero, or register index */ +}; #endif /********************************************************************** diff --git a/include/linux/mm.h b/include/linux/mm.h index bb793a4c8e9e..77a76101dcd9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -437,15 +437,15 @@ static inline compound_page_dtor *get_compound_page_dtor(struct page *page) /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ #ifdef NODE_NOT_IN_PAGEFLAGS #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) +#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ + SECTIONS_PGOFF : ZONES_PGOFF) #else #define ZONEID_SHIFT (NODES_SHIFT + ZONES_SHIFT) +#define ZONEID_PGOFF ((NODES_PGOFF < ZONES_PGOFF)? \ + NODES_PGOFF : ZONES_PGOFF) #endif -#if ZONES_WIDTH > 0 -#define ZONEID_PGSHIFT ZONES_PGSHIFT -#else -#define ZONEID_PGSHIFT NODES_PGOFF -#endif +#define ZONEID_PGSHIFT (ZONEID_PGOFF * (ZONEID_SHIFT != 0)) #if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED @@ -471,7 +471,6 @@ static inline enum zone_type page_zonenum(struct page *page) */ static inline int page_zone_id(struct page *page) { - BUILD_BUG_ON(ZONEID_PGSHIFT == 0 && ZONEID_MASK); return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK; } @@ -786,6 +785,7 @@ extern int try_to_release_page(struct page * page, gfp_t gfp_mask); extern void do_invalidatepage(struct page *page, unsigned long offset); int __set_page_dirty_nobuffers(struct page *page); +int __set_page_dirty_no_writeback(struct page *page); int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page); int FASTCALL(set_page_dirty(struct page *page)); diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 3b6723dfaff3..895bc4e93039 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -1,30 +1,29 @@ - static inline void add_page_to_active_list(struct zone *zone, struct page *page) { list_add(&page->lru, &zone->active_list); - zone->nr_active++; + __inc_zone_state(zone, NR_ACTIVE); } static inline void add_page_to_inactive_list(struct zone *zone, struct page *page) { list_add(&page->lru, &zone->inactive_list); - zone->nr_inactive++; + __inc_zone_state(zone, NR_INACTIVE); } static inline void del_page_from_active_list(struct zone *zone, struct page *page) { list_del(&page->lru); - zone->nr_active--; + __dec_zone_state(zone, NR_ACTIVE); } static inline void del_page_from_inactive_list(struct zone *zone, struct page *page) { list_del(&page->lru); - zone->nr_inactive--; + __dec_zone_state(zone, NR_INACTIVE); } static inline void @@ -33,9 +32,9 @@ del_page_from_lru(struct zone *zone, struct page *page) list_del(&page->lru); if (PageActive(page)) { __ClearPageActive(page); - zone->nr_active--; + __dec_zone_state(zone, NR_ACTIVE); } else { - zone->nr_inactive--; + __dec_zone_state(zone, NR_INACTIVE); } } diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index b262f47961fb..ee9e3143df4f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -47,15 +47,20 @@ struct zone_padding { #endif enum zone_stat_item { + /* First 128 byte cacheline (assuming 64 bit words) */ + NR_FREE_PAGES, + NR_INACTIVE, + NR_ACTIVE, NR_ANON_PAGES, /* Mapped anonymous pages */ NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. only modified from process context */ NR_FILE_PAGES, - NR_SLAB_RECLAIMABLE, - NR_SLAB_UNRECLAIMABLE, - NR_PAGETABLE, /* used for pagetables */ NR_FILE_DIRTY, NR_WRITEBACK, + /* Second 128 byte cacheline */ + NR_SLAB_RECLAIMABLE, + NR_SLAB_UNRECLAIMABLE, + NR_PAGETABLE, /* used for pagetables */ NR_UNSTABLE_NFS, /* NFS unstable pages */ NR_BOUNCE, NR_VMSCAN_WRITE, @@ -91,6 +96,7 @@ struct per_cpu_pageset { #endif enum zone_type { +#ifdef CONFIG_ZONE_DMA /* * ZONE_DMA is used when there are devices that are not able * to do DMA to all of addressable memory (ZONE_NORMAL). Then we @@ -111,6 +117,7 @@ enum zone_type { * <16M. */ ZONE_DMA, +#endif #ifdef CONFIG_ZONE_DMA32 /* * x86_64 needs two ZONE_DMAs because it supports devices that are @@ -147,15 +154,30 @@ enum zone_type { * match the requested limits. See gfp_zone() in include/linux/gfp.h */ -#if !defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_HIGHMEM) +/* + * Count the active zones. Note that the use of defined(X) outside + * #if and family is not necessarily defined so ensure we cannot use + * it later. Use __ZONE_COUNT to work out how many shift bits we need. + */ +#define __ZONE_COUNT ( \ + defined(CONFIG_ZONE_DMA) \ + + defined(CONFIG_ZONE_DMA32) \ + + 1 \ + + defined(CONFIG_HIGHMEM) \ +) +#if __ZONE_COUNT < 2 +#define ZONES_SHIFT 0 +#elif __ZONE_COUNT <= 2 #define ZONES_SHIFT 1 -#else +#elif __ZONE_COUNT <= 4 #define ZONES_SHIFT 2 +#else +#error ZONES_SHIFT -- too many zones configured adjust calculation #endif +#undef __ZONE_COUNT struct zone { /* Fields commonly accessed by the page allocator */ - unsigned long free_pages; unsigned long pages_min, pages_low, pages_high; /* * We don't know if the memory that we're going to allocate will be freeable @@ -197,8 +219,6 @@ struct zone { struct list_head inactive_list; unsigned long nr_scan_active; unsigned long nr_scan_inactive; - unsigned long nr_active; - unsigned long nr_inactive; unsigned long pages_scanned; /* since last reclaim */ int all_unreclaimable; /* All pages pinned */ @@ -442,8 +462,6 @@ typedef struct pglist_data { #include <linux/memory_hotplug.h> -void __get_zone_counts(unsigned long *active, unsigned long *inactive, - unsigned long *free, struct pglist_data *pgdat); void get_zone_counts(unsigned long *active, unsigned long *inactive, unsigned long *free); void build_all_zonelists(void); @@ -523,7 +541,11 @@ static inline int is_dma32(struct zone *zone) static inline int is_dma(struct zone *zone) { +#ifdef CONFIG_ZONE_DMA return zone == zone->zone_pgdat->node_zones + ZONE_DMA; +#else + return 0; +#endif } /* These two functions are used to setup the per zone pages min values */ diff --git a/include/linux/mount.h b/include/linux/mount.h index 1b7e178b0d84..dab69afee2fa 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -43,9 +43,8 @@ struct vfsmount { struct super_block *mnt_sb; /* pointer to superblock */ struct list_head mnt_mounts; /* list of children, anchored here */ struct list_head mnt_child; /* and going through their mnt_child */ - atomic_t mnt_count; int mnt_flags; - int mnt_expiry_mark; /* true if marked for expiry */ + /* 4 bytes hole on 64bits arches */ char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ struct list_head mnt_list; struct list_head mnt_expire; /* link in fs-specific expiry list */ @@ -54,6 +53,13 @@ struct vfsmount { struct list_head mnt_slave; /* slave list entry */ struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ struct mnt_namespace *mnt_ns; /* containing namespace */ + /* + * We put mnt_count & mnt_expiry_mark at the end of struct vfsmount + * to let these frequently modified fields in a separate cache line + * (so that reads of mnt_flags wont ping-pong on SMP machines) + */ + atomic_t mnt_count; + int mnt_expiry_mark; /* true if marked for expiry */ int mnt_pinned; }; diff --git a/include/linux/pci.h b/include/linux/pci.h index 9e3042e7e1cc..98c8765a488e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -840,6 +840,11 @@ enum pci_fixup_pass { void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); +void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); +void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); +void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); +int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); + extern int pci_pci_problems; #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ #define PCIPCI_TRITON 2 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e67b68ca235a..8fb9c3e06eef 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -959,6 +959,7 @@ #define PCI_DEVICE_ID_PLX_R753 0x1152 #define PCI_DEVICE_ID_PLX_OLITEC 0x1187 #define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 +#define PCI_DEVICE_ID_PLX_9030 0x9030 #define PCI_DEVICE_ID_PLX_9050 0x9050 #define PCI_DEVICE_ID_PLX_9080 0x9080 #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 @@ -1696,6 +1697,8 @@ #define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 #define PCI_DEVICE_ID_LML_33R10 0x8a02 +#define PCI_VENDOR_ID_ESDGMBH 0x12fe +#define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111 #define PCI_VENDOR_ID_SIIG 0x131f #define PCI_SUBVENDOR_ID_SIIG 0x131f @@ -1811,6 +1814,9 @@ #define PCI_DEVICE_ID_MOXA_C168 0x1680 #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 #define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 +#define PCI_DEVICE_ID_MOXA_CP204J 0x2040 +#define PCI_DEVICE_ID_MOXA_C218 0x2180 +#define PCI_DEVICE_ID_MOXA_C320 0x3200 #define PCI_VENDOR_ID_CCD 0x1397 #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 @@ -1991,6 +1997,10 @@ #define PCI_VENDOR_ID_CHELSIO 0x1425 +#define PCI_SUBVENDOR_ID_PERLE 0x155f +#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001 +#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010 + #define PCI_VENDOR_ID_SYBA 0x1592 #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 diff --git a/include/linux/pnp.h b/include/linux/pnp.h index ab8a8dd8d64c..9a5226f0f169 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -352,6 +352,8 @@ struct pnp_protocol { (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) +extern struct bus_type pnp_bus_type; + #if defined(CONFIG_PNP) /* device management */ diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 966c35851b2e..66a96814d614 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h @@ -2,7 +2,10 @@ File: linux/reiserfs_xattr.h */ -#include <linux/xattr.h> +#ifndef _LINUX_REISERFS_XATTR_H +#define _LINUX_REISERFS_XATTR_H + +#include <linux/types.h> /* Magic value in header */ #define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ @@ -13,7 +16,18 @@ struct reiserfs_xattr_header { }; #ifdef __KERNEL__ + #include <linux/init.h> +#include <linux/list.h> +#include <linux/rwsem.h> +#include <linux/reiserfs_fs_i.h> +#include <linux/reiserfs_fs.h> + +struct inode; +struct dentry; +struct iattr; +struct super_block; +struct nameidata; struct reiserfs_xattr_handler { char *prefix; @@ -49,9 +63,7 @@ int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); extern struct reiserfs_xattr_handler user_handler; extern struct reiserfs_xattr_handler trusted_handler; -#ifdef CONFIG_REISERFS_FS_SECURITY extern struct reiserfs_xattr_handler security_handler; -#endif int reiserfs_xattr_register_handlers(void) __init; void reiserfs_xattr_unregister_handlers(void); @@ -137,6 +149,8 @@ static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags) static inline void reiserfs_init_xattr_rwsem(struct inode *inode) { } -#endif +#endif /* CONFIG_REISERFS_FS_XATTR */ + +#endif /* __KERNEL__ */ -#endif /* __KERNEL__ */ +#endif /* _LINUX_REISERFS_XATTR_H */ diff --git a/include/linux/relay.h b/include/linux/relay.h index c6a48bfc8b14..759a0f97bec2 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h @@ -24,7 +24,7 @@ /* * Tracks changes to rchan/rchan_buf structs */ -#define RELAYFS_CHANNEL_VERSION 6 +#define RELAYFS_CHANNEL_VERSION 7 /* * Per-cpu relay channel buffer @@ -64,6 +64,10 @@ struct rchan void *private_data; /* for user-defined data */ size_t last_toobig; /* tried to log event > subbuf size */ struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ + int is_global; /* One global buffer ? */ + struct list_head list; /* for channel list */ + struct dentry *parent; /* parent dentry passed to open */ + char base_filename[NAME_MAX]; /* saved base filename */ }; /* @@ -162,7 +166,8 @@ struct rchan *relay_open(const char *base_filename, struct dentry *parent, size_t subbuf_size, size_t n_subbufs, - struct rchan_callbacks *cb); + struct rchan_callbacks *cb, + void *private_data); extern void relay_close(struct rchan *chan); extern void relay_flush(struct rchan *chan); extern void relay_subbufs_consumed(struct rchan *chan, diff --git a/include/linux/rio.h b/include/linux/rio.h index d93857056cb9..68e3f6853fa6 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -25,6 +25,7 @@ #define RIO_ANY_DESTID 0xff #define RIO_NO_HOPCOUNT -1 +#define RIO_INVALID_DESTID 0xffff #define RIO_MAX_MPORT_RESOURCES 16 #define RIO_MAX_DEV_RESOURCES 16 diff --git a/include/linux/sched.h b/include/linux/sched.h index 446373535190..76c8e2dc48dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1013,8 +1013,10 @@ struct task_struct { * to a stack based synchronous wait) if its doing sync IO. */ wait_queue_t *io_wait; +#ifdef CONFIG_TASK_XACCT /* i/o counters(bytes read/written, #syscalls */ u64 rchar, wchar, syscr, syscw; +#endif struct task_io_accounting ioac; #if defined(CONFIG_TASK_XACCT) u64 acct_rss_mem1; /* accumulated rss usage */ @@ -1649,6 +1651,44 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); extern void normalize_rt_tasks(void); +#ifdef CONFIG_TASK_XACCT +static inline void add_rchar(struct task_struct *tsk, ssize_t amt) +{ + tsk->rchar += amt; +} + +static inline void add_wchar(struct task_struct *tsk, ssize_t amt) +{ + tsk->wchar += amt; +} + +static inline void inc_syscr(struct task_struct *tsk) +{ + tsk->syscr++; +} + +static inline void inc_syscw(struct task_struct *tsk) +{ + tsk->syscw++; +} +#else +static inline void add_rchar(struct task_struct *tsk, ssize_t amt) +{ +} + +static inline void add_wchar(struct task_struct *tsk, ssize_t amt) +{ +} + +static inline void inc_syscr(struct task_struct *tsk) +{ +} + +static inline void inc_syscw(struct task_struct *tsk) +{ +} +#endif + #endif /* __KERNEL__ */ #endif diff --git a/include/linux/security.h b/include/linux/security.h index 83cdefae9931..c554f60f18e4 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -492,7 +492,7 @@ struct request_sock; * Note that the fown_struct, @fown, is never outside the context of a * struct file, so the file structure (and associated security information) * can always be obtained: - * (struct file *)((long)fown - offsetof(struct file,f_owner)); + * container_of(fown, struct file, f_owner) * @tsk contains the structure of task receiving signal. * @fown contains the file owner information. * @sig is the signal that will be sent. When 0, kernel sends SIGIO. diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 4b463e66ddea..5e4364644ed1 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h @@ -19,7 +19,9 @@ struct cache_sizes { size_t cs_size; struct kmem_cache *cs_cachep; +#ifdef CONFIG_ZONE_DMA struct kmem_cache *cs_dmacachep; +#endif }; extern struct cache_sizes malloc_sizes[]; @@ -39,9 +41,12 @@ static inline void *kmalloc(size_t size, gfp_t flags) __you_cannot_kmalloc_that_much(); } found: - return kmem_cache_alloc((flags & GFP_DMA) ? - malloc_sizes[i].cs_dmacachep : - malloc_sizes[i].cs_cachep, flags); +#ifdef CONFIG_ZONE_DMA + if (flags & GFP_DMA) + return kmem_cache_alloc(malloc_sizes[i].cs_dmacachep, + flags); +#endif + return kmem_cache_alloc(malloc_sizes[i].cs_cachep, flags); } return __kmalloc(size, flags); } @@ -62,9 +67,12 @@ static inline void *kzalloc(size_t size, gfp_t flags) __you_cannot_kzalloc_that_much(); } found: - return kmem_cache_zalloc((flags & GFP_DMA) ? - malloc_sizes[i].cs_dmacachep : - malloc_sizes[i].cs_cachep, flags); +#ifdef CONFIG_ZONE_DMA + if (flags & GFP_DMA) + return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep, + flags); +#endif + return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags); } return __kzalloc(size, flags); } @@ -88,9 +96,13 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node) __you_cannot_kmalloc_that_much(); } found: - return kmem_cache_alloc_node((flags & GFP_DMA) ? - malloc_sizes[i].cs_dmacachep : - malloc_sizes[i].cs_cachep, flags, node); +#ifdef CONFIG_ZONE_DMA + if (flags & GFP_DMA) + return kmem_cache_alloc_node(malloc_sizes[i].cs_dmacachep, + flags, node); +#endif + return kmem_cache_alloc_node(malloc_sizes[i].cs_cachep, + flags, node); } return __kmalloc_node(size, flags, node); } diff --git a/include/linux/socket.h b/include/linux/socket.h index fcd35a210e7f..28157a36e6cc 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage { /* _SS_MAXSIZE value minus size of ss_family */ } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) +#ifdef __KERNEL__ #include <asm/socket.h> /* arch-dependent defines */ #include <linux/sockios.h> /* the SIOCxxx I/O controls */ diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 94b767d64275..61fef376ed2e 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -228,15 +228,30 @@ do { \ # define read_unlock_irq(lock) _read_unlock_irq(lock) # define write_unlock_irq(lock) _write_unlock_irq(lock) #else -# define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) -# define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) -# define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) -# define spin_unlock_irq(lock) \ - do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) -# define read_unlock_irq(lock) \ - do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) -# define write_unlock_irq(lock) \ - do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) +# define spin_unlock(lock) \ + do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define read_unlock(lock) \ + do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define write_unlock(lock) \ + do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define spin_unlock_irq(lock) \ +do { \ + __raw_spin_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) +# define read_unlock_irq(lock) \ +do { \ + __raw_read_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) +# define write_unlock_irq(lock) \ +do { \ + __raw_write_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) #endif #define spin_unlock_irqrestore(lock, flags) \ diff --git a/include/linux/stat.h b/include/linux/stat.h index 679ef0d70b6b..4f8539ccff6c 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -7,7 +7,7 @@ #endif -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) +#ifdef __KERNEL__ #define S_IFMT 00170000 #define S_IFSOCK 0140000 diff --git a/include/linux/swap.h b/include/linux/swap.h index 5423559a44a6..006868881346 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -170,11 +170,13 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct * extern unsigned long totalram_pages; extern unsigned long totalreserve_pages; extern long nr_swap_pages; -extern unsigned int nr_free_pages(void); -extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat); extern unsigned int nr_free_buffer_pages(void); extern unsigned int nr_free_pagecache_pages(void); +/* Definition of global_page_state not available yet */ +#define nr_free_pages() global_page_state(NR_FREE_PAGES) + + /* linux/mm/swap.c */ extern void FASTCALL(lru_cache_add(struct page *)); extern void FASTCALL(lru_cache_add_active(struct page *)); diff --git a/include/linux/time.h b/include/linux/time.h index a5b739967b74..55cee172d723 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -46,7 +46,7 @@ static inline int timespec_equal(struct timespec *a, struct timespec *b) * lhs == rhs: return 0 * lhs > rhs: return >0 */ -static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs) +static inline int timespec_compare(const struct timespec *lhs, const struct timespec *rhs) { if (lhs->tv_sec < rhs->tv_sec) return -1; @@ -55,7 +55,7 @@ static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs) return lhs->tv_nsec - rhs->tv_nsec; } -static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs) +static inline int timeval_compare(const struct timeval *lhs, const struct timeval *rhs) { if (lhs->tv_sec < rhs->tv_sec) return -1; diff --git a/include/linux/timex.h b/include/linux/timex.h index db501dc23c29..9a24e500c311 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -255,10 +255,10 @@ struct time_interpolator { u8 jitter; /* if set compensate for fluctuations */ u32 nsec_per_cyc; /* set by register_time_interpolator() */ void *addr; /* address of counter or function */ - u64 mask; /* mask the valid bits of the counter */ + cycles_t mask; /* mask the valid bits of the counter */ unsigned long offset; /* nsec offset at last update of interpolator */ u64 last_counter; /* counter value in units of the counter at last update */ - u64 last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */ + cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */ u64 frequency; /* frequency in counts/second */ long drift; /* drift in parts-per-million (or -1) */ unsigned long skips; /* skips forward */ diff --git a/include/linux/tty.h b/include/linux/tty.h index 65cbcf22c31e..8427c9e98e6b 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -24,7 +24,27 @@ #define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */ #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ -#define NR_LDISCS 16 +#define NR_LDISCS 17 + +/* line disciplines */ +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 /* X.25 async */ +#define N_6PACK 7 +#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */ +#define N_R3964 9 /* Reserved for Simatic R3964 module */ +#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */ +#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ +#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data */ + /* cards about SMS messages */ +#define N_HDLC 13 /* synchronous HDLC */ +#define N_SYNC_PPP 14 /* synchronous PPP */ +#define N_HCI 15 /* Bluetooth HCI UART */ +#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ /* * This character is the same as _POSIX_VDISABLE: it cannot be used as @@ -291,6 +311,7 @@ extern void tty_vhangup(struct tty_struct * tty); extern void tty_unhangup(struct file *filp); extern int tty_hung_up_p(struct file * filp); extern void do_SAK(struct tty_struct *tty); +extern void __do_SAK(struct tty_struct *tty); extern void disassociate_ctty(int priv); extern void tty_flip_buffer_push(struct tty_struct *tty); extern speed_t tty_get_baud_rate(struct tty_struct *tty); diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 5e9803ed17fc..acb1f105870c 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -3,20 +3,15 @@ #include <linux/types.h> #include <linux/percpu.h> +#include <linux/mm.h> #include <linux/mmzone.h> #include <asm/atomic.h> -#ifdef CONFIG_VM_EVENT_COUNTERS -/* - * Light weight per cpu counter implementation. - * - * Counters should only be incremented. You need to set EMBEDDED - * to disable VM_EVENT_COUNTERS. Things like procps (vmstat, - * top, etc) use /proc/vmstat and depend on these counters. - * - * Counters are handled completely inline. On many platforms the code - * generated will simply be the increment of a global address. - */ +#ifdef CONFIG_ZONE_DMA +#define DMA_ZONE(xx) xx##_DMA, +#else +#define DMA_ZONE(xx) +#endif #ifdef CONFIG_ZONE_DMA32 #define DMA32_ZONE(xx) xx##_DMA32, @@ -30,7 +25,7 @@ #define HIGHMEM_ZONE(xx) #endif -#define FOR_ALL_ZONES(xx) xx##_DMA, DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) +#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, FOR_ALL_ZONES(PGALLOC), @@ -45,6 +40,17 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, NR_VM_EVENT_ITEMS }; +#ifdef CONFIG_VM_EVENT_COUNTERS +/* + * Light weight per cpu counter implementation. + * + * Counters should only be incremented and no critical kernel component + * should rely on the counter values. + * + * Counters are handled completely inline. On many platforms the code + * generated will simply be the increment of a global address. + */ + struct vm_event_state { unsigned long event[NR_VM_EVENT_ITEMS]; }; @@ -85,17 +91,30 @@ static inline void vm_events_fold_cpu(int cpu) #else /* Disable counters */ -#define get_cpu_vm_events(e) 0L -#define count_vm_event(e) do { } while (0) -#define count_vm_events(e,d) do { } while (0) -#define __count_vm_event(e) do { } while (0) -#define __count_vm_events(e,d) do { } while (0) -#define vm_events_fold_cpu(x) do { } while (0) +static inline void count_vm_event(enum vm_event_item item) +{ +} +static inline void count_vm_events(enum vm_event_item item, long delta) +{ +} +static inline void __count_vm_event(enum vm_event_item item) +{ +} +static inline void __count_vm_events(enum vm_event_item item, long delta) +{ +} +static inline void all_vm_events(unsigned long *ret) +{ +} +static inline void vm_events_fold_cpu(int cpu) +{ +} #endif /* CONFIG_VM_EVENT_COUNTERS */ #define __count_zone_vm_events(item, zone, delta) \ - __count_vm_events(item##_DMA + zone_idx(zone), delta) + __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ + zone_idx(zone), delta) /* * Zone based page accounting with per cpu differentials. @@ -142,14 +161,16 @@ static inline unsigned long node_page_state(int node, struct zone *zones = NODE_DATA(node)->node_zones; return +#ifdef CONFIG_ZONE_DMA + zone_page_state(&zones[ZONE_DMA], item) + +#endif #ifdef CONFIG_ZONE_DMA32 zone_page_state(&zones[ZONE_DMA32], item) + #endif - zone_page_state(&zones[ZONE_NORMAL], item) + #ifdef CONFIG_HIGHMEM zone_page_state(&zones[ZONE_HIGHMEM], item) + #endif - zone_page_state(&zones[ZONE_DMA], item); + zone_page_state(&zones[ZONE_NORMAL], item); } extern void zone_statistics(struct zonelist *, struct zone *); @@ -186,6 +207,9 @@ void inc_zone_page_state(struct page *, enum zone_stat_item); void dec_zone_page_state(struct page *, enum zone_stat_item); extern void inc_zone_state(struct zone *, enum zone_stat_item); +extern void __inc_zone_state(struct zone *, enum zone_stat_item); +extern void dec_zone_state(struct zone *, enum zone_stat_item); +extern void __dec_zone_state(struct zone *, enum zone_stat_item); void refresh_cpu_vm_stats(int); void refresh_vm_stats(void); @@ -214,6 +238,12 @@ static inline void __inc_zone_page_state(struct page *page, __inc_zone_state(page_zone(page), item); } +static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) +{ + atomic_long_dec(&zone->vm_stat[item]); + atomic_long_dec(&vm_stat[item]); +} + static inline void __dec_zone_page_state(struct page *page, enum zone_stat_item item) { diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 0e7f1e20ea45..def131a5ac70 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -13,6 +13,10 @@ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#ifdef __KERNEL__ + +#include <linux/types.h> + /* Namespaces */ #define XATTR_OS2_PREFIX "os2." #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) @@ -29,6 +33,8 @@ #define XATTR_USER_PREFIX "user." #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) +struct inode; +struct dentry; struct xattr_handler { char *prefix; @@ -50,4 +56,6 @@ ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_siz int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); int generic_removexattr(struct dentry *dentry, const char *name); +#endif /* __KERNEL__ */ + #endif /* _LINUX_XATTR_H */ |