diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dmi.h | 3 | ||||
-rw-r--r-- | include/linux/enclosure.h | 129 | ||||
-rw-r--r-- | include/linux/hrtimer.h | 5 | ||||
-rw-r--r-- | include/linux/i2c-id.h | 36 | ||||
-rw-r--r-- | include/linux/ktime.h | 3 | ||||
-rw-r--r-- | include/linux/mm_types.h | 5 | ||||
-rw-r--r-- | include/linux/slub_def.h | 23 |
7 files changed, 165 insertions, 39 deletions
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index b1251b2..bbc9992 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -79,6 +79,7 @@ extern void dmi_scan_machine(void); extern int dmi_get_year(int field); extern int dmi_name_in_vendors(const char *str); extern int dmi_available; +extern int dmi_walk(void (*decode)(const struct dmi_header *)); #else @@ -89,6 +90,8 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na static inline int dmi_get_year(int year) { return 0; } static inline int dmi_name_in_vendors(const char *s) { return 0; } #define dmi_available 0 +static inline int dmi_walk(void (*decode)(const struct dmi_header *)) + { return -1; } #endif diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h new file mode 100644 index 0000000..a5978f1 --- /dev/null +++ b/include/linux/enclosure.h @@ -0,0 +1,129 @@ +/* + * Enclosure Services + * + * Copyright (C) 2008 James Bottomley <James.Bottomley@HansenPartnership.com> + * +**----------------------------------------------------------------------------- +** +** 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +*/ +#ifndef _LINUX_ENCLOSURE_H_ +#define _LINUX_ENCLOSURE_H_ + +#include <linux/device.h> +#include <linux/list.h> + +/* A few generic types ... taken from ses-2 */ +enum enclosure_component_type { + ENCLOSURE_COMPONENT_DEVICE = 0x01, + ENCLOSURE_COMPONENT_ARRAY_DEVICE = 0x17, +}; + +/* ses-2 common element status */ +enum enclosure_status { + ENCLOSURE_STATUS_UNSUPPORTED = 0, + ENCLOSURE_STATUS_OK, + ENCLOSURE_STATUS_CRITICAL, + ENCLOSURE_STATUS_NON_CRITICAL, + ENCLOSURE_STATUS_UNRECOVERABLE, + ENCLOSURE_STATUS_NOT_INSTALLED, + ENCLOSURE_STATUS_UNKNOWN, + ENCLOSURE_STATUS_UNAVAILABLE, +}; + +/* SFF-8485 activity light settings */ +enum enclosure_component_setting { + ENCLOSURE_SETTING_DISABLED = 0, + ENCLOSURE_SETTING_ENABLED = 1, + ENCLOSURE_SETTING_BLINK_A_ON_OFF = 2, + ENCLOSURE_SETTING_BLINK_A_OFF_ON = 3, + ENCLOSURE_SETTING_BLINK_B_ON_OFF = 6, + ENCLOSURE_SETTING_BLINK_B_OFF_ON = 7, +}; + +struct enclosure_device; +struct enclosure_component; +struct enclosure_component_callbacks { + void (*get_status)(struct enclosure_device *, + struct enclosure_component *); + int (*set_status)(struct enclosure_device *, + struct enclosure_component *, + enum enclosure_status); + void (*get_fault)(struct enclosure_device *, + struct enclosure_component *); + int (*set_fault)(struct enclosure_device *, + struct enclosure_component *, + enum enclosure_component_setting); + void (*get_active)(struct enclosure_device *, + struct enclosure_component *); + int (*set_active)(struct enclosure_device *, + struct enclosure_component *, + enum enclosure_component_setting); + void (*get_locate)(struct enclosure_device *, + struct enclosure_component *); + int (*set_locate)(struct enclosure_device *, + struct enclosure_component *, + enum enclosure_component_setting); +}; + + +struct enclosure_component { + void *scratch; + struct class_device cdev; + enum enclosure_component_type type; + int number; + int fault; + int active; + int locate; + enum enclosure_status status; +}; + +struct enclosure_device { + void *scratch; + struct list_head node; + struct class_device cdev; + struct enclosure_component_callbacks *cb; + int components; + struct enclosure_component component[0]; +}; + +static inline struct enclosure_device * +to_enclosure_device(struct class_device *dev) +{ + return container_of(dev, struct enclosure_device, cdev); +} + +static inline struct enclosure_component * +to_enclosure_component(struct class_device *dev) +{ + return container_of(dev, struct enclosure_component, cdev); +} + +struct enclosure_device * +enclosure_register(struct device *, const char *, int, + struct enclosure_component_callbacks *); +void enclosure_unregister(struct enclosure_device *); +struct enclosure_component * +enclosure_component_register(struct enclosure_device *, unsigned int, + enum enclosure_component_type, const char *); +int enclosure_add_device(struct enclosure_device *enclosure, int component, + struct device *dev); +int enclosure_remove_device(struct enclosure_device *enclosure, int component); +struct enclosure_device *enclosure_find(struct device *dev); +int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), + void *data); + +#endif /* _LINUX_ENCLOSURE_H_ */ diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 8371b66..203591e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -225,11 +225,14 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) * idea of the (in)accuracy of timers. Timer values are rounded up to * this resolution values. */ -# define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } +# define HIGH_RES_NSEC 1 +# define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC } +# define MONOTONIC_RES_NSEC HIGH_RES_NSEC # define KTIME_MONOTONIC_RES KTIME_HIGH_RES #else +# define MONOTONIC_RES_NSEC LOW_RES_NSEC # define KTIME_MONOTONIC_RES KTIME_LOW_RES /* diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index f922b06..b979112 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -96,42 +96,6 @@ #define I2C_DRIVERID_I2CDEV 900 -/* IDs -- Use DRIVERIDs 1000-1999 for sensors. - These were originally in sensors.h in the lm_sensors package */ -#define I2C_DRIVERID_LM78 1002 -#define I2C_DRIVERID_LM75 1003 -#define I2C_DRIVERID_GL518 1004 -#define I2C_DRIVERID_EEPROM 1005 -#define I2C_DRIVERID_W83781D 1006 -#define I2C_DRIVERID_LM80 1007 -#define I2C_DRIVERID_ADM1021 1008 -#define I2C_DRIVERID_ADM9240 1009 -#define I2C_DRIVERID_LTC1710 1010 -#define I2C_DRIVERID_BT869 1013 -#define I2C_DRIVERID_MAXILIFE 1014 -#define I2C_DRIVERID_MATORB 1015 -#define I2C_DRIVERID_GL520 1016 -#define I2C_DRIVERID_THMC50 1017 -#define I2C_DRIVERID_ADM1025 1020 -#define I2C_DRIVERID_LM87 1021 -#define I2C_DRIVERID_PCF8574 1022 -#define I2C_DRIVERID_MTP008 1023 -#define I2C_DRIVERID_DS1621 1024 -#define I2C_DRIVERID_ADM1024 1025 -#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */ -#define I2C_DRIVERID_FSCPOS 1028 -#define I2C_DRIVERID_FSCSCY 1029 -#define I2C_DRIVERID_PCF8591 1030 -#define I2C_DRIVERID_LM92 1033 -#define I2C_DRIVERID_SMARTBATT 1035 -#define I2C_DRIVERID_BMCSENSORS 1036 -#define I2C_DRIVERID_FS451 1037 -#define I2C_DRIVERID_LM85 1039 -#define I2C_DRIVERID_LM83 1040 -#define I2C_DRIVERID_LM90 1042 -#define I2C_DRIVERID_ASB100 1043 -#define I2C_DRIVERID_FSCHER 1046 -#define I2C_DRIVERID_W83L785TS 1047 #define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ /* diff --git a/include/linux/ktime.h b/include/linux/ktime.h index a6ddec1..36c542b 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -316,7 +316,8 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) * idea of the (in)accuracy of timers. Timer values are rounded up to * this resolution values. */ -#define KTIME_LOW_RES (ktime_t){ .tv64 = TICK_NSEC } +#define LOW_RES_NSEC TICK_NSEC +#define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC } /* Get the monotonic time in timespec format: */ extern void ktime_get_ts(struct timespec *ts); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 34023c6..bfee0bd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -64,7 +64,10 @@ struct page { #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS spinlock_t ptl; #endif - struct kmem_cache *slab; /* SLUB: Pointer to slab */ + struct { + struct kmem_cache *slab; /* SLUB: Pointer to slab */ + void *end; /* SLUB: end marker */ + }; struct page *first_page; /* Compound tail pages */ }; union { diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index ddb1a70..5e6d3d6 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -11,12 +11,35 @@ #include <linux/workqueue.h> #include <linux/kobject.h> +enum stat_item { + ALLOC_FASTPATH, /* Allocation from cpu slab */ + ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ + FREE_FASTPATH, /* Free to cpu slub */ + FREE_SLOWPATH, /* Freeing not to cpu slab */ + FREE_FROZEN, /* Freeing to frozen slab */ + FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ + FREE_REMOVE_PARTIAL, /* Freeing removes last object */ + ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ + ALLOC_SLAB, /* Cpu slab acquired from page allocator */ + ALLOC_REFILL, /* Refill cpu slab from slab freelist */ + FREE_SLAB, /* Slab freed to the page allocator */ + CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ + DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ + DEACTIVATE_EMPTY, /* Cpu slab was empty when deactivated */ + DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ + DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ + DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ + NR_SLUB_STAT_ITEMS }; + struct kmem_cache_cpu { void **freelist; /* Pointer to first free per cpu object */ struct page *page; /* The slab from which we are allocating */ int node; /* The node of the page (or -1 for debug) */ unsigned int offset; /* Freepointer offset (in word units) */ unsigned int objsize; /* Size of an object (from kmem_cache) */ +#ifdef CONFIG_SLUB_STATS + unsigned stat[NR_SLUB_STAT_ITEMS]; +#endif }; struct kmem_cache_node { |