diff options
Diffstat (limited to 'include')
33 files changed, 932 insertions, 129 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 485eeb6c4ef3..979c6a57f2f1 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -136,6 +136,32 @@ extern int __gpio_cansleep(unsigned gpio); | |||
| 136 | 136 | ||
| 137 | extern int __gpio_to_irq(unsigned gpio); | 137 | extern int __gpio_to_irq(unsigned gpio); |
| 138 | 138 | ||
| 139 | #define GPIOF_DIR_OUT (0 << 0) | ||
| 140 | #define GPIOF_DIR_IN (1 << 0) | ||
| 141 | |||
| 142 | #define GPIOF_INIT_LOW (0 << 1) | ||
| 143 | #define GPIOF_INIT_HIGH (1 << 1) | ||
| 144 | |||
| 145 | #define GPIOF_IN (GPIOF_DIR_IN) | ||
| 146 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) | ||
| 147 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) | ||
| 148 | |||
| 149 | /** | ||
| 150 | * struct gpio - a structure describing a GPIO with configuration | ||
| 151 | * @gpio: the GPIO number | ||
| 152 | * @flags: GPIO configuration as specified by GPIOF_* | ||
| 153 | * @label: a literal description string of this GPIO | ||
| 154 | */ | ||
| 155 | struct gpio { | ||
| 156 | unsigned gpio; | ||
| 157 | unsigned long flags; | ||
| 158 | const char *label; | ||
| 159 | }; | ||
| 160 | |||
| 161 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | ||
| 162 | extern int gpio_request_array(struct gpio *array, size_t num); | ||
| 163 | extern void gpio_free_array(struct gpio *array, size_t num); | ||
| 164 | |||
| 139 | #ifdef CONFIG_GPIO_SYSFS | 165 | #ifdef CONFIG_GPIO_SYSFS |
| 140 | 166 | ||
| 141 | /* | 167 | /* |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 89c6249fc561..c809e286d213 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -74,6 +74,7 @@ struct coredump_params { | |||
| 74 | struct pt_regs *regs; | 74 | struct pt_regs *regs; |
| 75 | struct file *file; | 75 | struct file *file; |
| 76 | unsigned long limit; | 76 | unsigned long limit; |
| 77 | unsigned long mm_flags; | ||
| 77 | }; | 78 | }; |
| 78 | 79 | ||
| 79 | /* | 80 | /* |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 25b8b2f33ae9..b79389879238 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -16,11 +16,13 @@ | |||
| 16 | */ | 16 | */ |
| 17 | #include <asm/bitops.h> | 17 | #include <asm/bitops.h> |
| 18 | 18 | ||
| 19 | #define for_each_bit(bit, addr, size) \ | 19 | #define for_each_set_bit(bit, addr, size) \ |
| 20 | for ((bit) = find_first_bit((addr), (size)); \ | 20 | for ((bit) = find_first_bit((addr), (size)); \ |
| 21 | (bit) < (size); \ | 21 | (bit) < (size); \ |
| 22 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | 22 | (bit) = find_next_bit((addr), (size), (bit) + 1)) |
| 23 | 23 | ||
| 24 | /* Temporary */ | ||
| 25 | #define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size) | ||
| 24 | 26 | ||
| 25 | static __inline__ int get_bitmask_order(unsigned int count) | 27 | static __inline__ int get_bitmask_order(unsigned int count) |
| 26 | { | 28 | { |
diff --git a/include/linux/btree-128.h b/include/linux/btree-128.h new file mode 100644 index 000000000000..0b3414c4c928 --- /dev/null +++ b/include/linux/btree-128.h | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | extern struct btree_geo btree_geo128; | ||
| 2 | |||
| 3 | struct btree_head128 { struct btree_head h; }; | ||
| 4 | |||
| 5 | static inline void btree_init_mempool128(struct btree_head128 *head, | ||
| 6 | mempool_t *mempool) | ||
| 7 | { | ||
| 8 | btree_init_mempool(&head->h, mempool); | ||
| 9 | } | ||
| 10 | |||
| 11 | static inline int btree_init128(struct btree_head128 *head) | ||
| 12 | { | ||
| 13 | return btree_init(&head->h); | ||
| 14 | } | ||
| 15 | |||
| 16 | static inline void btree_destroy128(struct btree_head128 *head) | ||
| 17 | { | ||
| 18 | btree_destroy(&head->h); | ||
| 19 | } | ||
| 20 | |||
| 21 | static inline void *btree_lookup128(struct btree_head128 *head, u64 k1, u64 k2) | ||
| 22 | { | ||
| 23 | u64 key[2] = {k1, k2}; | ||
| 24 | return btree_lookup(&head->h, &btree_geo128, (unsigned long *)&key); | ||
| 25 | } | ||
| 26 | |||
| 27 | static inline void *btree_get_prev128(struct btree_head128 *head, | ||
| 28 | u64 *k1, u64 *k2) | ||
| 29 | { | ||
| 30 | u64 key[2] = {*k1, *k2}; | ||
| 31 | void *val; | ||
| 32 | |||
| 33 | val = btree_get_prev(&head->h, &btree_geo128, | ||
| 34 | (unsigned long *)&key); | ||
| 35 | *k1 = key[0]; | ||
| 36 | *k2 = key[1]; | ||
| 37 | return val; | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline int btree_insert128(struct btree_head128 *head, u64 k1, u64 k2, | ||
| 41 | void *val, gfp_t gfp) | ||
| 42 | { | ||
| 43 | u64 key[2] = {k1, k2}; | ||
| 44 | return btree_insert(&head->h, &btree_geo128, | ||
| 45 | (unsigned long *)&key, val, gfp); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline int btree_update128(struct btree_head128 *head, u64 k1, u64 k2, | ||
| 49 | void *val) | ||
| 50 | { | ||
| 51 | u64 key[2] = {k1, k2}; | ||
| 52 | return btree_update(&head->h, &btree_geo128, | ||
| 53 | (unsigned long *)&key, val); | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline void *btree_remove128(struct btree_head128 *head, u64 k1, u64 k2) | ||
| 57 | { | ||
| 58 | u64 key[2] = {k1, k2}; | ||
| 59 | return btree_remove(&head->h, &btree_geo128, (unsigned long *)&key); | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline void *btree_last128(struct btree_head128 *head, u64 *k1, u64 *k2) | ||
| 63 | { | ||
| 64 | u64 key[2]; | ||
| 65 | void *val; | ||
| 66 | |||
| 67 | val = btree_last(&head->h, &btree_geo128, (unsigned long *)&key[0]); | ||
| 68 | if (val) { | ||
| 69 | *k1 = key[0]; | ||
| 70 | *k2 = key[1]; | ||
| 71 | } | ||
| 72 | |||
| 73 | return val; | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline int btree_merge128(struct btree_head128 *target, | ||
| 77 | struct btree_head128 *victim, | ||
| 78 | gfp_t gfp) | ||
| 79 | { | ||
| 80 | return btree_merge(&target->h, &victim->h, &btree_geo128, gfp); | ||
| 81 | } | ||
| 82 | |||
| 83 | void visitor128(void *elem, unsigned long opaque, unsigned long *__key, | ||
| 84 | size_t index, void *__func); | ||
| 85 | |||
| 86 | typedef void (*visitor128_t)(void *elem, unsigned long opaque, | ||
| 87 | u64 key1, u64 key2, size_t index); | ||
| 88 | |||
| 89 | static inline size_t btree_visitor128(struct btree_head128 *head, | ||
| 90 | unsigned long opaque, | ||
| 91 | visitor128_t func2) | ||
| 92 | { | ||
| 93 | return btree_visitor(&head->h, &btree_geo128, opaque, | ||
| 94 | visitor128, func2); | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline size_t btree_grim_visitor128(struct btree_head128 *head, | ||
| 98 | unsigned long opaque, | ||
| 99 | visitor128_t func2) | ||
| 100 | { | ||
| 101 | return btree_grim_visitor(&head->h, &btree_geo128, opaque, | ||
| 102 | visitor128, func2); | ||
| 103 | } | ||
| 104 | |||
| 105 | #define btree_for_each_safe128(head, k1, k2, val) \ | ||
| 106 | for (val = btree_last128(head, &k1, &k2); \ | ||
| 107 | val; \ | ||
| 108 | val = btree_get_prev128(head, &k1, &k2)) | ||
| 109 | |||
diff --git a/include/linux/btree-type.h b/include/linux/btree-type.h new file mode 100644 index 000000000000..9a1147ef8563 --- /dev/null +++ b/include/linux/btree-type.h | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | #define __BTREE_TP(pfx, type, sfx) pfx ## type ## sfx | ||
| 2 | #define _BTREE_TP(pfx, type, sfx) __BTREE_TP(pfx, type, sfx) | ||
| 3 | #define BTREE_TP(pfx) _BTREE_TP(pfx, BTREE_TYPE_SUFFIX,) | ||
| 4 | #define BTREE_FN(name) BTREE_TP(btree_ ## name) | ||
| 5 | #define BTREE_TYPE_HEAD BTREE_TP(struct btree_head) | ||
| 6 | #define VISITOR_FN BTREE_TP(visitor) | ||
| 7 | #define VISITOR_FN_T _BTREE_TP(visitor, BTREE_TYPE_SUFFIX, _t) | ||
| 8 | |||
| 9 | BTREE_TYPE_HEAD { | ||
| 10 | struct btree_head h; | ||
| 11 | }; | ||
| 12 | |||
| 13 | static inline void BTREE_FN(init_mempool)(BTREE_TYPE_HEAD *head, | ||
| 14 | mempool_t *mempool) | ||
| 15 | { | ||
| 16 | btree_init_mempool(&head->h, mempool); | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline int BTREE_FN(init)(BTREE_TYPE_HEAD *head) | ||
| 20 | { | ||
| 21 | return btree_init(&head->h); | ||
| 22 | } | ||
| 23 | |||
| 24 | static inline void BTREE_FN(destroy)(BTREE_TYPE_HEAD *head) | ||
| 25 | { | ||
| 26 | btree_destroy(&head->h); | ||
| 27 | } | ||
| 28 | |||
| 29 | static inline int BTREE_FN(merge)(BTREE_TYPE_HEAD *target, | ||
| 30 | BTREE_TYPE_HEAD *victim, | ||
| 31 | gfp_t gfp) | ||
| 32 | { | ||
| 33 | return btree_merge(&target->h, &victim->h, BTREE_TYPE_GEO, gfp); | ||
| 34 | } | ||
| 35 | |||
| 36 | #if (BITS_PER_LONG > BTREE_TYPE_BITS) | ||
| 37 | static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key) | ||
| 38 | { | ||
| 39 | unsigned long _key = key; | ||
| 40 | return btree_lookup(&head->h, BTREE_TYPE_GEO, &_key); | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key, | ||
| 44 | void *val, gfp_t gfp) | ||
| 45 | { | ||
| 46 | unsigned long _key = key; | ||
| 47 | return btree_insert(&head->h, BTREE_TYPE_GEO, &_key, val, gfp); | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key, | ||
| 51 | void *val) | ||
| 52 | { | ||
| 53 | unsigned long _key = key; | ||
| 54 | return btree_update(&head->h, BTREE_TYPE_GEO, &_key, val); | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key) | ||
| 58 | { | ||
| 59 | unsigned long _key = key; | ||
| 60 | return btree_remove(&head->h, BTREE_TYPE_GEO, &_key); | ||
| 61 | } | ||
| 62 | |||
| 63 | static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key) | ||
| 64 | { | ||
| 65 | unsigned long _key; | ||
| 66 | void *val = btree_last(&head->h, BTREE_TYPE_GEO, &_key); | ||
| 67 | if (val) | ||
| 68 | *key = _key; | ||
| 69 | return val; | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key) | ||
| 73 | { | ||
| 74 | unsigned long _key = *key; | ||
| 75 | void *val = btree_get_prev(&head->h, BTREE_TYPE_GEO, &_key); | ||
| 76 | if (val) | ||
| 77 | *key = _key; | ||
| 78 | return val; | ||
| 79 | } | ||
| 80 | #else | ||
| 81 | static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key) | ||
| 82 | { | ||
| 83 | return btree_lookup(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key); | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key, | ||
| 87 | void *val, gfp_t gfp) | ||
| 88 | { | ||
| 89 | return btree_insert(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key, | ||
| 90 | val, gfp); | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key, | ||
| 94 | void *val) | ||
| 95 | { | ||
| 96 | return btree_update(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key, val); | ||
| 97 | } | ||
| 98 | |||
| 99 | static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key) | ||
| 100 | { | ||
| 101 | return btree_remove(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key); | ||
| 102 | } | ||
| 103 | |||
| 104 | static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key) | ||
| 105 | { | ||
| 106 | return btree_last(&head->h, BTREE_TYPE_GEO, (unsigned long *)key); | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key) | ||
| 110 | { | ||
| 111 | return btree_get_prev(&head->h, BTREE_TYPE_GEO, (unsigned long *)key); | ||
| 112 | } | ||
| 113 | #endif | ||
| 114 | |||
| 115 | void VISITOR_FN(void *elem, unsigned long opaque, unsigned long *key, | ||
| 116 | size_t index, void *__func); | ||
| 117 | |||
| 118 | typedef void (*VISITOR_FN_T)(void *elem, unsigned long opaque, | ||
| 119 | BTREE_KEYTYPE key, size_t index); | ||
| 120 | |||
| 121 | static inline size_t BTREE_FN(visitor)(BTREE_TYPE_HEAD *head, | ||
| 122 | unsigned long opaque, | ||
| 123 | VISITOR_FN_T func2) | ||
| 124 | { | ||
| 125 | return btree_visitor(&head->h, BTREE_TYPE_GEO, opaque, | ||
| 126 | visitorl, func2); | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline size_t BTREE_FN(grim_visitor)(BTREE_TYPE_HEAD *head, | ||
| 130 | unsigned long opaque, | ||
| 131 | VISITOR_FN_T func2) | ||
| 132 | { | ||
| 133 | return btree_grim_visitor(&head->h, BTREE_TYPE_GEO, opaque, | ||
| 134 | visitorl, func2); | ||
| 135 | } | ||
| 136 | |||
| 137 | #undef VISITOR_FN | ||
| 138 | #undef VISITOR_FN_T | ||
| 139 | #undef __BTREE_TP | ||
| 140 | #undef _BTREE_TP | ||
| 141 | #undef BTREE_TP | ||
| 142 | #undef BTREE_FN | ||
| 143 | #undef BTREE_TYPE_HEAD | ||
| 144 | #undef BTREE_TYPE_SUFFIX | ||
| 145 | #undef BTREE_TYPE_GEO | ||
| 146 | #undef BTREE_KEYTYPE | ||
| 147 | #undef BTREE_TYPE_BITS | ||
diff --git a/include/linux/btree.h b/include/linux/btree.h new file mode 100644 index 000000000000..65b5bb058324 --- /dev/null +++ b/include/linux/btree.h | |||
| @@ -0,0 +1,243 @@ | |||
| 1 | #ifndef BTREE_H | ||
| 2 | #define BTREE_H | ||
| 3 | |||
| 4 | #include <linux/kernel.h> | ||
| 5 | #include <linux/mempool.h> | ||
| 6 | |||
| 7 | /** | ||
| 8 | * DOC: B+Tree basics | ||
| 9 | * | ||
| 10 | * A B+Tree is a data structure for looking up arbitrary (currently allowing | ||
| 11 | * unsigned long, u32, u64 and 2 * u64) keys into pointers. The data structure | ||
| 12 | * is described at http://en.wikipedia.org/wiki/B-tree, we currently do not | ||
| 13 | * use binary search to find the key on lookups. | ||
| 14 | * | ||
| 15 | * Each B+Tree consists of a head, that contains bookkeeping information and | ||
| 16 | * a variable number (starting with zero) nodes. Each node contains the keys | ||
| 17 | * and pointers to sub-nodes, or, for leaf nodes, the keys and values for the | ||
| 18 | * tree entries. | ||
| 19 | * | ||
| 20 | * Each node in this implementation has the following layout: | ||
| 21 | * [key1, key2, ..., keyN] [val1, val2, ..., valN] | ||
| 22 | * | ||
| 23 | * Each key here is an array of unsigned longs, geo->no_longs in total. The | ||
| 24 | * number of keys and values (N) is geo->no_pairs. | ||
| 25 | */ | ||
| 26 | |||
| 27 | /** | ||
| 28 | * struct btree_head - btree head | ||
| 29 | * | ||
| 30 | * @node: the first node in the tree | ||
| 31 | * @mempool: mempool used for node allocations | ||
| 32 | * @height: current of the tree | ||
| 33 | */ | ||
| 34 | struct btree_head { | ||
| 35 | unsigned long *node; | ||
| 36 | mempool_t *mempool; | ||
| 37 | int height; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* btree geometry */ | ||
| 41 | struct btree_geo; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * btree_alloc - allocate function for the mempool | ||
| 45 | * @gfp_mask: gfp mask for the allocation | ||
| 46 | * @pool_data: unused | ||
| 47 | */ | ||
| 48 | void *btree_alloc(gfp_t gfp_mask, void *pool_data); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * btree_free - free function for the mempool | ||
| 52 | * @element: the element to free | ||
| 53 | * @pool_data: unused | ||
| 54 | */ | ||
| 55 | void btree_free(void *element, void *pool_data); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * btree_init_mempool - initialise a btree with given mempool | ||
| 59 | * | ||
| 60 | * @head: the btree head to initialise | ||
| 61 | * @mempool: the mempool to use | ||
| 62 | * | ||
| 63 | * When this function is used, there is no need to destroy | ||
| 64 | * the mempool. | ||
| 65 | */ | ||
| 66 | void btree_init_mempool(struct btree_head *head, mempool_t *mempool); | ||
| 67 | |||
| 68 | /** | ||
| 69 | * btree_init - initialise a btree | ||
| 70 | * | ||
| 71 | * @head: the btree head to initialise | ||
| 72 | * | ||
| 73 | * This function allocates the memory pool that the | ||
| 74 | * btree needs. Returns zero or a negative error code | ||
| 75 | * (-%ENOMEM) when memory allocation fails. | ||
| 76 | * | ||
| 77 | */ | ||
| 78 | int __must_check btree_init(struct btree_head *head); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * btree_destroy - destroy mempool | ||
| 82 | * | ||
| 83 | * @head: the btree head to destroy | ||
| 84 | * | ||
| 85 | * This function destroys the internal memory pool, use only | ||
| 86 | * when using btree_init(), not with btree_init_mempool(). | ||
| 87 | */ | ||
| 88 | void btree_destroy(struct btree_head *head); | ||
| 89 | |||
| 90 | /** | ||
| 91 | * btree_lookup - look up a key in the btree | ||
| 92 | * | ||
| 93 | * @head: the btree to look in | ||
| 94 | * @geo: the btree geometry | ||
| 95 | * @key: the key to look up | ||
| 96 | * | ||
| 97 | * This function returns the value for the given key, or %NULL. | ||
| 98 | */ | ||
| 99 | void *btree_lookup(struct btree_head *head, struct btree_geo *geo, | ||
| 100 | unsigned long *key); | ||
| 101 | |||
| 102 | /** | ||
| 103 | * btree_insert - insert an entry into the btree | ||
| 104 | * | ||
| 105 | * @head: the btree to add to | ||
| 106 | * @geo: the btree geometry | ||
| 107 | * @key: the key to add (must not already be present) | ||
| 108 | * @val: the value to add (must not be %NULL) | ||
| 109 | * @gfp: allocation flags for node allocations | ||
| 110 | * | ||
| 111 | * This function returns 0 if the item could be added, or an | ||
| 112 | * error code if it failed (may fail due to memory pressure). | ||
| 113 | */ | ||
| 114 | int __must_check btree_insert(struct btree_head *head, struct btree_geo *geo, | ||
| 115 | unsigned long *key, void *val, gfp_t gfp); | ||
| 116 | /** | ||
| 117 | * btree_update - update an entry in the btree | ||
| 118 | * | ||
| 119 | * @head: the btree to update | ||
| 120 | * @geo: the btree geometry | ||
| 121 | * @key: the key to update | ||
| 122 | * @val: the value to change it to (must not be %NULL) | ||
| 123 | * | ||
| 124 | * This function returns 0 if the update was successful, or | ||
| 125 | * -%ENOENT if the key could not be found. | ||
| 126 | */ | ||
| 127 | int btree_update(struct btree_head *head, struct btree_geo *geo, | ||
| 128 | unsigned long *key, void *val); | ||
| 129 | /** | ||
| 130 | * btree_remove - remove an entry from the btree | ||
| 131 | * | ||
| 132 | * @head: the btree to update | ||
| 133 | * @geo: the btree geometry | ||
| 134 | * @key: the key to remove | ||
| 135 | * | ||
| 136 | * This function returns the removed entry, or %NULL if the key | ||
| 137 | * could not be found. | ||
| 138 | */ | ||
| 139 | void *btree_remove(struct btree_head *head, struct btree_geo *geo, | ||
| 140 | unsigned long *key); | ||
| 141 | |||
| 142 | /** | ||
| 143 | * btree_merge - merge two btrees | ||
| 144 | * | ||
| 145 | * @target: the tree that gets all the entries | ||
| 146 | * @victim: the tree that gets merged into @target | ||
| 147 | * @geo: the btree geometry | ||
| 148 | * @gfp: allocation flags | ||
| 149 | * | ||
| 150 | * The two trees @target and @victim may not contain the same keys, | ||
| 151 | * that is a bug and triggers a BUG(). This function returns zero | ||
| 152 | * if the trees were merged successfully, and may return a failure | ||
| 153 | * when memory allocation fails, in which case both trees might have | ||
| 154 | * been partially merged, i.e. some entries have been moved from | ||
| 155 | * @victim to @target. | ||
| 156 | */ | ||
| 157 | int btree_merge(struct btree_head *target, struct btree_head *victim, | ||
| 158 | struct btree_geo *geo, gfp_t gfp); | ||
| 159 | |||
| 160 | /** | ||
| 161 | * btree_last - get last entry in btree | ||
| 162 | * | ||
| 163 | * @head: btree head | ||
| 164 | * @geo: btree geometry | ||
| 165 | * @key: last key | ||
| 166 | * | ||
| 167 | * Returns the last entry in the btree, and sets @key to the key | ||
| 168 | * of that entry; returns NULL if the tree is empty, in that case | ||
| 169 | * key is not changed. | ||
| 170 | */ | ||
| 171 | void *btree_last(struct btree_head *head, struct btree_geo *geo, | ||
| 172 | unsigned long *key); | ||
| 173 | |||
| 174 | /** | ||
| 175 | * btree_get_prev - get previous entry | ||
| 176 | * | ||
| 177 | * @head: btree head | ||
| 178 | * @geo: btree geometry | ||
| 179 | * @key: pointer to key | ||
| 180 | * | ||
| 181 | * The function returns the next item right before the value pointed to by | ||
| 182 | * @key, and updates @key with its key, or returns %NULL when there is no | ||
| 183 | * entry with a key smaller than the given key. | ||
| 184 | */ | ||
| 185 | void *btree_get_prev(struct btree_head *head, struct btree_geo *geo, | ||
| 186 | unsigned long *key); | ||
| 187 | |||
| 188 | |||
| 189 | /* internal use, use btree_visitor{l,32,64,128} */ | ||
| 190 | size_t btree_visitor(struct btree_head *head, struct btree_geo *geo, | ||
| 191 | unsigned long opaque, | ||
| 192 | void (*func)(void *elem, unsigned long opaque, | ||
| 193 | unsigned long *key, size_t index, | ||
| 194 | void *func2), | ||
| 195 | void *func2); | ||
| 196 | |||
| 197 | /* internal use, use btree_grim_visitor{l,32,64,128} */ | ||
| 198 | size_t btree_grim_visitor(struct btree_head *head, struct btree_geo *geo, | ||
| 199 | unsigned long opaque, | ||
| 200 | void (*func)(void *elem, unsigned long opaque, | ||
| 201 | unsigned long *key, | ||
| 202 | size_t index, void *func2), | ||
| 203 | void *func2); | ||
| 204 | |||
| 205 | |||
| 206 | #include <linux/btree-128.h> | ||
| 207 | |||
| 208 | extern struct btree_geo btree_geo32; | ||
| 209 | #define BTREE_TYPE_SUFFIX l | ||
| 210 | #define BTREE_TYPE_BITS BITS_PER_LONG | ||
| 211 | #define BTREE_TYPE_GEO &btree_geo32 | ||
| 212 | #define BTREE_KEYTYPE unsigned long | ||
| 213 | #include <linux/btree-type.h> | ||
| 214 | |||
| 215 | #define btree_for_each_safel(head, key, val) \ | ||
| 216 | for (val = btree_lastl(head, &key); \ | ||
| 217 | val; \ | ||
| 218 | val = btree_get_prevl(head, &key)) | ||
| 219 | |||
| 220 | #define BTREE_TYPE_SUFFIX 32 | ||
| 221 | #define BTREE_TYPE_BITS 32 | ||
| 222 | #define BTREE_TYPE_GEO &btree_geo32 | ||
| 223 | #define BTREE_KEYTYPE u32 | ||
| 224 | #include <linux/btree-type.h> | ||
| 225 | |||
| 226 | #define btree_for_each_safe32(head, key, val) \ | ||
| 227 | for (val = btree_last32(head, &key); \ | ||
| 228 | val; \ | ||
| 229 | val = btree_get_prev32(head, &key)) | ||
| 230 | |||
| 231 | extern struct btree_geo btree_geo64; | ||
| 232 | #define BTREE_TYPE_SUFFIX 64 | ||
| 233 | #define BTREE_TYPE_BITS 64 | ||
| 234 | #define BTREE_TYPE_GEO &btree_geo64 | ||
| 235 | #define BTREE_KEYTYPE u64 | ||
| 236 | #include <linux/btree-type.h> | ||
| 237 | |||
| 238 | #define btree_for_each_safe64(head, key, val) \ | ||
| 239 | for (val = btree_last64(head, &key); \ | ||
| 240 | val; \ | ||
| 241 | val = btree_get_prev64(head, &key)) | ||
| 242 | |||
| 243 | #endif | ||
diff --git a/include/linux/coredump.h b/include/linux/coredump.h new file mode 100644 index 000000000000..b3c91d7cede4 --- /dev/null +++ b/include/linux/coredump.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef _LINUX_COREDUMP_H | ||
| 2 | #define _LINUX_COREDUMP_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/mm.h> | ||
| 6 | #include <linux/fs.h> | ||
| 7 | |||
| 8 | /* | ||
| 9 | * These are the only things you should do on a core-file: use only these | ||
| 10 | * functions to write out all the necessary info. | ||
| 11 | */ | ||
| 12 | static inline int dump_write(struct file *file, const void *addr, int nr) | ||
| 13 | { | ||
| 14 | return file->f_op->write(file, addr, nr, &file->f_pos) == nr; | ||
| 15 | } | ||
| 16 | |||
| 17 | static inline int dump_seek(struct file *file, loff_t off) | ||
| 18 | { | ||
| 19 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | ||
| 20 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) | ||
| 21 | return 0; | ||
| 22 | } else { | ||
| 23 | char *buf = (char *)get_zeroed_page(GFP_KERNEL); | ||
| 24 | |||
| 25 | if (!buf) | ||
| 26 | return 0; | ||
| 27 | while (off > 0) { | ||
| 28 | unsigned long n = off; | ||
| 29 | |||
| 30 | if (n > PAGE_SIZE) | ||
| 31 | n = PAGE_SIZE; | ||
| 32 | if (!dump_write(file, buf, n)) | ||
| 33 | return 0; | ||
| 34 | off -= n; | ||
| 35 | } | ||
| 36 | free_page((unsigned long)buf); | ||
| 37 | } | ||
| 38 | return 1; | ||
| 39 | } | ||
| 40 | |||
| 41 | #endif /* _LINUX_COREDUMP_H */ | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index dbcee7647d9a..bae6fe24d1f9 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -90,10 +90,10 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 90 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) | 90 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) |
| 91 | #define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask) | 91 | #define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask) |
| 92 | #else | 92 | #else |
| 93 | #define num_online_cpus() 1 | 93 | #define num_online_cpus() 1U |
| 94 | #define num_possible_cpus() 1 | 94 | #define num_possible_cpus() 1U |
| 95 | #define num_present_cpus() 1 | 95 | #define num_present_cpus() 1U |
| 96 | #define num_active_cpus() 1 | 96 | #define num_active_cpus() 1U |
| 97 | #define cpu_online(cpu) ((cpu) == 0) | 97 | #define cpu_online(cpu) ((cpu) == 0) |
| 98 | #define cpu_possible(cpu) ((cpu) == 0) | 98 | #define cpu_possible(cpu) ((cpu) == 0) |
| 99 | #define cpu_present(cpu) ((cpu) == 0) | 99 | #define cpu_present(cpu) ((cpu) == 0) |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index d4c9c0b88adc..1381cd97b4ed 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -118,10 +118,9 @@ struct dm_dev { | |||
| 118 | /* | 118 | /* |
| 119 | * Constructors should call these functions to ensure destination devices | 119 | * Constructors should call these functions to ensure destination devices |
| 120 | * are opened/closed correctly. | 120 | * are opened/closed correctly. |
| 121 | * FIXME: too many arguments. | ||
| 122 | */ | 121 | */ |
| 123 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, | 122 | int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, |
| 124 | sector_t len, fmode_t mode, struct dm_dev **result); | 123 | struct dm_dev **result); |
| 125 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); | 124 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); |
| 126 | 125 | ||
| 127 | /* | 126 | /* |
diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h index b6bf17ee2f61..5c9186b93fff 100644 --- a/include/linux/dm-io.h +++ b/include/linux/dm-io.h | |||
| @@ -37,14 +37,14 @@ enum dm_io_mem_type { | |||
| 37 | struct dm_io_memory { | 37 | struct dm_io_memory { |
| 38 | enum dm_io_mem_type type; | 38 | enum dm_io_mem_type type; |
| 39 | 39 | ||
| 40 | unsigned offset; | ||
| 41 | |||
| 40 | union { | 42 | union { |
| 41 | struct page_list *pl; | 43 | struct page_list *pl; |
| 42 | struct bio_vec *bvec; | 44 | struct bio_vec *bvec; |
| 43 | void *vma; | 45 | void *vma; |
| 44 | void *addr; | 46 | void *addr; |
| 45 | } ptr; | 47 | } ptr; |
| 46 | |||
| 47 | unsigned offset; | ||
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | struct dm_io_notify { | 50 | struct dm_io_notify { |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index aa95508d2f95..2c445e113790 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
| @@ -266,9 +266,9 @@ enum { | |||
| 266 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 266 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
| 267 | 267 | ||
| 268 | #define DM_VERSION_MAJOR 4 | 268 | #define DM_VERSION_MAJOR 4 |
| 269 | #define DM_VERSION_MINOR 16 | 269 | #define DM_VERSION_MINOR 17 |
| 270 | #define DM_VERSION_PATCHLEVEL 0 | 270 | #define DM_VERSION_PATCHLEVEL 0 |
| 271 | #define DM_VERSION_EXTRA "-ioctl (2009-11-05)" | 271 | #define DM_VERSION_EXTRA "-ioctl (2010-03-05)" |
| 272 | 272 | ||
| 273 | /* Status bits */ | 273 | /* Status bits */ |
| 274 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 274 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
| @@ -316,4 +316,9 @@ enum { | |||
| 316 | */ | 316 | */ |
| 317 | #define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */ | 317 | #define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */ |
| 318 | 318 | ||
| 319 | /* | ||
| 320 | * If set, a uevent was generated for which the caller may need to wait. | ||
| 321 | */ | ||
| 322 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */ | ||
| 323 | |||
| 319 | #endif /* _LINUX_DM_IOCTL_H */ | 324 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/linux/elf.h b/include/linux/elf.h index ad990c5f63f6..597858418051 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -50,6 +50,28 @@ typedef __s64 Elf64_Sxword; | |||
| 50 | 50 | ||
| 51 | #define PT_GNU_STACK (PT_LOOS + 0x474e551) | 51 | #define PT_GNU_STACK (PT_LOOS + 0x474e551) |
| 52 | 52 | ||
| 53 | /* | ||
| 54 | * Extended Numbering | ||
| 55 | * | ||
| 56 | * If the real number of program header table entries is larger than | ||
| 57 | * or equal to PN_XNUM(0xffff), it is set to sh_info field of the | ||
| 58 | * section header at index 0, and PN_XNUM is set to e_phnum | ||
| 59 | * field. Otherwise, the section header at index 0 is zero | ||
| 60 | * initialized, if it exists. | ||
| 61 | * | ||
| 62 | * Specifications are available in: | ||
| 63 | * | ||
| 64 | * - Sun microsystems: Linker and Libraries. | ||
| 65 | * Part No: 817-1984-17, September 2008. | ||
| 66 | * URL: http://docs.sun.com/app/docs/doc/817-1984 | ||
| 67 | * | ||
| 68 | * - System V ABI AMD64 Architecture Processor Supplement | ||
| 69 | * Draft Version 0.99., | ||
| 70 | * May 11, 2009. | ||
| 71 | * URL: http://www.x86-64.org/ | ||
| 72 | */ | ||
| 73 | #define PN_XNUM 0xffff | ||
| 74 | |||
| 53 | /* These constants define the different elf file types */ | 75 | /* These constants define the different elf file types */ |
| 54 | #define ET_NONE 0 | 76 | #define ET_NONE 0 |
| 55 | #define ET_REL 1 | 77 | #define ET_REL 1 |
| @@ -286,7 +308,7 @@ typedef struct elf64_phdr { | |||
| 286 | #define SHN_COMMON 0xfff2 | 308 | #define SHN_COMMON 0xfff2 |
| 287 | #define SHN_HIRESERVE 0xffff | 309 | #define SHN_HIRESERVE 0xffff |
| 288 | 310 | ||
| 289 | typedef struct { | 311 | typedef struct elf32_shdr { |
| 290 | Elf32_Word sh_name; | 312 | Elf32_Word sh_name; |
| 291 | Elf32_Word sh_type; | 313 | Elf32_Word sh_type; |
| 292 | Elf32_Word sh_flags; | 314 | Elf32_Word sh_flags; |
| @@ -394,16 +416,20 @@ typedef struct elf64_note { | |||
| 394 | extern Elf32_Dyn _DYNAMIC []; | 416 | extern Elf32_Dyn _DYNAMIC []; |
| 395 | #define elfhdr elf32_hdr | 417 | #define elfhdr elf32_hdr |
| 396 | #define elf_phdr elf32_phdr | 418 | #define elf_phdr elf32_phdr |
| 419 | #define elf_shdr elf32_shdr | ||
| 397 | #define elf_note elf32_note | 420 | #define elf_note elf32_note |
| 398 | #define elf_addr_t Elf32_Off | 421 | #define elf_addr_t Elf32_Off |
| 422 | #define Elf_Half Elf32_Half | ||
| 399 | 423 | ||
| 400 | #else | 424 | #else |
| 401 | 425 | ||
| 402 | extern Elf64_Dyn _DYNAMIC []; | 426 | extern Elf64_Dyn _DYNAMIC []; |
| 403 | #define elfhdr elf64_hdr | 427 | #define elfhdr elf64_hdr |
| 404 | #define elf_phdr elf64_phdr | 428 | #define elf_phdr elf64_phdr |
| 429 | #define elf_shdr elf64_shdr | ||
| 405 | #define elf_note elf64_note | 430 | #define elf_note elf64_note |
| 406 | #define elf_addr_t Elf64_Off | 431 | #define elf_addr_t Elf64_Off |
| 432 | #define Elf_Half Elf64_Half | ||
| 407 | 433 | ||
| 408 | #endif | 434 | #endif |
| 409 | 435 | ||
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 00d6a68d0421..e687bc3ba4da 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #include <linux/user.h> | 8 | #include <linux/user.h> |
| 9 | #endif | 9 | #endif |
| 10 | #include <linux/ptrace.h> | 10 | #include <linux/ptrace.h> |
| 11 | #include <linux/elf.h> | ||
| 12 | #include <linux/fs.h> | ||
| 11 | 13 | ||
| 12 | struct elf_siginfo | 14 | struct elf_siginfo |
| 13 | { | 15 | { |
| @@ -150,5 +152,20 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse | |||
| 150 | 152 | ||
| 151 | #endif /* __KERNEL__ */ | 153 | #endif /* __KERNEL__ */ |
| 152 | 154 | ||
| 155 | /* | ||
| 156 | * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out | ||
| 157 | * extra segments containing the gate DSO contents. Dumping its | ||
| 158 | * contents makes post-mortem fully interpretable later without matching up | ||
| 159 | * the same kernel and hardware config to see what PC values meant. | ||
| 160 | * Dumping its extra ELF program headers includes all the other information | ||
| 161 | * a debugger needs to easily find how the gate DSO was being used. | ||
| 162 | */ | ||
| 163 | extern Elf_Half elf_core_extra_phdrs(void); | ||
| 164 | extern int | ||
| 165 | elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, | ||
| 166 | unsigned long limit); | ||
| 167 | extern int | ||
| 168 | elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); | ||
| 169 | extern size_t elf_core_extra_data_size(void); | ||
| 153 | 170 | ||
| 154 | #endif /* _LINUX_ELFCORE_H */ | 171 | #endif /* _LINUX_ELFCORE_H */ |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index dc12f416a49f..a9cd507f8cd2 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
| @@ -96,6 +96,7 @@ struct fid { | |||
| 96 | * @fh_to_parent: find the implied object's parent and get a dentry for it | 96 | * @fh_to_parent: find the implied object's parent and get a dentry for it |
| 97 | * @get_name: find the name for a given inode in a given directory | 97 | * @get_name: find the name for a given inode in a given directory |
| 98 | * @get_parent: find the parent of a given directory | 98 | * @get_parent: find the parent of a given directory |
| 99 | * @commit_metadata: commit metadata changes to stable storage | ||
| 99 | * | 100 | * |
| 100 | * See Documentation/filesystems/nfs/Exporting for details on how to use | 101 | * See Documentation/filesystems/nfs/Exporting for details on how to use |
| 101 | * this interface correctly. | 102 | * this interface correctly. |
| @@ -137,6 +138,9 @@ struct fid { | |||
| 137 | * is also a directory. In the event that it cannot be found, or storage | 138 | * is also a directory. In the event that it cannot be found, or storage |
| 138 | * space cannot be allocated, a %ERR_PTR should be returned. | 139 | * space cannot be allocated, a %ERR_PTR should be returned. |
| 139 | * | 140 | * |
| 141 | * commit_metadata: | ||
| 142 | * @commit_metadata should commit metadata changes to stable storage. | ||
| 143 | * | ||
| 140 | * Locking rules: | 144 | * Locking rules: |
| 141 | * get_parent is called with child->d_inode->i_mutex down | 145 | * get_parent is called with child->d_inode->i_mutex down |
| 142 | * get_name is not (which is possibly inconsistent) | 146 | * get_name is not (which is possibly inconsistent) |
| @@ -152,6 +156,7 @@ struct export_operations { | |||
| 152 | int (*get_name)(struct dentry *parent, char *name, | 156 | int (*get_name)(struct dentry *parent, char *name, |
| 153 | struct dentry *child); | 157 | struct dentry *child); |
| 154 | struct dentry * (*get_parent)(struct dentry *child); | 158 | struct dentry * (*get_parent)(struct dentry *child); |
| 159 | int (*commit_metadata)(struct inode *inode); | ||
| 155 | }; | 160 | }; |
| 156 | 161 | ||
| 157 | extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, | 162 | extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, |
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index 875451f1373a..c6dcc1dfe781 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
| @@ -24,17 +24,17 @@ | |||
| 24 | */ | 24 | */ |
| 25 | #ifdef CONFIG_FIRMWARE_MEMMAP | 25 | #ifdef CONFIG_FIRMWARE_MEMMAP |
| 26 | 26 | ||
| 27 | int firmware_map_add(u64 start, u64 end, const char *type); | ||
| 28 | int firmware_map_add_early(u64 start, u64 end, const char *type); | 27 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
| 28 | int firmware_map_add_hotplug(u64 start, u64 end, const char *type); | ||
| 29 | 29 | ||
| 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
| 31 | 31 | ||
| 32 | static inline int firmware_map_add(u64 start, u64 end, const char *type) | 32 | static inline int firmware_map_add_early(u64 start, u64 end, const char *type) |
| 33 | { | 33 | { |
| 34 | return 0; | 34 | return 0; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static inline int firmware_map_add_early(u64 start, u64 end, const char *type) | 37 | static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type) |
| 38 | { | 38 | { |
| 39 | return 0; | 39 | return 0; |
| 40 | } | 40 | } |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 45689621a851..10b8dedcd18b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -60,24 +60,24 @@ struct inodes_stat_t { | |||
| 60 | */ | 60 | */ |
| 61 | 61 | ||
| 62 | /* file is open for reading */ | 62 | /* file is open for reading */ |
| 63 | #define FMODE_READ ((__force fmode_t)1) | 63 | #define FMODE_READ ((__force fmode_t)0x1) |
| 64 | /* file is open for writing */ | 64 | /* file is open for writing */ |
| 65 | #define FMODE_WRITE ((__force fmode_t)2) | 65 | #define FMODE_WRITE ((__force fmode_t)0x2) |
| 66 | /* file is seekable */ | 66 | /* file is seekable */ |
| 67 | #define FMODE_LSEEK ((__force fmode_t)4) | 67 | #define FMODE_LSEEK ((__force fmode_t)0x4) |
| 68 | /* file can be accessed using pread */ | 68 | /* file can be accessed using pread */ |
| 69 | #define FMODE_PREAD ((__force fmode_t)8) | 69 | #define FMODE_PREAD ((__force fmode_t)0x8) |
| 70 | /* file can be accessed using pwrite */ | 70 | /* file can be accessed using pwrite */ |
| 71 | #define FMODE_PWRITE ((__force fmode_t)16) | 71 | #define FMODE_PWRITE ((__force fmode_t)0x10) |
| 72 | /* File is opened for execution with sys_execve / sys_uselib */ | 72 | /* File is opened for execution with sys_execve / sys_uselib */ |
| 73 | #define FMODE_EXEC ((__force fmode_t)32) | 73 | #define FMODE_EXEC ((__force fmode_t)0x20) |
| 74 | /* File is opened with O_NDELAY (only set for block devices) */ | 74 | /* File is opened with O_NDELAY (only set for block devices) */ |
| 75 | #define FMODE_NDELAY ((__force fmode_t)64) | 75 | #define FMODE_NDELAY ((__force fmode_t)0x40) |
| 76 | /* File is opened with O_EXCL (only set for block devices) */ | 76 | /* File is opened with O_EXCL (only set for block devices) */ |
| 77 | #define FMODE_EXCL ((__force fmode_t)128) | 77 | #define FMODE_EXCL ((__force fmode_t)0x80) |
| 78 | /* File is opened using open(.., 3, ..) and is writeable only for ioctls | 78 | /* File is opened using open(.., 3, ..) and is writeable only for ioctls |
| 79 | (specialy hack for floppy.c) */ | 79 | (specialy hack for floppy.c) */ |
| 80 | #define FMODE_WRITE_IOCTL ((__force fmode_t)256) | 80 | #define FMODE_WRITE_IOCTL ((__force fmode_t)0x100) |
| 81 | 81 | ||
| 82 | /* | 82 | /* |
| 83 | * Don't update ctime and mtime. | 83 | * Don't update ctime and mtime. |
| @@ -85,7 +85,10 @@ struct inodes_stat_t { | |||
| 85 | * Currently a special hack for the XFS open_by_handle ioctl, but we'll | 85 | * Currently a special hack for the XFS open_by_handle ioctl, but we'll |
| 86 | * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. | 86 | * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. |
| 87 | */ | 87 | */ |
| 88 | #define FMODE_NOCMTIME ((__force fmode_t)2048) | 88 | #define FMODE_NOCMTIME ((__force fmode_t)0x800) |
| 89 | |||
| 90 | /* Expect random access pattern */ | ||
| 91 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | ||
| 89 | 92 | ||
| 90 | /* | 93 | /* |
| 91 | * The below are the various read and write types that we support. Some of | 94 | * The below are the various read and write types that we support. Some of |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 557bdad320b6..4c6d41333f98 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -30,7 +30,8 @@ struct vm_area_struct; | |||
| 30 | * _might_ fail. This depends upon the particular VM implementation. | 30 | * _might_ fail. This depends upon the particular VM implementation. |
| 31 | * | 31 | * |
| 32 | * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller | 32 | * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller |
| 33 | * cannot handle allocation failures. | 33 | * cannot handle allocation failures. This modifier is deprecated and no new |
| 34 | * users should be added. | ||
| 34 | * | 35 | * |
| 35 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. | 36 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. |
| 36 | * | 37 | * |
| @@ -83,6 +84,7 @@ struct vm_area_struct; | |||
| 83 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | 84 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ |
| 84 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | 85 | __GFP_HARDWALL | __GFP_HIGHMEM | \ |
| 85 | __GFP_MOVABLE) | 86 | __GFP_MOVABLE) |
| 87 | #define GFP_IOFS (__GFP_IO | __GFP_FS) | ||
| 86 | 88 | ||
| 87 | #ifdef CONFIG_NUMA | 89 | #ifdef CONFIG_NUMA |
| 88 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 90 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
| @@ -325,7 +327,7 @@ void free_pages_exact(void *virt, size_t size); | |||
| 325 | 327 | ||
| 326 | extern void __free_pages(struct page *page, unsigned int order); | 328 | extern void __free_pages(struct page *page, unsigned int order); |
| 327 | extern void free_pages(unsigned long addr, unsigned int order); | 329 | extern void free_pages(unsigned long addr, unsigned int order); |
| 328 | extern void free_hot_page(struct page *page); | 330 | extern void free_hot_cold_page(struct page *page, int cold); |
| 329 | 331 | ||
| 330 | #define __free_page(page) __free_pages((page), 0) | 332 | #define __free_page(page) __free_pages((page), 0) |
| 331 | #define free_page(addr) free_pages((addr),0) | 333 | #define free_page(addr) free_pages((addr),0) |
| @@ -337,9 +339,7 @@ void drain_local_pages(void *dummy); | |||
| 337 | 339 | ||
| 338 | extern gfp_t gfp_allowed_mask; | 340 | extern gfp_t gfp_allowed_mask; |
| 339 | 341 | ||
| 340 | static inline void set_gfp_allowed_mask(gfp_t mask) | 342 | extern void set_gfp_allowed_mask(gfp_t mask); |
| 341 | { | 343 | extern gfp_t clear_gfp_allowed_mask(gfp_t mask); |
| 342 | gfp_allowed_mask = mask; | ||
| 343 | } | ||
| 344 | 344 | ||
| 345 | #endif /* __LINUX_GFP_H */ | 345 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h index 81736d6a8db7..d5c5a60c8a0b 100644 --- a/include/linux/i2c/pca953x.h +++ b/include/linux/i2c/pca953x.h | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | #ifndef _LINUX_PCA953X_H | ||
| 2 | #define _LINUX_PCA953X_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/i2c.h> | ||
| 6 | |||
| 1 | /* platform data for the PCA9539 16-bit I/O expander driver */ | 7 | /* platform data for the PCA9539 16-bit I/O expander driver */ |
| 2 | 8 | ||
| 3 | struct pca953x_platform_data { | 9 | struct pca953x_platform_data { |
| @@ -7,6 +13,9 @@ struct pca953x_platform_data { | |||
| 7 | /* initial polarity inversion setting */ | 13 | /* initial polarity inversion setting */ |
| 8 | uint16_t invert; | 14 | uint16_t invert; |
| 9 | 15 | ||
| 16 | /* interrupt base */ | ||
| 17 | int irq_base; | ||
| 18 | |||
| 10 | void *context; /* param to setup/teardown */ | 19 | void *context; /* param to setup/teardown */ |
| 11 | 20 | ||
| 12 | int (*setup)(struct i2c_client *client, | 21 | int (*setup)(struct i2c_client *client, |
| @@ -17,3 +26,5 @@ struct pca953x_platform_data { | |||
| 17 | void *context); | 26 | void *context); |
| 18 | char **names; | 27 | char **names; |
| 19 | }; | 28 | }; |
| 29 | |||
| 30 | #endif /* _LINUX_PCA953X_H */ | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 5d9c6558e8ab..8392884a2977 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -498,7 +498,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 498 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 498 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
| 499 | 499 | ||
| 500 | /** | 500 | /** |
| 501 | * list_for_each_entry_safe_continue | 501 | * list_for_each_entry_safe_continue - continue list iteration safe against removal |
| 502 | * @pos: the type * to use as a loop cursor. | 502 | * @pos: the type * to use as a loop cursor. |
| 503 | * @n: another type * to use as temporary storage | 503 | * @n: another type * to use as temporary storage |
| 504 | * @head: the head for your list. | 504 | * @head: the head for your list. |
| @@ -514,7 +514,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 514 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 514 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
| 515 | 515 | ||
| 516 | /** | 516 | /** |
| 517 | * list_for_each_entry_safe_from | 517 | * list_for_each_entry_safe_from - iterate over list from current point safe against removal |
| 518 | * @pos: the type * to use as a loop cursor. | 518 | * @pos: the type * to use as a loop cursor. |
| 519 | * @n: another type * to use as temporary storage | 519 | * @n: another type * to use as temporary storage |
| 520 | * @head: the head for your list. | 520 | * @head: the head for your list. |
| @@ -529,7 +529,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 529 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 529 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
| 530 | 530 | ||
| 531 | /** | 531 | /** |
| 532 | * list_for_each_entry_safe_reverse | 532 | * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal |
| 533 | * @pos: the type * to use as a loop cursor. | 533 | * @pos: the type * to use as a loop cursor. |
| 534 | * @n: another type * to use as temporary storage | 534 | * @n: another type * to use as temporary storage |
| 535 | * @head: the head for your list. | 535 | * @head: the head for your list. |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index 94cb51a64037..8895d9d8879c 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
| @@ -26,10 +26,30 @@ int mc13783_irq_request(struct mc13783 *mc13783, int irq, | |||
| 26 | int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, | 26 | int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, |
| 27 | irq_handler_t handler, const char *name, void *dev); | 27 | irq_handler_t handler, const char *name, void *dev); |
| 28 | int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); | 28 | int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); |
| 29 | int mc13783_ackirq(struct mc13783 *mc13783, int irq); | ||
| 30 | 29 | ||
| 31 | int mc13783_mask(struct mc13783 *mc13783, int irq); | 30 | int mc13783_irq_mask(struct mc13783 *mc13783, int irq); |
| 32 | int mc13783_unmask(struct mc13783 *mc13783, int irq); | 31 | int mc13783_irq_unmask(struct mc13783 *mc13783, int irq); |
| 32 | int mc13783_irq_status(struct mc13783 *mc13783, int irq, | ||
| 33 | int *enabled, int *pending); | ||
| 34 | int mc13783_irq_ack(struct mc13783 *mc13783, int irq); | ||
| 35 | |||
| 36 | static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated; | ||
| 37 | static inline int mc13783_mask(struct mc13783 *mc13783, int irq) | ||
| 38 | { | ||
| 39 | return mc13783_irq_mask(mc13783, irq); | ||
| 40 | } | ||
| 41 | |||
| 42 | static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated; | ||
| 43 | static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) | ||
| 44 | { | ||
| 45 | return mc13783_irq_unmask(mc13783, irq); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated; | ||
| 49 | static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) | ||
| 50 | { | ||
| 51 | return mc13783_irq_ack(mc13783, irq); | ||
| 52 | } | ||
| 33 | 53 | ||
| 34 | #define MC13783_ADC0 43 | 54 | #define MC13783_ADC0 43 |
| 35 | #define MC13783_ADC0_ADREFEN (1 << 10) | 55 | #define MC13783_ADC0_ADREFEN (1 << 10) |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 90957f14195c..3899395a03de 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -870,6 +870,108 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
| 870 | */ | 870 | */ |
| 871 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | 871 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 872 | struct page **pages); | 872 | struct page **pages); |
| 873 | /* | ||
| 874 | * per-process(per-mm_struct) statistics. | ||
| 875 | */ | ||
| 876 | #if defined(SPLIT_RSS_COUNTING) | ||
| 877 | /* | ||
| 878 | * The mm counters are not protected by its page_table_lock, | ||
| 879 | * so must be incremented atomically. | ||
| 880 | */ | ||
| 881 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | ||
| 882 | { | ||
| 883 | atomic_long_set(&mm->rss_stat.count[member], value); | ||
| 884 | } | ||
| 885 | |||
| 886 | unsigned long get_mm_counter(struct mm_struct *mm, int member); | ||
| 887 | |||
| 888 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | ||
| 889 | { | ||
| 890 | atomic_long_add(value, &mm->rss_stat.count[member]); | ||
| 891 | } | ||
| 892 | |||
| 893 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | ||
| 894 | { | ||
| 895 | atomic_long_inc(&mm->rss_stat.count[member]); | ||
| 896 | } | ||
| 897 | |||
| 898 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | ||
| 899 | { | ||
| 900 | atomic_long_dec(&mm->rss_stat.count[member]); | ||
| 901 | } | ||
| 902 | |||
| 903 | #else /* !USE_SPLIT_PTLOCKS */ | ||
| 904 | /* | ||
| 905 | * The mm counters are protected by its page_table_lock, | ||
| 906 | * so can be incremented directly. | ||
| 907 | */ | ||
| 908 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | ||
| 909 | { | ||
| 910 | mm->rss_stat.count[member] = value; | ||
| 911 | } | ||
| 912 | |||
| 913 | static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) | ||
| 914 | { | ||
| 915 | return mm->rss_stat.count[member]; | ||
| 916 | } | ||
| 917 | |||
| 918 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | ||
| 919 | { | ||
| 920 | mm->rss_stat.count[member] += value; | ||
| 921 | } | ||
| 922 | |||
| 923 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | ||
| 924 | { | ||
| 925 | mm->rss_stat.count[member]++; | ||
| 926 | } | ||
| 927 | |||
| 928 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | ||
| 929 | { | ||
| 930 | mm->rss_stat.count[member]--; | ||
| 931 | } | ||
| 932 | |||
| 933 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
| 934 | |||
| 935 | static inline unsigned long get_mm_rss(struct mm_struct *mm) | ||
| 936 | { | ||
| 937 | return get_mm_counter(mm, MM_FILEPAGES) + | ||
| 938 | get_mm_counter(mm, MM_ANONPAGES); | ||
| 939 | } | ||
| 940 | |||
| 941 | static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | ||
| 942 | { | ||
| 943 | return max(mm->hiwater_rss, get_mm_rss(mm)); | ||
| 944 | } | ||
| 945 | |||
| 946 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | ||
| 947 | { | ||
| 948 | return max(mm->hiwater_vm, mm->total_vm); | ||
| 949 | } | ||
| 950 | |||
| 951 | static inline void update_hiwater_rss(struct mm_struct *mm) | ||
| 952 | { | ||
| 953 | unsigned long _rss = get_mm_rss(mm); | ||
| 954 | |||
| 955 | if ((mm)->hiwater_rss < _rss) | ||
| 956 | (mm)->hiwater_rss = _rss; | ||
| 957 | } | ||
| 958 | |||
| 959 | static inline void update_hiwater_vm(struct mm_struct *mm) | ||
| 960 | { | ||
| 961 | if (mm->hiwater_vm < mm->total_vm) | ||
| 962 | mm->hiwater_vm = mm->total_vm; | ||
| 963 | } | ||
| 964 | |||
| 965 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
| 966 | struct mm_struct *mm) | ||
| 967 | { | ||
| 968 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
| 969 | |||
| 970 | if (*maxrss < hiwater_rss) | ||
| 971 | *maxrss = hiwater_rss; | ||
| 972 | } | ||
| 973 | |||
| 974 | void sync_mm_rss(struct task_struct *task, struct mm_struct *mm); | ||
| 873 | 975 | ||
| 874 | /* | 976 | /* |
| 875 | * A callback you can register to apply pressure to ageable caches. | 977 | * A callback you can register to apply pressure to ageable caches. |
| @@ -1114,7 +1216,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma, | |||
| 1114 | 1216 | ||
| 1115 | /* mmap.c */ | 1217 | /* mmap.c */ |
| 1116 | extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin); | 1218 | extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin); |
| 1117 | extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, | 1219 | extern int vma_adjust(struct vm_area_struct *vma, unsigned long start, |
| 1118 | unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); | 1220 | unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); |
| 1119 | extern struct vm_area_struct *vma_merge(struct mm_struct *, | 1221 | extern struct vm_area_struct *vma_merge(struct mm_struct *, |
| 1120 | struct vm_area_struct *prev, unsigned long addr, unsigned long end, | 1222 | struct vm_area_struct *prev, unsigned long addr, unsigned long end, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 36f96271306c..048b46270aa5 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -24,12 +24,6 @@ struct address_space; | |||
| 24 | 24 | ||
| 25 | #define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) | 25 | #define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
| 26 | 26 | ||
| 27 | #if USE_SPLIT_PTLOCKS | ||
| 28 | typedef atomic_long_t mm_counter_t; | ||
| 29 | #else /* !USE_SPLIT_PTLOCKS */ | ||
| 30 | typedef unsigned long mm_counter_t; | ||
| 31 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
| 32 | |||
| 33 | /* | 27 | /* |
| 34 | * Each physical page in the system has a struct page associated with | 28 | * Each physical page in the system has a struct page associated with |
| 35 | * it to keep track of whatever it is we are using the page for at the | 29 | * it to keep track of whatever it is we are using the page for at the |
| @@ -169,7 +163,8 @@ struct vm_area_struct { | |||
| 169 | * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack | 163 | * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack |
| 170 | * or brk vma (with NULL file) can only be in an anon_vma list. | 164 | * or brk vma (with NULL file) can only be in an anon_vma list. |
| 171 | */ | 165 | */ |
| 172 | struct list_head anon_vma_node; /* Serialized by anon_vma->lock */ | 166 | struct list_head anon_vma_chain; /* Serialized by mmap_sem & |
| 167 | * page_table_lock */ | ||
| 173 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ | 168 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ |
| 174 | 169 | ||
| 175 | /* Function pointers to deal with this struct. */ | 170 | /* Function pointers to deal with this struct. */ |
| @@ -201,6 +196,29 @@ struct core_state { | |||
| 201 | struct completion startup; | 196 | struct completion startup; |
| 202 | }; | 197 | }; |
| 203 | 198 | ||
| 199 | enum { | ||
| 200 | MM_FILEPAGES, | ||
| 201 | MM_ANONPAGES, | ||
| 202 | MM_SWAPENTS, | ||
| 203 | NR_MM_COUNTERS | ||
| 204 | }; | ||
| 205 | |||
| 206 | #if USE_SPLIT_PTLOCKS | ||
| 207 | #define SPLIT_RSS_COUNTING | ||
| 208 | struct mm_rss_stat { | ||
| 209 | atomic_long_t count[NR_MM_COUNTERS]; | ||
| 210 | }; | ||
| 211 | /* per-thread cached information, */ | ||
| 212 | struct task_rss_stat { | ||
| 213 | int events; /* for synchronization threshold */ | ||
| 214 | int count[NR_MM_COUNTERS]; | ||
| 215 | }; | ||
| 216 | #else /* !USE_SPLIT_PTLOCKS */ | ||
| 217 | struct mm_rss_stat { | ||
| 218 | unsigned long count[NR_MM_COUNTERS]; | ||
| 219 | }; | ||
| 220 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
| 221 | |||
| 204 | struct mm_struct { | 222 | struct mm_struct { |
| 205 | struct vm_area_struct * mmap; /* list of VMAs */ | 223 | struct vm_area_struct * mmap; /* list of VMAs */ |
| 206 | struct rb_root mm_rb; | 224 | struct rb_root mm_rb; |
| @@ -227,11 +245,6 @@ struct mm_struct { | |||
| 227 | * by mmlist_lock | 245 | * by mmlist_lock |
| 228 | */ | 246 | */ |
| 229 | 247 | ||
| 230 | /* Special counters, in some configurations protected by the | ||
| 231 | * page_table_lock, in other configurations by being atomic. | ||
| 232 | */ | ||
| 233 | mm_counter_t _file_rss; | ||
| 234 | mm_counter_t _anon_rss; | ||
| 235 | 248 | ||
| 236 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ | 249 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ |
| 237 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | 250 | unsigned long hiwater_vm; /* High-water virtual memory usage */ |
| @@ -244,6 +257,12 @@ struct mm_struct { | |||
| 244 | 257 | ||
| 245 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 258 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
| 246 | 259 | ||
| 260 | /* | ||
| 261 | * Special counters, in some configurations protected by the | ||
| 262 | * page_table_lock, in other configurations by being atomic. | ||
| 263 | */ | ||
| 264 | struct mm_rss_stat rss_stat; | ||
| 265 | |||
| 247 | struct linux_binfmt *binfmt; | 266 | struct linux_binfmt *binfmt; |
| 248 | 267 | ||
| 249 | cpumask_t cpu_vm_mask; | 268 | cpumask_t cpu_vm_mask; |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 2ee22e8af110..d02d2c6e0cfe 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -99,6 +99,8 @@ struct mmc_card { | |||
| 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
| 100 | unsigned int quirks; /* card quirks */ | 100 | unsigned int quirks; /* card quirks */ |
| 101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
| 102 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | ||
| 103 | /* for byte mode */ | ||
| 102 | 104 | ||
| 103 | u32 raw_cid[4]; /* raw card CID */ | 105 | u32 raw_cid[4]; /* raw card CID */ |
| 104 | u32 raw_csd[4]; /* raw card CSD */ | 106 | u32 raw_csd[4]; /* raw card CSD */ |
| @@ -139,6 +141,11 @@ static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | |||
| 139 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | 141 | return c->quirks & MMC_QUIRK_LENIENT_FN0; |
| 140 | } | 142 | } |
| 141 | 143 | ||
| 144 | static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c) | ||
| 145 | { | ||
| 146 | return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; | ||
| 147 | } | ||
| 148 | |||
| 142 | #define mmc_card_name(c) ((c)->cid.prod_name) | 149 | #define mmc_card_name(c) ((c)->cid.prod_name) |
| 143 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 150 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
| 144 | 151 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index eaf36364b7d4..43eaf5ca5848 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | 15 | ||
| 16 | #include <linux/mmc/core.h> | 16 | #include <linux/mmc/core.h> |
| 17 | #include <linux/mmc/pm.h> | ||
| 17 | 18 | ||
| 18 | struct mmc_ios { | 19 | struct mmc_ios { |
| 19 | unsigned int clock; /* clock rate */ | 20 | unsigned int clock; /* clock rate */ |
| @@ -152,6 +153,8 @@ struct mmc_host { | |||
| 152 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | 153 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ |
| 153 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | 154 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ |
| 154 | 155 | ||
| 156 | mmc_pm_flag_t pm_caps; /* supported pm features */ | ||
| 157 | |||
| 155 | /* host specific block data */ | 158 | /* host specific block data */ |
| 156 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 159 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
| 157 | unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ | 160 | unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ |
| @@ -197,6 +200,8 @@ struct mmc_host { | |||
| 197 | struct task_struct *sdio_irq_thread; | 200 | struct task_struct *sdio_irq_thread; |
| 198 | atomic_t sdio_irq_thread_abort; | 201 | atomic_t sdio_irq_thread_abort; |
| 199 | 202 | ||
| 203 | mmc_pm_flag_t pm_flags; /* requested pm features */ | ||
| 204 | |||
| 200 | #ifdef CONFIG_LEDS_TRIGGERS | 205 | #ifdef CONFIG_LEDS_TRIGGERS |
| 201 | struct led_trigger *led; /* activity led */ | 206 | struct led_trigger *led; /* activity led */ |
| 202 | #endif | 207 | #endif |
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h new file mode 100644 index 000000000000..d37aac49cf9a --- /dev/null +++ b/include/linux/mmc/pm.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/mmc/pm.h | ||
| 3 | * | ||
| 4 | * Author: Nicolas Pitre | ||
| 5 | * Copyright: (C) 2009 Marvell Technology Group Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef LINUX_MMC_PM_H | ||
| 13 | #define LINUX_MMC_PM_H | ||
| 14 | |||
| 15 | /* | ||
| 16 | * These flags are used to describe power management features that | ||
| 17 | * some cards (typically SDIO cards) might wish to benefit from when | ||
| 18 | * the host system is being suspended. There are several layers of | ||
| 19 | * abstractions involved, from the host controller driver, to the MMC core | ||
| 20 | * code, to the SDIO core code, to finally get to the actual SDIO function | ||
| 21 | * driver. This file is therefore used for common definitions shared across | ||
| 22 | * all those layers. | ||
| 23 | */ | ||
| 24 | |||
| 25 | typedef unsigned int mmc_pm_flag_t; | ||
| 26 | |||
| 27 | #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ | ||
| 28 | #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ | ||
| 29 | |||
| 30 | #endif | ||
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 47ba464f5170..0ebaef577ff5 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
| @@ -95,6 +95,8 @@ | |||
| 95 | #define SDIO_BUS_WIDTH_1BIT 0x00 | 95 | #define SDIO_BUS_WIDTH_1BIT 0x00 |
| 96 | #define SDIO_BUS_WIDTH_4BIT 0x02 | 96 | #define SDIO_BUS_WIDTH_4BIT 0x02 |
| 97 | 97 | ||
| 98 | #define SDIO_BUS_ASYNC_INT 0x20 | ||
| 99 | |||
| 98 | #define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */ | 100 | #define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */ |
| 99 | 101 | ||
| 100 | #define SDIO_CCCR_CAPS 0x08 | 102 | #define SDIO_CCCR_CAPS 0x08 |
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index ac3ab683fec6..c6c0cceba5fe 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
| 16 | #include <linux/mod_devicetable.h> | 16 | #include <linux/mod_devicetable.h> |
| 17 | 17 | ||
| 18 | #include <linux/mmc/pm.h> | ||
| 19 | |||
| 18 | struct mmc_card; | 20 | struct mmc_card; |
| 19 | struct sdio_func; | 21 | struct sdio_func; |
| 20 | 22 | ||
| @@ -153,5 +155,8 @@ extern unsigned char sdio_f0_readb(struct sdio_func *func, | |||
| 153 | extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b, | 155 | extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b, |
| 154 | unsigned int addr, int *err_ret); | 156 | unsigned int addr, int *err_ret); |
| 155 | 157 | ||
| 158 | extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); | ||
| 159 | extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); | ||
| 160 | |||
| 156 | #endif | 161 | #endif |
| 157 | 162 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a01a103341bd..bc209d8b7b5c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -306,6 +306,7 @@ struct zone { | |||
| 306 | * free areas of different sizes | 306 | * free areas of different sizes |
| 307 | */ | 307 | */ |
| 308 | spinlock_t lock; | 308 | spinlock_t lock; |
| 309 | int all_unreclaimable; /* All pages pinned */ | ||
| 309 | #ifdef CONFIG_MEMORY_HOTPLUG | 310 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 310 | /* see spanned/present_pages for more description */ | 311 | /* see spanned/present_pages for more description */ |
| 311 | seqlock_t span_seqlock; | 312 | seqlock_t span_seqlock; |
| @@ -417,7 +418,6 @@ struct zone { | |||
| 417 | } ____cacheline_internodealigned_in_smp; | 418 | } ____cacheline_internodealigned_in_smp; |
| 418 | 419 | ||
| 419 | typedef enum { | 420 | typedef enum { |
| 420 | ZONE_ALL_UNRECLAIMABLE, /* all pages pinned */ | ||
| 421 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ | 421 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ |
| 422 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ | 422 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ |
| 423 | } zone_flags_t; | 423 | } zone_flags_t; |
| @@ -437,11 +437,6 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag) | |||
| 437 | clear_bit(flag, &zone->flags); | 437 | clear_bit(flag, &zone->flags); |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | static inline int zone_is_all_unreclaimable(const struct zone *zone) | ||
| 441 | { | ||
| 442 | return test_bit(ZONE_ALL_UNRECLAIMABLE, &zone->flags); | ||
| 443 | } | ||
| 444 | |||
| 445 | static inline int zone_is_reclaim_locked(const struct zone *zone) | 440 | static inline int zone_is_reclaim_locked(const struct zone *zone) |
| 446 | { | 441 | { |
| 447 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); | 442 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 454997cccbd8..c4fa64b585ff 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -69,8 +69,6 @@ | |||
| 69 | * int node_online(node) Is some node online? | 69 | * int node_online(node) Is some node online? |
| 70 | * int node_possible(node) Is some node possible? | 70 | * int node_possible(node) Is some node possible? |
| 71 | * | 71 | * |
| 72 | * int any_online_node(mask) First online node in mask | ||
| 73 | * | ||
| 74 | * node_set_online(node) set bit 'node' in node_online_map | 72 | * node_set_online(node) set bit 'node' in node_online_map |
| 75 | * node_set_offline(node) clear bit 'node' in node_online_map | 73 | * node_set_offline(node) clear bit 'node' in node_online_map |
| 76 | * | 74 | * |
| @@ -467,15 +465,6 @@ static inline int num_node_state(enum node_states state) | |||
| 467 | #define node_online_map node_states[N_ONLINE] | 465 | #define node_online_map node_states[N_ONLINE] |
| 468 | #define node_possible_map node_states[N_POSSIBLE] | 466 | #define node_possible_map node_states[N_POSSIBLE] |
| 469 | 467 | ||
| 470 | #define any_online_node(mask) \ | ||
| 471 | ({ \ | ||
| 472 | int node; \ | ||
| 473 | for_each_node_mask(node, (mask)) \ | ||
| 474 | if (node_online(node)) \ | ||
| 475 | break; \ | ||
| 476 | node; \ | ||
| 477 | }) | ||
| 478 | |||
| 479 | #define num_online_nodes() num_node_state(N_ONLINE) | 468 | #define num_online_nodes() num_node_state(N_ONLINE) |
| 480 | #define num_possible_nodes() num_node_state(N_POSSIBLE) | 469 | #define num_possible_nodes() num_node_state(N_POSSIBLE) |
| 481 | #define node_online(node) node_state((node), N_ONLINE) | 470 | #define node_online(node) node_state((node), N_ONLINE) |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index b019ae64e2ab..d25bd224d370 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -37,7 +37,27 @@ struct anon_vma { | |||
| 37 | * is serialized by a system wide lock only visible to | 37 | * is serialized by a system wide lock only visible to |
| 38 | * mm_take_all_locks() (mm_all_locks_mutex). | 38 | * mm_take_all_locks() (mm_all_locks_mutex). |
| 39 | */ | 39 | */ |
| 40 | struct list_head head; /* List of private "related" vmas */ | 40 | struct list_head head; /* Chain of private "related" vmas */ |
| 41 | }; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * The copy-on-write semantics of fork mean that an anon_vma | ||
| 45 | * can become associated with multiple processes. Furthermore, | ||
| 46 | * each child process will have its own anon_vma, where new | ||
| 47 | * pages for that process are instantiated. | ||
| 48 | * | ||
| 49 | * This structure allows us to find the anon_vmas associated | ||
| 50 | * with a VMA, or the VMAs associated with an anon_vma. | ||
| 51 | * The "same_vma" list contains the anon_vma_chains linking | ||
| 52 | * all the anon_vmas associated with this VMA. | ||
| 53 | * The "same_anon_vma" list contains the anon_vma_chains | ||
| 54 | * which link all the VMAs associated with this anon_vma. | ||
| 55 | */ | ||
| 56 | struct anon_vma_chain { | ||
| 57 | struct vm_area_struct *vma; | ||
| 58 | struct anon_vma *anon_vma; | ||
| 59 | struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ | ||
| 60 | struct list_head same_anon_vma; /* locked by anon_vma->lock */ | ||
| 41 | }; | 61 | }; |
| 42 | 62 | ||
| 43 | #ifdef CONFIG_MMU | 63 | #ifdef CONFIG_MMU |
| @@ -89,15 +109,23 @@ static inline void anon_vma_unlock(struct vm_area_struct *vma) | |||
| 89 | */ | 109 | */ |
| 90 | void anon_vma_init(void); /* create anon_vma_cachep */ | 110 | void anon_vma_init(void); /* create anon_vma_cachep */ |
| 91 | int anon_vma_prepare(struct vm_area_struct *); | 111 | int anon_vma_prepare(struct vm_area_struct *); |
| 92 | void __anon_vma_merge(struct vm_area_struct *, struct vm_area_struct *); | 112 | void unlink_anon_vmas(struct vm_area_struct *); |
| 93 | void anon_vma_unlink(struct vm_area_struct *); | 113 | int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *); |
| 94 | void anon_vma_link(struct vm_area_struct *); | 114 | int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *); |
| 95 | void __anon_vma_link(struct vm_area_struct *); | 115 | void __anon_vma_link(struct vm_area_struct *); |
| 96 | void anon_vma_free(struct anon_vma *); | 116 | void anon_vma_free(struct anon_vma *); |
| 97 | 117 | ||
| 118 | static inline void anon_vma_merge(struct vm_area_struct *vma, | ||
| 119 | struct vm_area_struct *next) | ||
| 120 | { | ||
| 121 | VM_BUG_ON(vma->anon_vma != next->anon_vma); | ||
| 122 | unlink_anon_vmas(next); | ||
| 123 | } | ||
| 124 | |||
| 98 | /* | 125 | /* |
| 99 | * rmap interfaces called when adding or removing pte of page | 126 | * rmap interfaces called when adding or removing pte of page |
| 100 | */ | 127 | */ |
| 128 | void page_move_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | ||
| 101 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 129 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
| 102 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 130 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
| 103 | void page_add_file_rmap(struct page *); | 131 | void page_add_file_rmap(struct page *); |
| @@ -181,7 +209,7 @@ static inline int page_referenced(struct page *page, int is_locked, | |||
| 181 | unsigned long *vm_flags) | 209 | unsigned long *vm_flags) |
| 182 | { | 210 | { |
| 183 | *vm_flags = 0; | 211 | *vm_flags = 0; |
| 184 | return TestClearPageReferenced(page); | 212 | return 0; |
| 185 | } | 213 | } |
| 186 | 214 | ||
| 187 | #define try_to_unmap(page, refs) SWAP_FAIL | 215 | #define try_to_unmap(page, refs) SWAP_FAIL |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4b1753f7e48e..46c6f8d5dc06 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -396,60 +396,6 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
| 396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | 396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} |
| 397 | #endif | 397 | #endif |
| 398 | 398 | ||
| 399 | #if USE_SPLIT_PTLOCKS | ||
| 400 | /* | ||
| 401 | * The mm counters are not protected by its page_table_lock, | ||
| 402 | * so must be incremented atomically. | ||
| 403 | */ | ||
| 404 | #define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value) | ||
| 405 | #define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member)) | ||
| 406 | #define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member) | ||
| 407 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) | ||
| 408 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) | ||
| 409 | |||
| 410 | #else /* !USE_SPLIT_PTLOCKS */ | ||
| 411 | /* | ||
| 412 | * The mm counters are protected by its page_table_lock, | ||
| 413 | * so can be incremented directly. | ||
| 414 | */ | ||
| 415 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) | ||
| 416 | #define get_mm_counter(mm, member) ((mm)->_##member) | ||
| 417 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) | ||
| 418 | #define inc_mm_counter(mm, member) (mm)->_##member++ | ||
| 419 | #define dec_mm_counter(mm, member) (mm)->_##member-- | ||
| 420 | |||
| 421 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
| 422 | |||
| 423 | #define get_mm_rss(mm) \ | ||
| 424 | (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) | ||
| 425 | #define update_hiwater_rss(mm) do { \ | ||
| 426 | unsigned long _rss = get_mm_rss(mm); \ | ||
| 427 | if ((mm)->hiwater_rss < _rss) \ | ||
| 428 | (mm)->hiwater_rss = _rss; \ | ||
| 429 | } while (0) | ||
| 430 | #define update_hiwater_vm(mm) do { \ | ||
| 431 | if ((mm)->hiwater_vm < (mm)->total_vm) \ | ||
| 432 | (mm)->hiwater_vm = (mm)->total_vm; \ | ||
| 433 | } while (0) | ||
| 434 | |||
| 435 | static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | ||
| 436 | { | ||
| 437 | return max(mm->hiwater_rss, get_mm_rss(mm)); | ||
| 438 | } | ||
| 439 | |||
| 440 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
| 441 | struct mm_struct *mm) | ||
| 442 | { | ||
| 443 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
| 444 | |||
| 445 | if (*maxrss < hiwater_rss) | ||
| 446 | *maxrss = hiwater_rss; | ||
| 447 | } | ||
| 448 | |||
| 449 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | ||
| 450 | { | ||
| 451 | return max(mm->hiwater_vm, mm->total_vm); | ||
| 452 | } | ||
| 453 | 399 | ||
| 454 | extern void set_dumpable(struct mm_struct *mm, int value); | 400 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 455 | extern int get_dumpable(struct mm_struct *mm); | 401 | extern int get_dumpable(struct mm_struct *mm); |
| @@ -1274,7 +1220,9 @@ struct task_struct { | |||
| 1274 | struct plist_node pushable_tasks; | 1220 | struct plist_node pushable_tasks; |
| 1275 | 1221 | ||
| 1276 | struct mm_struct *mm, *active_mm; | 1222 | struct mm_struct *mm, *active_mm; |
| 1277 | 1223 | #if defined(SPLIT_RSS_COUNTING) | |
| 1224 | struct task_rss_stat rss_stat; | ||
| 1225 | #endif | ||
| 1278 | /* task state */ | 1226 | /* task state */ |
| 1279 | int exit_state; | 1227 | int exit_state; |
| 1280 | int exit_code, exit_signal; | 1228 | int exit_code, exit_signal; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 7a0570e6a596..cfa2d20e35f1 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -154,7 +154,7 @@ smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | |||
| 154 | /* | 154 | /* |
| 155 | * smp_processor_id(): get the current CPU ID. | 155 | * smp_processor_id(): get the current CPU ID. |
| 156 | * | 156 | * |
| 157 | * if DEBUG_PREEMPT is enabled the we check whether it is | 157 | * if DEBUG_PREEMPT is enabled then we check whether it is |
| 158 | * used in a preemption-safe way. (smp_processor_id() is safe | 158 | * used in a preemption-safe way. (smp_processor_id() is safe |
| 159 | * if it's used in a preemption-off critical section, or in | 159 | * if it's used in a preemption-off critical section, or in |
| 160 | * a thread that is bound to the current CPU.) | 160 | * a thread that is bound to the current CPU.) |
diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h index 6dfd83f19b4b..34af0a3477bf 100644 --- a/include/linux/spi/max7301.h +++ b/include/linux/spi/max7301.h | |||
| @@ -1,9 +1,27 @@ | |||
| 1 | #ifndef LINUX_SPI_MAX7301_H | 1 | #ifndef LINUX_SPI_MAX7301_H |
| 2 | #define LINUX_SPI_MAX7301_H | 2 | #define LINUX_SPI_MAX7301_H |
| 3 | 3 | ||
| 4 | #include <linux/gpio.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * Some registers must be read back to modify. | ||
| 8 | * To save time we cache them here in memory | ||
| 9 | */ | ||
| 10 | struct max7301 { | ||
| 11 | struct mutex lock; | ||
| 12 | u8 port_config[8]; /* field 0 is unused */ | ||
| 13 | u32 out_level; /* cached output levels */ | ||
| 14 | struct gpio_chip chip; | ||
| 15 | struct device *dev; | ||
| 16 | int (*write)(struct device *dev, unsigned int reg, unsigned int val); | ||
| 17 | int (*read)(struct device *dev, unsigned int reg); | ||
| 18 | }; | ||
| 19 | |||
| 4 | struct max7301_platform_data { | 20 | struct max7301_platform_data { |
| 5 | /* number assigned to the first GPIO */ | 21 | /* number assigned to the first GPIO */ |
| 6 | unsigned base; | 22 | unsigned base; |
| 7 | }; | 23 | }; |
| 8 | 24 | ||
| 25 | extern int __max730x_remove(struct device *dev); | ||
| 26 | extern int __max730x_probe(struct max7301 *ts); | ||
| 9 | #endif | 27 | #endif |
