diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/crypto.h | 6 | ||||
| -rw-r--r-- | include/linux/device.h | 8 | ||||
| -rw-r--r-- | include/linux/i2c.h | 4 | ||||
| -rw-r--r-- | include/linux/of_device.h | 4 | ||||
| -rw-r--r-- | include/linux/of_fdt.h | 4 | ||||
| -rw-r--r-- | include/linux/of_platform.h | 6 | ||||
| -rw-r--r-- | include/linux/slab_def.h | 24 | ||||
| -rw-r--r-- | include/linux/slob_def.h | 8 | ||||
| -rw-r--r-- | include/linux/slub_def.h | 8 |
9 files changed, 61 insertions, 11 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 24d2e30f1b46..a6a7a1c83f54 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
| @@ -99,13 +99,7 @@ | |||
| 99 | * as arm where pointers are 32-bit aligned but there are data types such as | 99 | * as arm where pointers are 32-bit aligned but there are data types such as |
| 100 | * u64 which require 64-bit alignment. | 100 | * u64 which require 64-bit alignment. |
| 101 | */ | 101 | */ |
| 102 | #if defined(ARCH_KMALLOC_MINALIGN) | ||
| 103 | #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN | 102 | #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN |
| 104 | #elif defined(ARCH_SLAB_MINALIGN) | ||
| 105 | #define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN | ||
| 106 | #else | ||
| 107 | #define CRYPTO_MINALIGN __alignof__(unsigned long long) | ||
| 108 | #endif | ||
| 109 | 103 | ||
| 110 | #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN))) | 104 | #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN))) |
| 111 | 105 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 7bb9f426f3e6..0713e10571dd 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -33,6 +33,7 @@ struct class; | |||
| 33 | struct class_private; | 33 | struct class_private; |
| 34 | struct bus_type; | 34 | struct bus_type; |
| 35 | struct bus_type_private; | 35 | struct bus_type_private; |
| 36 | struct device_node; | ||
| 36 | 37 | ||
| 37 | struct bus_attribute { | 38 | struct bus_attribute { |
| 38 | struct attribute attr; | 39 | struct attribute attr; |
| @@ -127,6 +128,10 @@ struct device_driver { | |||
| 127 | 128 | ||
| 128 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ | 129 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ |
| 129 | 130 | ||
| 131 | #if defined(CONFIG_OF) | ||
| 132 | const struct of_device_id *of_match_table; | ||
| 133 | #endif | ||
| 134 | |||
| 130 | int (*probe) (struct device *dev); | 135 | int (*probe) (struct device *dev); |
| 131 | int (*remove) (struct device *dev); | 136 | int (*remove) (struct device *dev); |
| 132 | void (*shutdown) (struct device *dev); | 137 | void (*shutdown) (struct device *dev); |
| @@ -435,6 +440,9 @@ struct device { | |||
| 435 | override */ | 440 | override */ |
| 436 | /* arch specific additions */ | 441 | /* arch specific additions */ |
| 437 | struct dev_archdata archdata; | 442 | struct dev_archdata archdata; |
| 443 | #ifdef CONFIG_OF | ||
| 444 | struct device_node *of_node; | ||
| 445 | #endif | ||
| 438 | 446 | ||
| 439 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 447 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 440 | 448 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 6ed1d59bfb1e..21067b418536 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/device.h> /* for struct device */ | 34 | #include <linux/device.h> /* for struct device */ |
| 35 | #include <linux/sched.h> /* for completion */ | 35 | #include <linux/sched.h> /* for completion */ |
| 36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
| 37 | #include <linux/of.h> /* for struct device_node */ | ||
| 37 | 38 | ||
| 38 | extern struct bus_type i2c_bus_type; | 39 | extern struct bus_type i2c_bus_type; |
| 39 | 40 | ||
| @@ -251,6 +252,9 @@ struct i2c_board_info { | |||
| 251 | unsigned short addr; | 252 | unsigned short addr; |
| 252 | void *platform_data; | 253 | void *platform_data; |
| 253 | struct dev_archdata *archdata; | 254 | struct dev_archdata *archdata; |
| 255 | #ifdef CONFIG_OF | ||
| 256 | struct device_node *of_node; | ||
| 257 | #endif | ||
| 254 | int irq; | 258 | int irq; |
| 255 | }; | 259 | }; |
| 256 | 260 | ||
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index d3a74e00a3e1..11651facc5f1 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_OF_DEVICE_H | 1 | #ifndef _LINUX_OF_DEVICE_H |
| 2 | #define _LINUX_OF_DEVICE_H | 2 | #define _LINUX_OF_DEVICE_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_OF_DEVICE | ||
| 4 | #include <linux/device.h> | 5 | #include <linux/device.h> |
| 5 | #include <linux/of.h> | 6 | #include <linux/of.h> |
| 6 | #include <linux/mod_devicetable.h> | 7 | #include <linux/mod_devicetable.h> |
| @@ -10,7 +11,7 @@ | |||
| 10 | #define to_of_device(d) container_of(d, struct of_device, dev) | 11 | #define to_of_device(d) container_of(d, struct of_device, dev) |
| 11 | 12 | ||
| 12 | extern const struct of_device_id *of_match_device( | 13 | extern const struct of_device_id *of_match_device( |
| 13 | const struct of_device_id *matches, const struct of_device *dev); | 14 | const struct of_device_id *matches, const struct device *dev); |
| 14 | 15 | ||
| 15 | extern struct of_device *of_dev_get(struct of_device *dev); | 16 | extern struct of_device *of_dev_get(struct of_device *dev); |
| 16 | extern void of_dev_put(struct of_device *dev); | 17 | extern void of_dev_put(struct of_device *dev); |
| @@ -26,5 +27,6 @@ static inline void of_device_free(struct of_device *dev) | |||
| 26 | 27 | ||
| 27 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, |
| 28 | char *str, ssize_t len); | 29 | char *str, ssize_t len); |
| 30 | #endif /* CONFIG_OF_DEVICE */ | ||
| 29 | 31 | ||
| 30 | #endif /* _LINUX_OF_DEVICE_H */ | 32 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index a1ca92ccb0ff..71e1a916d3fa 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -57,6 +57,7 @@ struct boot_param_header { | |||
| 57 | __be32 dt_struct_size; /* size of the DT structure block */ | 57 | __be32 dt_struct_size; /* size of the DT structure block */ |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | #if defined(CONFIG_OF_FLATTREE) | ||
| 60 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ | 61 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ |
| 61 | extern int __initdata dt_root_addr_cells; | 62 | extern int __initdata dt_root_addr_cells; |
| 62 | extern int __initdata dt_root_size_cells; | 63 | extern int __initdata dt_root_size_cells; |
| @@ -98,6 +99,9 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, | |||
| 98 | /* Other Prototypes */ | 99 | /* Other Prototypes */ |
| 99 | extern void unflatten_device_tree(void); | 100 | extern void unflatten_device_tree(void); |
| 100 | extern void early_init_devtree(void *); | 101 | extern void early_init_devtree(void *); |
| 102 | #else /* CONFIG_OF_FLATTREE */ | ||
| 103 | static inline void unflatten_device_tree(void) {} | ||
| 104 | #endif /* CONFIG_OF_FLATTREE */ | ||
| 101 | 105 | ||
| 102 | #endif /* __ASSEMBLY__ */ | 106 | #endif /* __ASSEMBLY__ */ |
| 103 | #endif /* _LINUX_OF_FDT_H */ | 107 | #endif /* _LINUX_OF_FDT_H */ |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 908406651330..1643d3761eb4 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * | 11 | * |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #ifdef CONFIG_OF_DEVICE | ||
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 16 | #include <linux/mod_devicetable.h> | 17 | #include <linux/mod_devicetable.h> |
| @@ -30,10 +31,6 @@ extern struct bus_type of_platform_bus_type; | |||
| 30 | */ | 31 | */ |
| 31 | struct of_platform_driver | 32 | struct of_platform_driver |
| 32 | { | 33 | { |
| 33 | const char *name; | ||
| 34 | const struct of_device_id *match_table; | ||
| 35 | struct module *owner; | ||
| 36 | |||
| 37 | int (*probe)(struct of_device* dev, | 34 | int (*probe)(struct of_device* dev, |
| 38 | const struct of_device_id *match); | 35 | const struct of_device_id *match); |
| 39 | int (*remove)(struct of_device* dev); | 36 | int (*remove)(struct of_device* dev); |
| @@ -66,5 +63,6 @@ static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | |||
| 66 | extern struct of_device *of_find_device_by_node(struct device_node *np); | 63 | extern struct of_device *of_find_device_by_node(struct device_node *np); |
| 67 | 64 | ||
| 68 | extern int of_bus_type_init(struct bus_type *bus, const char *name); | 65 | extern int of_bus_type_init(struct bus_type *bus, const char *name); |
| 66 | #endif /* CONFIG_OF_DEVICE */ | ||
| 69 | 67 | ||
| 70 | #endif /* _LINUX_OF_PLATFORM_H */ | 68 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index ca6b2b317991..1812dac8c496 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -16,6 +16,30 @@ | |||
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <linux/kmemtrace.h> | 17 | #include <linux/kmemtrace.h> |
| 18 | 18 | ||
| 19 | #ifndef ARCH_KMALLOC_MINALIGN | ||
| 20 | /* | ||
| 21 | * Enforce a minimum alignment for the kmalloc caches. | ||
| 22 | * Usually, the kmalloc caches are cache_line_size() aligned, except when | ||
| 23 | * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned. | ||
| 24 | * Some archs want to perform DMA into kmalloc caches and need a guaranteed | ||
| 25 | * alignment larger than the alignment of a 64-bit integer. | ||
| 26 | * ARCH_KMALLOC_MINALIGN allows that. | ||
| 27 | * Note that increasing this value may disable some debug features. | ||
| 28 | */ | ||
| 29 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #ifndef ARCH_SLAB_MINALIGN | ||
| 33 | /* | ||
| 34 | * Enforce a minimum alignment for all caches. | ||
| 35 | * Intended for archs that get misalignment faults even for BYTES_PER_WORD | ||
| 36 | * aligned buffers. Includes ARCH_KMALLOC_MINALIGN. | ||
| 37 | * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables | ||
| 38 | * some debug features. | ||
| 39 | */ | ||
| 40 | #define ARCH_SLAB_MINALIGN 0 | ||
| 41 | #endif | ||
| 42 | |||
| 19 | /* | 43 | /* |
| 20 | * struct kmem_cache | 44 | * struct kmem_cache |
| 21 | * | 45 | * |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index 0ec00b39d006..62667f72c2ef 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
| @@ -1,6 +1,14 @@ | |||
| 1 | #ifndef __LINUX_SLOB_DEF_H | 1 | #ifndef __LINUX_SLOB_DEF_H |
| 2 | #define __LINUX_SLOB_DEF_H | 2 | #define __LINUX_SLOB_DEF_H |
| 3 | 3 | ||
| 4 | #ifndef ARCH_KMALLOC_MINALIGN | ||
| 5 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long) | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #ifndef ARCH_SLAB_MINALIGN | ||
| 9 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long) | ||
| 10 | #endif | ||
| 11 | |||
| 4 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 12 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 5 | 13 | ||
| 6 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, | 14 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 0249d4175bac..55695c8d2f8a 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -116,6 +116,14 @@ struct kmem_cache { | |||
| 116 | 116 | ||
| 117 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) | 117 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) |
| 118 | 118 | ||
| 119 | #ifndef ARCH_KMALLOC_MINALIGN | ||
| 120 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
| 121 | #endif | ||
| 122 | |||
| 123 | #ifndef ARCH_SLAB_MINALIGN | ||
| 124 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) | ||
| 125 | #endif | ||
| 126 | |||
| 119 | /* | 127 | /* |
| 120 | * Maximum kmalloc object size handled by SLUB. Larger object allocations | 128 | * Maximum kmalloc object size handled by SLUB. Larger object allocations |
| 121 | * are passed through to the page allocator. The page allocator "fastpath" | 129 | * are passed through to the page allocator. The page allocator "fastpath" |
