diff options
Diffstat (limited to 'include/linux')
157 files changed, 2695 insertions, 1696 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 9363122..5cae9b5 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -18,7 +18,6 @@ header-y += usb/ header-y += affs_hardblocks.h header-y += aio_abi.h -header-y += a.out.h header-y += arcfb.h header-y += atmapi.h header-y += atmbr2684.h @@ -60,7 +59,6 @@ header-y += dqblk_v2.h header-y += dqblk_xfs.h header-y += efs_fs_sb.h header-y += elf-fdpic.h -header-y += elf.h header-y += elf-em.h header-y += fadvise.h header-y += fd.h @@ -190,6 +188,7 @@ unifdef-y += dccp.h unifdef-y += dirent.h unifdef-y += dlm.h unifdef-y += edd.h +unifdef-y += elf.h unifdef-y += elfcore.h unifdef-y += errno.h unifdef-y += errqueue.h @@ -339,12 +338,10 @@ unifdef-y += tty.h unifdef-y += types.h unifdef-y += udf_fs_i.h unifdef-y += udp.h -unifdef-y += ufs_fs.h unifdef-y += uinput.h unifdef-y += uio.h unifdef-y += unistd.h unifdef-y += usbdevice_fs.h -unifdef-y += user.h unifdef-y += utsname.h unifdef-y += videodev2.h unifdef-y += videodev.h diff --git a/include/linux/a.out.h b/include/linux/a.out.h index f913cc3..208f4e8 100644 --- a/include/linux/a.out.h +++ b/include/linux/a.out.h @@ -1,6 +1,8 @@ #ifndef __A_OUT_GNU_H__ #define __A_OUT_GNU_H__ +#ifdef CONFIG_ARCH_SUPPORTS_AOUT + #define __GNU_EXEC_MACROS__ #ifndef __STRUCT_EXEC_OVERRIDE__ @@ -9,6 +11,8 @@ #endif /* __STRUCT_EXEC_OVERRIDE__ */ +#ifndef __ASSEMBLY__ + /* these go in the N_MACHTYPE field */ enum machine_type { #if defined (M_OLDSUN2) @@ -128,12 +132,20 @@ enum machine_type { #endif #ifdef linux +#ifdef __KERNEL__ #include <asm/page.h> +#else +#include <unistd.h> +#endif #if defined(__i386__) || defined(__mc68000__) #define SEGMENT_SIZE 1024 #else #ifndef SEGMENT_SIZE +#ifdef __KERNEL__ #define SEGMENT_SIZE PAGE_SIZE +#else +#define SEGMENT_SIZE getpagesize() +#endif #endif #endif #endif @@ -264,5 +276,11 @@ struct relocation_info }; #endif /* no N_RELOCATION_INFO_DECLARED. */ - +#endif /*__ASSEMBLY__ */ +#else /* CONFIG_ARCH_SUPPORTS_AOUT */ +#ifndef __ASSEMBLY__ +struct exec { +}; +#endif +#endif /* CONFIG_ARCH_SUPPORTS_AOUT */ #endif /* __A_OUT_GNU_H__ */ diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index 22eb936..0260c3e 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -326,11 +326,7 @@ struct ac97_ops #define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ }; -extern int ac97_read_proc (char *page_out, char **start, off_t off, - int count, int *eof, void *data); extern int ac97_probe_codec(struct ac97_codec *); -extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate); -extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate); extern struct ac97_codec *ac97_alloc_codec(void); extern void ac97_release_codec(struct ac97_codec *codec); @@ -363,7 +359,4 @@ struct ac97_quirk { int type; /* quirk type above */ }; -struct pci_dev; -extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override); - #endif /* _AC97_CODEC_H_ */ diff --git a/include/linux/acct.h b/include/linux/acct.h index 302eb72..e8cae54 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -173,7 +173,11 @@ typedef struct acct acct_t; static inline u32 jiffies_to_AHZ(unsigned long x) { #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 +# if HZ < AHZ + return x * (AHZ / HZ); +# else return x / (HZ / AHZ); +# endif #else u64 tmp = (u64)x * TICK_NSEC; do_div(tmp, (NSEC_PER_SEC / AHZ)); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6e..2c7e003 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -25,6 +25,7 @@ #ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H +#include <linux/ioport.h> /* for struct resource */ #ifdef CONFIG_ACPI @@ -43,8 +44,6 @@ #include <linux/dmi.h> -#ifdef CONFIG_ACPI - enum acpi_irq_model_id { ACPI_IRQ_MODEL_PIC = 0, ACPI_IRQ_MODEL_IOAPIC, @@ -80,7 +79,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table); typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); char * __acpi_map_table (unsigned long phys_addr, unsigned long size); -unsigned long acpi_find_rsdp (void); int acpi_boot_init (void); int acpi_boot_table_init (void); int acpi_numa_init (void); @@ -115,8 +113,8 @@ int acpi_unmap_lsapic(int cpu); int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); - -extern int acpi_mp_config; +void acpi_irq_stats_init(void); +extern u32 acpi_irq_handled; extern struct acpi_mcfg_allocation *pci_mmcfg_config; extern int pci_mmcfg_config_num; @@ -124,12 +122,6 @@ extern int pci_mmcfg_config_num; extern int sbf_port; extern unsigned long acpi_realmode_flags; -#else /* !CONFIG_ACPI */ - -#define acpi_mp_config 0 - -#endif /* !CONFIG_ACPI */ - int acpi_register_gsi (u32 gsi, int triggering, int polarity); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); @@ -145,8 +137,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); */ void acpi_unregister_gsi (u32 gsi); -#ifdef CONFIG_ACPI - struct acpi_prt_entry { struct list_head node; struct acpi_pci_id id; @@ -179,8 +169,6 @@ struct acpi_pci_driver { int acpi_pci_register_driver(struct acpi_pci_driver *driver); void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); -#endif /* CONFIG_ACPI */ - #ifdef CONFIG_ACPI_EC extern int ec_read(u8 addr, u8 *val); @@ -192,9 +180,30 @@ extern int ec_transaction(u8 command, #endif /*CONFIG_ACPI_EC*/ +#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE) + +typedef void (*wmi_notify_handler) (u32 value, void *context); + +extern acpi_status wmi_evaluate_method(const char *guid, u8 instance, + u32 method_id, + const struct acpi_buffer *in, + struct acpi_buffer *out); +extern acpi_status wmi_query_block(const char *guid, u8 instance, + struct acpi_buffer *out); +extern acpi_status wmi_set_block(const char *guid, u8 instance, + const struct acpi_buffer *in); +extern acpi_status wmi_install_notify_handler(const char *guid, + wmi_notify_handler handler, void *data); +extern acpi_status wmi_remove_notify_handler(const char *guid); +extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out); +extern bool wmi_has_guid(const char *guid); + +#endif /* CONFIG_ACPI_WMI */ + extern int acpi_blacklisted(void); #ifdef CONFIG_DMI extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); +extern int acpi_osi_setup(char *str); #endif #ifdef CONFIG_ACPI_NUMA @@ -217,6 +226,13 @@ extern int pnpacpi_disabled; #define PXM_INVAL (-1) #define NID_INVAL (-1) +int acpi_check_resource_conflict(struct resource *res); + +int acpi_check_region(resource_size_t start, resource_size_t n, + const char *name); +int acpi_check_mem_region(resource_size_t start, resource_size_t n, + const char *name); + #else /* CONFIG_ACPI */ static inline int acpi_boot_init(void) @@ -229,5 +245,22 @@ static inline int acpi_boot_table_init(void) return 0; } +static inline int acpi_check_resource_conflict(struct resource *res) +{ + return 0; +} + +static inline int acpi_check_region(resource_size_t start, resource_size_t n, + const char *name) +{ + return 0; +} + +static inline int acpi_check_mem_region(resource_size_t start, + resource_size_t n, const char *name) +{ + return 0; +} + #endif /* !CONFIG_ACPI */ #endif /*_LINUX_ACPI_H*/ diff --git a/include/linux/aio.h b/include/linux/aio.h index 7ef8de6..a9931e2 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h @@ -206,21 +206,21 @@ struct kioctx { /* prototypes */ extern unsigned aio_max_size; -extern ssize_t FASTCALL(wait_on_sync_kiocb(struct kiocb *iocb)); -extern int FASTCALL(aio_put_req(struct kiocb *iocb)); -extern void FASTCALL(kick_iocb(struct kiocb *iocb)); -extern int FASTCALL(aio_complete(struct kiocb *iocb, long res, long res2)); -extern void FASTCALL(__put_ioctx(struct kioctx *ctx)); +extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); +extern int aio_put_req(struct kiocb *iocb); +extern void kick_iocb(struct kiocb *iocb); +extern int aio_complete(struct kiocb *iocb, long res, long res2); +extern void __put_ioctx(struct kioctx *ctx); struct mm_struct; -extern void FASTCALL(exit_aio(struct mm_struct *mm)); +extern void exit_aio(struct mm_struct *mm); extern struct kioctx *lookup_ioctx(unsigned long ctx_id); -extern int FASTCALL(io_submit_one(struct kioctx *ctx, - struct iocb __user *user_iocb, struct iocb *iocb)); +extern int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, + struct iocb *iocb); /* semi private, but used by the 32bit emulations: */ struct kioctx *lookup_ioctx(unsigned long ctx_id); -int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, - struct iocb *iocb)); +int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, + struct iocb *iocb); #define get_ioctx(kioctx) do { \ BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index bdca3f1..eb640f0 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h @@ -47,7 +47,6 @@ struct dma_chan_ref { * address is an implied source, whereas the asynchronous case it must be listed * as a source. The destination address must be the first address in the source * array. - * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a * dependency chain * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. @@ -55,7 +54,6 @@ struct dma_chan_ref { enum async_tx_flags { ASYNC_TX_XOR_ZERO_DST = (1 << 0), ASYNC_TX_XOR_DROP_DST = (1 << 1), - ASYNC_TX_ASSUME_COHERENT = (1 << 2), ASYNC_TX_ACK = (1 << 3), ASYNC_TX_DEP_ACK = (1 << 4), }; @@ -64,9 +62,15 @@ enum async_tx_flags { void async_tx_issue_pending_all(void); enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); +#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL +#include <asm/async_tx.h> +#else +#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ + __async_tx_find_channel(dep, type) struct dma_chan * -async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, +__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, enum dma_transaction_type tx_type); +#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ #else static inline void async_tx_issue_pending_all(void) { @@ -88,7 +92,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx, static inline struct dma_chan * async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, - enum dma_transaction_type tx_type) + enum dma_transaction_type tx_type, struct page **dst, int dst_count, + struct page **src, int src_count, size_t len) { return NULL; } diff --git a/include/linux/pata_platform.h b/include/linux/ata_platform.h index 6a7a92d..b856a2a 100644 --- a/include/linux/pata_platform.h +++ b/include/linux/ata_platform.h @@ -1,5 +1,5 @@ -#ifndef __LINUX_PATA_PLATFORM_H -#define __LINUX_PATA_PLATFORM_H +#ifndef __LINUX_ATA_PLATFORM_H +#define __LINUX_ATA_PLATFORM_H struct pata_platform_info { /* @@ -24,4 +24,11 @@ extern int __devinit __pata_platform_probe(struct device *dev, extern int __devexit __pata_platform_remove(struct device *dev); -#endif /* __LINUX_PATA_PLATFORM_H */ +/* + * Marvell SATA private data + */ +struct mv_sata_platform_data { + int n_ports; /* number of sata ports */ +}; + +#endif /* __LINUX_ATA_PLATFORM_H */ diff --git a/include/linux/atmel_pwm.h b/include/linux/atmel_pwm.h new file mode 100644 index 0000000..ea04abb --- /dev/null +++ b/include/linux/atmel_pwm.h @@ -0,0 +1,70 @@ +#ifndef __LINUX_ATMEL_PWM_H +#define __LINUX_ATMEL_PWM_H + +/** + * struct pwm_channel - driver handle to a PWM channel + * @regs: base of this channel's registers + * @index: number of this channel (0..31) + * @mck: base clock rate, which can be prescaled and maybe subdivided + * + * Drivers initialize a pwm_channel structure using pwm_channel_alloc(). + * Then they configure its clock rate (derived from MCK), alignment, + * polarity, and duty cycle by writing directly to the channel registers, + * before enabling the channel by calling pwm_channel_enable(). + * + * After emitting a PWM signal for the desired length of time, drivers + * may then pwm_channel_disable() or pwm_channel_free(). Both of these + * disable the channel, but when it's freed the IRQ is deconfigured and + * the channel must later be re-allocated and reconfigured. + * + * Note that if the period or duty cycle need to be changed while the + * PWM channel is operating, drivers must use the PWM_CUPD double buffer + * mechanism, either polling until they change or getting implicitly + * notified through a once-per-period interrupt handler. + */ +struct pwm_channel { + void __iomem *regs; + unsigned index; + unsigned long mck; +}; + +extern int pwm_channel_alloc(int index, struct pwm_channel *ch); +extern int pwm_channel_free(struct pwm_channel *ch); + +extern int pwm_clk_alloc(unsigned prescale, unsigned div); +extern void pwm_clk_free(unsigned clk); + +extern int __pwm_channel_onoff(struct pwm_channel *ch, int enabled); + +#define pwm_channel_enable(ch) __pwm_channel_onoff((ch), 1) +#define pwm_channel_disable(ch) __pwm_channel_onoff((ch), 0) + +/* periodic interrupts, mostly for CUPD changes to period or cycle */ +extern int pwm_channel_handler(struct pwm_channel *ch, + void (*handler)(struct pwm_channel *ch)); + +/* per-channel registers (banked at pwm_channel->regs) */ +#define PWM_CMR 0x00 /* mode register */ +#define PWM_CPR_CPD (1 << 10) /* set: CUPD modifies period */ +#define PWM_CPR_CPOL (1 << 9) /* set: idle high */ +#define PWM_CPR_CALG (1 << 8) /* set: center align */ +#define PWM_CPR_CPRE (0xf << 0) /* mask: rate is mck/(2^pre) */ +#define PWM_CPR_CLKA (0xb << 0) /* rate CLKA */ +#define PWM_CPR_CLKB (0xc << 0) /* rate CLKB */ +#define PWM_CDTY 0x04 /* duty cycle (max of CPRD) */ +#define PWM_CPRD 0x08 /* period (count up from zero) */ +#define PWM_CCNT 0x0c /* counter (20 bits?) */ +#define PWM_CUPD 0x10 /* update CPRD (or CDTY) next period */ + +static inline void +pwm_channel_writel(struct pwm_channel *pwmc, unsigned offset, u32 val) +{ + __raw_writel(val, pwmc->regs + offset); +} + +static inline u32 pwm_channel_readl(struct pwm_channel *pwmc, unsigned offset) +{ + return __raw_readl(pwmc->regs + offset); +} + +#endif /* __LINUX_ATMEL_PWM_H */ diff --git a/include/linux/audit.h b/include/linux/audit.h index 9715302..2af9ec0 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -534,8 +534,7 @@ extern void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string); extern void audit_log_d_path(struct audit_buffer *ab, const char *prefix, - struct dentry *dentry, - struct vfsmount *vfsmnt); + struct path *path); extern void audit_log_lost(const char *message); /* Private API (for audit.c only) */ extern int audit_filter_user(struct netlink_skb_parms *cb, int type); @@ -552,7 +551,7 @@ extern int audit_enabled; #define audit_log_hex(a,b,l) do { ; } while (0) #define audit_log_untrustedstring(a,s) do { ; } while (0) #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) -#define audit_log_d_path(b,p,d,v) do { ; } while (0) +#define audit_log_d_path(b, p, d) do { ; } while (0) #define audit_enabled 0 #endif #endif diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 90392a9..e1888cc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -137,7 +137,9 @@ enum rq_flag_bits { #define BLK_MAX_CDB 16 /* - * try to put the fields that are referenced together in the same cacheline + * try to put the fields that are referenced together in the same cacheline. + * if you modify this structure, be sure to check block/blk-core.c:rq_init() + * as well! */ struct request { struct list_head queuelist; diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 0365ec9..4e4e340 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -60,8 +60,20 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata, unsigned long goal, unsigned long limit); +/* + * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, + * the architecture-specific code should honor this) + */ +#define BOOTMEM_DEFAULT 0 +#define BOOTMEM_EXCLUSIVE (1<<0) + #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE -extern void reserve_bootmem(unsigned long addr, unsigned long size); +/* + * If flags is 0, then the return value is always 0 (success). If + * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the + * memory already was reserved. + */ +extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); #define alloc_bootmem(x) \ __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) #define alloc_bootmem_low(x) \ @@ -84,7 +96,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat, unsigned long endpfn); extern void reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, - unsigned long size); + unsigned long size, + int flags); extern void free_bootmem_node(pg_data_t *pgdat, unsigned long addr, unsigned long size); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index e98801f..932eb02 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -144,7 +144,7 @@ BUFFER_FNS(Unwritten, unwritten) * Declarations */ -void FASTCALL(mark_buffer_dirty(struct buffer_head *bh)); +void mark_buffer_dirty(struct buffer_head *bh); void init_buffer(struct buffer_head *, bh_end_io_t *, void *); void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long offset); @@ -185,8 +185,8 @@ struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size void invalidate_bh_lrus(void); struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); void free_buffer_head(struct buffer_head * bh); -void FASTCALL(unlock_buffer(struct buffer_head *bh)); -void FASTCALL(__lock_buffer(struct buffer_head *bh)); +void unlock_buffer(struct buffer_head *bh); +void __lock_buffer(struct buffer_head *bh); void ll_rw_block(int, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); int submit_bh(int, struct buffer_head *); diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index 3dc715b..d377155 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h @@ -146,6 +146,36 @@ #define htons(x) ___htons(x) #define ntohs(x) ___ntohs(x) +static inline void le16_add_cpu(__le16 *var, u16 val) +{ + *var = cpu_to_le16(le16_to_cpu(*var) + val); +} + +static inline void le32_add_cpu(__le32 *var, u32 val) +{ + *var = cpu_to_le32(le32_to_cpu(*var) + val); +} + +static inline void le64_add_cpu(__le64 *var, u64 val) +{ + *var = cpu_to_le64(le64_to_cpu(*var) + val); +} + +static inline void be16_add_cpu(__be16 *var, u16 val) +{ + *var = cpu_to_be16(be16_to_cpu(*var) + val); +} + +static inline void be32_add_cpu(__be32 *var, u32 val) +{ + *var = cpu_to_be32(be32_to_cpu(*var) + val); +} + +static inline void be64_add_cpu(__be64 *var, u64 val) +{ + *var = cpu_to_be64(be64_to_cpu(*var) + val); +} + #endif /* KERNEL */ #endif /* _LINUX_BYTEORDER_GENERIC_H */ diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8747932..ff9055f 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -14,6 +14,7 @@ #include <linux/nodemask.h> #include <linux/rcupdate.h> #include <linux/cgroupstats.h> +#include <linux/prio_heap.h> #ifdef CONFIG_CGROUPS @@ -207,6 +208,14 @@ struct cftype { int (*release) (struct inode *inode, struct file *file); }; +struct cgroup_scanner { + struct cgroup *cg; + int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan); + void (*process_task)(struct task_struct *p, + struct cgroup_scanner *scan); + struct ptr_heap *heap; +}; + /* Add a new file to the given cgroup directory. Should only be * called by subsystems from within a populate() method */ int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, @@ -233,6 +242,7 @@ int cgroup_is_descendant(const struct cgroup *cont); struct cgroup_subsys { struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, struct cgroup *cont); + void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cont, struct task_struct *tsk); @@ -298,11 +308,17 @@ struct cgroup_iter { * returns NULL or until you want to end the iteration * * 3) call cgroup_iter_end() to destroy the iterator. + * + * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset. + * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() + * callback, but not while calling the process_task() callback. */ void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); struct task_struct *cgroup_iter_next(struct cgroup *cont, struct cgroup_iter *it); void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); +int cgroup_scan_tasks(struct cgroup_scanner *scan); +int cgroup_attach_task(struct cgroup *, struct task_struct *); #else /* !CONFIG_CGROUPS */ diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9ec4318..ac6aad9 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -25,7 +25,7 @@ SUBSYS(ns) /* */ -#ifdef CONFIG_FAIR_CGROUP_SCHED +#ifdef CONFIG_CGROUP_SCHED SUBSYS(cpu_cgroup) #endif @@ -37,3 +37,8 @@ SUBSYS(cpuacct) /* */ +#ifdef CONFIG_CGROUP_MEM_CONT +SUBSYS(mem_cgroup) +#endif + +/* */ diff --git a/include/linux/compat.h b/include/linux/compat.h index ae0a483..a671dbf 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, /* * epoll (fs/eventpoll.c) compat bits follow ... */ -#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT struct epoll_event; #define compat_epoll_event epoll_event -#else -asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd, - struct compat_epoll_event __user *event); -asmlinkage long compat_sys_epoll_wait(int epfd, - struct compat_epoll_event __user *events, - int maxevents, int timeout); -#endif asmlinkage long compat_sys_epoll_pwait(int epfd, struct compat_epoll_event __user *events, int maxevents, int timeout, diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 0ab3a32..974f5b7 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -5,15 +5,6 @@ /* These definitions are for GCC v4.x. */ #include <linux/compiler-gcc.h> -#ifdef CONFIG_FORCED_INLINING -# undef inline -# undef __inline__ -# undef __inline -# define inline inline __attribute__((always_inline)) -# define __inline__ __inline__ __attribute__((always_inline)) -# define __inline __inline __attribute__((always_inline)) -#endif - #define __used __attribute__((__used__)) #define __must_check __attribute__((warn_unused_result)) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 8c6967f..4b287ad 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -37,6 +37,7 @@ #ifdef __KERNEL__ +#include <linux/kernel.h> #include <linux/types.h> #include <linux/list.h> #include <linux/kref.h> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 23932d7..ddd8652 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -167,6 +167,10 @@ struct cpufreq_governor { char name[CPUFREQ_NAME_LEN]; int (*governor) (struct cpufreq_policy *policy, unsigned int event); + ssize_t (*show_setspeed) (struct cpufreq_policy *policy, + char *buf); + int (*store_setspeed) (struct cpufreq_policy *policy, + unsigned int freq); unsigned int max_transition_latency; /* HW must be able to switch to next freq faster than this value in nano secs or we will fallback to performance governor */ diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index c4e0016..6b72a45 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -19,6 +19,7 @@ #define CPUIDLE_STATE_MAX 8 #define CPUIDLE_NAME_LEN 16 +#define CPUIDLE_DESC_LEN 32 struct cpuidle_device; @@ -29,6 +30,7 @@ struct cpuidle_device; struct cpuidle_state { char name[CPUIDLE_NAME_LEN]; + char desc[CPUIDLE_DESC_LEN]; void *driver_data; unsigned int flags; @@ -46,9 +48,10 @@ struct cpuidle_state { /* Idle State Flags */ #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ -#define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ -#define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ -#define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ +#define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */ +#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ +#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ +#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) @@ -79,7 +82,7 @@ struct cpuidle_state_kobj { }; struct cpuidle_device { - int enabled:1; + unsigned int enabled:1; unsigned int cpu; int last_residency; @@ -178,4 +181,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { } #endif +#ifdef CONFIG_ARCH_HAS_CPU_RELAX +#define CPUIDLE_DRIVER_STATE_START 1 +#else +#define CPUIDLE_DRIVER_STATE_START 0 +#endif + #endif /* _LINUX_CPUIDLE_H */ diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index ecae585..0a26be3 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -26,8 +26,6 @@ extern nodemask_t cpuset_mems_allowed(struct task_struct *p); #define cpuset_current_mems_allowed (current->mems_allowed) void cpuset_init_current_mems_allowed(void); void cpuset_update_task_memory_state(void); -#define cpuset_nodes_subset_current_mems_allowed(nodes) \ - nodes_subset((nodes), current->mems_allowed) int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); extern int __cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask); @@ -57,7 +55,9 @@ extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); extern const struct file_operations proc_cpuset_operations; -extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); +struct seq_file; +extern void cpuset_task_status_allowed(struct seq_file *m, + struct task_struct *task); extern void cpuset_lock(void); extern void cpuset_unlock(void); @@ -101,7 +101,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) static inline void cpuset_init_current_mems_allowed(void) {} static inline void cpuset_update_task_memory_state(void) {} -#define cpuset_nodes_subset_current_mems_allowed(nodes) (1) static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) { @@ -126,10 +125,9 @@ static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, static inline void cpuset_memory_pressure_bump(void) {} -static inline char *cpuset_task_status_allowed(struct task_struct *task, - char *buffer) +static inline void cpuset_task_status_allowed(struct seq_file *m, + struct task_struct *task) { - return buffer; } static inline void cpuset_lock(void) {} diff --git a/include/linux/dca.h b/include/linux/dca.h index 83eaecc..af61cd1 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h @@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb); struct dca_provider { struct dca_ops *ops; - struct class_device *cd; + struct device *cd; int id; }; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index c2c153f..6bd6460 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -10,6 +10,7 @@ #include <linux/rcupdate.h> struct nameidata; +struct path; struct vfsmount; /* @@ -300,8 +301,8 @@ extern int d_validate(struct dentry *, struct dentry *); */ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); -extern char * d_path(struct dentry *, struct vfsmount *, char *, int); - +extern char *d_path(struct path *, char *, int); + /* Allocation counts.. */ /** diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h index 98c69ab..24c806f 100644 --- a/include/linux/dcookies.h +++ b/include/linux/dcookies.h @@ -13,6 +13,7 @@ #ifdef CONFIG_PROFILING #include <linux/dcache.h> +#include <linux/path.h> #include <linux/types.h> struct dcookie_user; @@ -43,8 +44,7 @@ void dcookie_unregister(struct dcookie_user * user); * * Returns 0 on success, with *cookie filled in */ -int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt, - unsigned long * cookie); +int get_dcookie(struct path *path, unsigned long *cookie); #else @@ -57,13 +57,12 @@ static inline void dcookie_unregister(struct dcookie_user * user) { return; } - -static inline int get_dcookie(struct dentry * dentry, - struct vfsmount * vfsmnt, unsigned long * cookie) + +static inline int get_dcookie(struct path *path, unsigned long *cookie) { return -ENOSYS; -} - +} + #endif /* CONFIG_PROFILING */ - + #endif /* DCOOKIES_H */ diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index e765e19..cb78457 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -110,15 +110,15 @@ struct target_type { }; struct io_restrictions { - unsigned int max_sectors; - unsigned short max_phys_segments; - unsigned short max_hw_segments; - unsigned short hardsect_size; - unsigned int max_segment_size; - unsigned int max_hw_sectors; - unsigned long seg_boundary_mask; - unsigned long bounce_pfn; - unsigned char no_cluster; /* inverted so that 0 is default */ + unsigned long bounce_pfn; + unsigned long seg_boundary_mask; + unsigned max_hw_sectors; + unsigned max_sectors; + unsigned max_segment_size; + unsigned short hardsect_size; + unsigned short max_hw_segments; + unsigned short max_phys_segments; + unsigned char no_cluster; /* inverted so that 0 is default */ }; struct dm_target { diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 523281c..b03c41b 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h @@ -232,36 +232,6 @@ enum { DM_DEV_SET_GEOMETRY_CMD }; -/* - * The dm_ioctl struct passed into the ioctl is just the header - * on a larger chunk of memory. On x86-64 and other - * architectures the dm-ioctl struct will be padded to an 8 byte - * boundary so the size will be different, which would change the - * ioctl code - yes I really messed up. This hack forces these - * architectures to have the correct ioctl code. - */ -#ifdef CONFIG_COMPAT -typedef char ioctl_struct[308]; -#define DM_VERSION_32 _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct) -#define DM_REMOVE_ALL_32 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct) -#define DM_LIST_DEVICES_32 _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct) - -#define DM_DEV_CREATE_32 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct) -#define DM_DEV_REMOVE_32 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct) -#define DM_DEV_RENAME_32 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct) -#define DM_DEV_SUSPEND_32 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct) -#define DM_DEV_STATUS_32 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct) -#define DM_DEV_WAIT_32 _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct) - -#define DM_TABLE_LOAD_32 _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct) -#define DM_TABLE_CLEAR_32 _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct) -#define DM_TABLE_DEPS_32 _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct) -#define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct) -#define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct) -#define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct) -#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct) -#endif - #define DM_IOCTL 0xfd #define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) @@ -286,9 +256,9 @@ typedef char ioctl_struct[308]; #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) #define DM_VERSION_MAJOR 4 -#define DM_VERSION_MINOR 12 +#define DM_VERSION_MINOR 13 #define DM_VERSION_PATCHLEVEL 0 -#define DM_VERSION_EXTRA "-ioctl (2007-10-02)" +#define DM_VERSION_EXTRA "-ioctl (2007-10-18)" /* Status bits */ #define DM_READONLY_FLAG (1 << 0) /* In/Out */ diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index 0008e2a..a375046 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h @@ -19,6 +19,8 @@ #define DM9000_PLATF_8BITONLY (0x0001) #define DM9000_PLATF_16BITONLY (0x0002) #define DM9000_PLATF_32BITONLY (0x0004) +#define DM9000_PLATF_EXT_PHY (0x0008) +#define DM9000_PLATF_NO_EEPROM (0x0010) /* platfrom data for platfrom device structure's platfrom_data field */ diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5c84bf8..acbb364 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -95,6 +95,15 @@ enum dma_transaction_type { #define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) /** + * enum dma_prep_flags - DMA flags to augment operation preparation + * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of + * this transaction + */ +enum dma_prep_flags { + DMA_PREP_INTERRUPT = (1 << 0), +}; + +/** * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. * See linux/cpumask.h */ @@ -209,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param); * descriptors * @chan: target channel for this operation * @tx_submit: set the prepared descriptor(s) to be executed by the engine - * @tx_set_dest: set a destination address in a hardware descriptor - * @tx_set_src: set a source address in a hardware descriptor * @callback: routine to call after this operation is complete * @callback_param: general parameter to pass to the callback routine * ---async_tx api specific fields--- @@ -227,10 +234,6 @@ struct dma_async_tx_descriptor { struct list_head tx_list; struct dma_chan *chan; dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); - void (*tx_set_dest)(dma_addr_t addr, - struct dma_async_tx_descriptor *tx, int index); - void (*tx_set_src)(dma_addr_t addr, - struct dma_async_tx_descriptor *tx, int index); dma_async_tx_callback callback; void *callback_param; struct list_head depend_list; @@ -279,15 +282,17 @@ struct dma_device { void (*device_free_chan_resources)(struct dma_chan *chan); struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( - struct dma_chan *chan, size_t len, int int_en); + struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, + size_t len, unsigned long flags); struct dma_async_tx_descriptor *(*device_prep_dma_xor)( - struct dma_chan *chan, unsigned int src_cnt, size_t len, - int int_en); + struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, + unsigned int src_cnt, size_t len, unsigned long flags); struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( - struct dma_chan *chan, unsigned int src_cnt, size_t len, - u32 *result, int int_en); + struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, + size_t len, u32 *result, unsigned long flags); struct dma_async_tx_descriptor *(*device_prep_dma_memset)( - struct dma_chan *chan, int value, size_t len, int int_en); + struct dma_chan *chan, dma_addr_t dest, int value, size_t len, + unsigned long flags); struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( struct dma_chan *chan); diff --git a/include/linux/dmar.h b/include/linux/dmar.h index ffb6439..56c73b8 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h @@ -28,7 +28,7 @@ #ifdef CONFIG_DMAR struct intel_iommu; -extern char *dmar_get_fault_reason(u8 fault_reason); +extern const char *dmar_get_fault_reason(u8 fault_reason); /* Can't use the common MSI interrupt functions * since DMAR is not a pci device diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5b42a65..325acdf 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -35,8 +35,11 @@ enum dmi_device_type { DMI_DEV_TYPE_ETHERNET, DMI_DEV_TYPE_TOKENRING, DMI_DEV_TYPE_SOUND, + DMI_DEV_TYPE_PATA, + DMI_DEV_TYPE_SATA, + DMI_DEV_TYPE_SAS, DMI_DEV_TYPE_IPMI = -1, - DMI_DEV_TYPE_OEM_STRING = -2 + DMI_DEV_TYPE_OEM_STRING = -2, }; struct dmi_header { @@ -79,7 +82,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 char *dmi_get_slot(int slot); +extern int dmi_walk(void (*decode)(const struct dmi_header *)); #else @@ -90,7 +93,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 char *dmi_get_slot(int slot) { return NULL; } +static inline int dmi_walk(void (*decode)(const struct dmi_header *)) + { return -1; } #endif diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h index 31f6e3c..d3c65e4 100644 --- a/include/linux/ds1wm.h +++ b/include/linux/ds1wm.h @@ -6,6 +6,7 @@ struct ds1wm_platform_data { * e.g. on h5xxx and h2200 this is 2 * (registers aligned to 4-byte boundaries), * while on hx4700 this is 1 */ + int active_high; void (*enable)(struct platform_device *pdev); void (*disable)(struct platform_device *pdev); }; diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index dd57fe5..a695d63 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h @@ -41,7 +41,7 @@ extern const struct inode_operations efs_dir_inode_operations; extern const struct file_operations efs_dir_operations; extern const struct address_space_operations efs_symlink_aops; -extern void efs_read_inode(struct inode *); +extern struct inode *efs_iget(struct super_block *, unsigned long); extern efs_block_t efs_map_block(struct inode *, efs_block_t); extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 5834e84..18bea78 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h @@ -31,6 +31,7 @@ #define EM_V850 87 /* NEC v850 */ #define EM_M32R 88 /* Renesas M32R */ #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ +#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */ #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ #define EM_FRV 0x5441 /* Fujitsu FR-V */ #define EM_AVR32 0x18ad /* Atmel AVR32 */ @@ -47,6 +48,8 @@ #define EM_CYGNUS_M32R 0x9041 /* This is the old interim value for S/390 architecture */ #define EM_S390_OLD 0xA390 +/* Also Panasonic/MEI MN10300, AM33 */ +#define EM_CYGNUS_MN10300 0xbeef #endif /* _LINUX_ELF_EM_H */ diff --git a/include/linux/elf.h b/include/linux/elf.h index 7ceb24d..bad1b16 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -3,7 +3,9 @@ #include <linux/types.h> #include <linux/elf-em.h> +#ifdef __KERNEL__ #include <asm/elf.h> +#endif struct file; @@ -355,6 +357,7 @@ typedef struct elf64_shdr { #define NT_AUXV 6 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ +#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 9631ddd..5ca54d7 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -4,7 +4,9 @@ #include <linux/types.h> #include <linux/signal.h> #include <linux/time.h> +#ifdef __KERNEL__ #include <linux/user.h> +#endif #include <linux/ptrace.h> struct elf_siginfo @@ -14,7 +16,9 @@ struct elf_siginfo int si_errno; /* errno */ }; +#ifdef __KERNEL__ #include <asm/elf.h> +#endif #ifndef __KERNEL__ typedef elf_greg_t greg_t; 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/err.h b/include/linux/err.h index 1ab1d44..ec87f31 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -34,6 +34,19 @@ static inline long IS_ERR(const void *ptr) return IS_ERR_VALUE((unsigned long)ptr); } +/** + * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type + * @ptr: The pointer to cast. + * + * Explicitly cast an error-valued pointer to another pointer type in such a + * way as to make it clear that's what's going on. + */ +static inline void *ERR_CAST(const void *ptr) +{ + /* cast away the const */ + return (void *) ptr; +} + #endif #endif /* _LINUX_ERR_H */ diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index b7558ec..25d62e6 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -70,8 +70,7 @@ static inline int is_multicast_ether_addr(const u8 *addr) } /** - * is_local_ether_addr - Determine if the Ethernet address is locally-assigned - * one (IEEE 802). + * is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802). * @addr: Pointer to a six-byte array containing the Ethernet address * * Return true if the address is a local address. diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 241c01c..36c5403 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -823,7 +823,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, int create, int extend_disksize); -extern void ext3_read_inode (struct inode *); +extern struct inode *ext3_iget(struct super_block *, unsigned long); extern int ext3_write_inode (struct inode *, int); extern int ext3_setattr (struct dentry *, struct iattr *); extern void ext3_delete_inode (struct inode *); diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 1852313..2500325 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h @@ -490,6 +490,13 @@ do { \ #define EXT4_ORPHAN_FS 0x0004 /* Orphans being recovered */ /* + * Misc. filesystem flags + */ +#define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */ +#define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */ +#define EXT2_FLAGS_TEST_FILESYS 0x0004 /* to test development code */ + +/* * Mount flags */ #define EXT4_MOUNT_CHECK 0x00001 /* Do mount-time checks */ @@ -1024,7 +1031,7 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, struct buffer_head *bh_result, int create, int extend_disksize); -extern void ext4_read_inode (struct inode *); +extern struct inode *ext4_iget(struct super_block *, unsigned long); extern int ext4_write_inode (struct inode *, int); extern int ext4_setattr (struct dentry *, struct iattr *); extern void ext4_delete_inode (struct inode *); diff --git a/include/linux/file.h b/include/linux/file.h index 56023c7..7239baa 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -59,8 +59,8 @@ struct files_struct { extern struct kmem_cache *filp_cachep; -extern void FASTCALL(__fput(struct file *)); -extern void FASTCALL(fput(struct file *)); +extern void __fput(struct file *); +extern void fput(struct file *); struct file_operations; struct vfsmount; @@ -77,13 +77,13 @@ static inline void fput_light(struct file *file, int fput_needed) fput(file); } -extern struct file * FASTCALL(fget(unsigned int fd)); -extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed)); -extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); +extern struct file *fget(unsigned int fd); +extern struct file *fget_light(unsigned int fd, int *fput_needed); +extern void set_close_on_exec(unsigned int fd, int flag); extern void put_filp(struct file *); extern int get_unused_fd(void); extern int get_unused_fd_flags(int flags); -extern void FASTCALL(put_unused_fd(unsigned int fd)); +extern void put_unused_fd(unsigned int fd); struct kmem_cache; extern int expand_files(struct files_struct *, int nr); @@ -110,12 +110,12 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in */ #define fcheck(fd) fcheck_files(current->files, fd) -extern void FASTCALL(fd_install(unsigned int fd, struct file * file)); +extern void fd_install(unsigned int fd, struct file *file); struct task_struct; struct files_struct *get_files_struct(struct task_struct *); -void FASTCALL(put_files_struct(struct files_struct *fs)); +void put_files_struct(struct files_struct *fs); void reset_files_struct(struct task_struct *, struct files_struct *); extern struct kmem_cache *files_cachep; diff --git a/include/linux/fs.h b/include/linux/fs.h index 56bd421..98ffb6e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -21,7 +21,7 @@ /* Fixed constants first: */ #undef NR_OPEN -#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ +extern int sysctl_nr_open; #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ #define BLOCK_SIZE_BITS 10 @@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown); extern struct list_head super_blocks; extern spinlock_t sb_lock; -#define sb_entry(list) list_entry((list), struct super_block, s_list) #define S_BIAS (1<<30) struct super_block { struct list_head s_list; /* Keep this first */ @@ -1039,6 +1038,12 @@ struct super_block { * in /proc/mounts will be "type.subtype" */ char *s_subtype; + + /* + * Saved mount options for lazy filesystems using + * generic_show_options() + */ + char *s_options; }; extern struct timespec current_fs_time(struct super_block *sb); @@ -1242,8 +1247,6 @@ struct super_operations { struct inode *(*alloc_inode)(struct super_block *sb); void (*destroy_inode)(struct inode *); - void (*read_inode) (struct inode *); - void (*dirty_inode) (struct inode *); int (*write_inode) (struct inode *, int); void (*put_inode) (struct inode *); @@ -1279,8 +1282,12 @@ struct super_operations { * * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. * - * I_DIRTY_SYNC Inode itself is dirty. - * I_DIRTY_DATASYNC Data-related inode changes pending + * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on + * fdatasync(). i_atime is the usual cause. + * I_DIRTY_DATASYNC Data-related inode changes pending. We keep track of + * these changes separately from I_DIRTY_SYNC so that we + * don't have to write inode on fdatasync() when only + * mtime has changed in it. * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both * are cleared by unlock_new_inode(), called from iget(). @@ -1312,8 +1319,6 @@ struct super_operations { * purpose reduces latency and prevents some filesystem- * specific deadlocks. * - * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced - * by (I_DIRTY_SYNC|I_DIRTY_PAGES). * Q: What is the difference between I_WILL_FREE and I_FREEING? * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on * I_CLEAR? If not, why? @@ -1621,7 +1626,6 @@ extern int register_chrdev(unsigned int, const char *, const struct file_operations *); extern void unregister_chrdev(unsigned int, const char *); extern void unregister_chrdev_region(dev_t, unsigned); -extern int chrdev_open(struct inode *, struct file *); extern void chrdev_show(struct seq_file *,off_t); /* fs/block_dev.c */ @@ -1768,19 +1772,8 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te extern struct inode * iget_locked(struct super_block *, unsigned long); extern void unlock_new_inode(struct inode *); -static inline struct inode *iget(struct super_block *sb, unsigned long ino) -{ - struct inode *inode = iget_locked(sb, ino); - - if (inode && (inode->i_state & I_NEW)) { - sb->s_op->read_inode(inode); - unlock_new_inode(inode); - } - - return inode; -} - extern void __iget(struct inode * inode); +extern void iget_failed(struct inode *); extern void clear_inode(struct inode *); extern void destroy_inode(struct inode *); extern struct inode *new_inode(struct super_block *); @@ -1821,9 +1814,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, unsigned long, loff_t, loff_t *, size_t, ssize_t); extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); -extern void do_generic_mapping_read(struct address_space *mapping, - struct file_ra_state *, struct file *, - loff_t *, read_descriptor_t *, read_actor_t); extern int generic_segment_checks(const struct iovec *iov, unsigned long *nr_segs, size_t *count, int access_flags); @@ -1861,18 +1851,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from) } #endif -static inline void do_generic_file_read(struct file * filp, loff_t *ppos, - read_descriptor_t * desc, - read_actor_t actor) -{ - do_generic_mapping_read(filp->f_mapping, - &filp->f_ra, - filp, - ppos, - desc, - actor); -} - #ifdef CONFIG_BLOCK ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, struct block_device *bdev, const struct iovec *iov, loff_t offset, @@ -1942,7 +1920,9 @@ extern int vfs_stat_fd(int dfd, char __user *, struct kstat *); extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); extern int vfs_fstat(unsigned int, struct kstat *); -extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); +extern long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); +extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, + unsigned long arg); extern void get_filesystem(struct file_system_type *fs); extern void put_filesystem(struct file_system_type *fs); @@ -1997,6 +1977,9 @@ extern int __must_check inode_setattr(struct inode *, struct iattr *); extern void file_update_time(struct file *file); +extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); +extern void save_mount_options(struct super_block *sb, char *options); + static inline ino_t parent_ino(struct dentry *dentry) { ino_t res; @@ -2068,7 +2051,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ static struct file_operations __fops = { \ .owner = THIS_MODULE, \ .open = __fops ## _open, \ - .release = simple_attr_close, \ + .release = simple_attr_release, \ .read = simple_attr_read, \ .write = simple_attr_write, \ }; @@ -2080,9 +2063,9 @@ __simple_attr_check_format(const char *fmt, ...) } int simple_attr_open(struct inode *inode, struct file *file, - u64 (*get)(void *), void (*set)(void *, u64), + int (*get)(void *, u64 *), int (*set)(void *, u64), const char *fmt); -int simple_attr_close(struct inode *inode, struct file *file); +int simple_attr_release(struct inode *inode, struct file *file); ssize_t simple_attr_read(struct file *file, char __user *buf, size_t len, loff_t *ppos); ssize_t simple_attr_write(struct file *file, const char __user *buf, @@ -2113,6 +2096,7 @@ struct ctl_table; int proc_nr_files(struct ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos); +int get_filesystem_list(char * buf); #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 11a36ce..282f542 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -1,15 +1,13 @@ #ifndef _LINUX_FS_STRUCT_H #define _LINUX_FS_STRUCT_H -struct dentry; -struct vfsmount; +#include <linux/path.h> struct fs_struct { atomic_t count; rwlock_t lock; int umask; - struct dentry * root, * pwd, * altroot; - struct vfsmount * rootmnt, * pwdmnt, * altrootmnt; + struct path root, pwd, altroot; }; #define INIT_FS { \ @@ -22,8 +20,8 @@ extern struct kmem_cache *fs_cachep; extern void exit_fs(struct task_struct *); extern void set_fs_altroot(void); -extern void set_fs_root(struct fs_struct *, struct vfsmount *, struct dentry *); -extern void set_fs_pwd(struct fs_struct *, struct vfsmount *, struct dentry *); +extern void set_fs_root(struct fs_struct *, struct path *); +extern void set_fs_pwd(struct fs_struct *, struct path *); extern struct fs_struct *copy_fs_struct(struct fs_struct *); extern void put_fs_struct(struct fs_struct *); diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 2bd31fa..d4b7c4a 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode) } /* + * fsnotify_link_count - inode's link count changed + */ +static inline void fsnotify_link_count(struct inode *inode) +{ + inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL); +} + +/* * fsnotify_create - 'name' was linked in */ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) @@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) } /* + * fsnotify_link - new hardlink in 'inode' directory + * Note: We have to pass also the linked inode ptr as some filesystems leave + * new_dentry->d_inode NULL and instantiate inode pointer later + */ +static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry) +{ + inode_dir_notify(dir, DN_CREATE); + inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, + inode); + fsnotify_link_count(inode); + audit_inode_child(new_dentry->d_name.name, new_dentry, dir); +} + +/* * fsnotify_mkdir - directory 'name' was created */ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 1dbea0a..09a3b18 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -91,16 +91,31 @@ struct partition { __le32 nr_sects; /* nr of sectors in partition */ } __attribute__((packed)); +struct disk_stats { + unsigned long sectors[2]; /* READs and WRITEs */ + unsigned long ios[2]; + unsigned long merges[2]; + unsigned long ticks[2]; + unsigned long io_ticks; + unsigned long time_in_queue; +}; + struct hd_struct { sector_t start_sect; sector_t nr_sects; struct device dev; struct kobject *holder_dir; - unsigned ios[2], sectors[2]; /* READs and WRITEs */ int policy, partno; #ifdef CONFIG_FAIL_MAKE_REQUEST int make_it_fail; #endif + unsigned long stamp; + int in_flight; +#ifdef CONFIG_SMP + struct disk_stats *dkstats; +#else + struct disk_stats dkstats; +#endif }; #define GENHD_FL_REMOVABLE 1 @@ -111,15 +126,7 @@ struct hd_struct { #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 #define GENHD_FL_FAIL 64 -struct disk_stats { - unsigned long sectors[2]; /* READs and WRITEs */ - unsigned long ios[2]; - unsigned long merges[2]; - unsigned long ticks[2]; - unsigned long io_ticks; - unsigned long time_in_queue; -}; - + struct gendisk { int major; /* major number of driver */ int first_minor; @@ -158,6 +165,20 @@ struct gendisk { * The __ variants should only be called in critical sections. The full * variants disable/enable preemption. */ +static inline struct hd_struct *get_part(struct gendisk *gendiskp, + sector_t sector) +{ + struct hd_struct *part; + int i; + for (i = 0; i < gendiskp->minors - 1; i++) { + part = gendiskp->part[i]; + if (part && part->start_sect <= sector + && sector < part->start_sect + part->nr_sects) + return part; + } + return NULL; +} + #ifdef CONFIG_SMP #define __disk_stat_add(gendiskp, field, addnd) \ (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) @@ -177,15 +198,62 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { memset(per_cpu_ptr(gendiskp->dkstats, i), value, sizeof (struct disk_stats)); } + +#define __part_stat_add(part, field, addnd) \ + (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd) + +#define __all_stat_add(gendiskp, field, addnd, sector) \ +({ \ + struct hd_struct *part = get_part(gendiskp, sector); \ + if (part) \ + __part_stat_add(part, field, addnd); \ + __disk_stat_add(gendiskp, field, addnd); \ +}) + +#define part_stat_read(part, field) \ +({ \ + typeof(part->dkstats->field) res = 0; \ + int i; \ + for_each_possible_cpu(i) \ + res += per_cpu_ptr(part->dkstats, i)->field; \ + res; \ +}) + +static inline void part_stat_set_all(struct hd_struct *part, int value) { + int i; + for_each_possible_cpu(i) + memset(per_cpu_ptr(part->dkstats, i), value, + sizeof(struct disk_stats)); +} #else #define __disk_stat_add(gendiskp, field, addnd) \ (gendiskp->dkstats.field += addnd) #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) -static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { +static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) +{ memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); } + +#define __part_stat_add(part, field, addnd) \ + (part->dkstats.field += addnd) + +#define __all_stat_add(gendiskp, field, addnd, sector) \ +({ \ + struct hd_struct *part = get_part(gendiskp, sector); \ + if (part) \ + part->dkstats.field += addnd; \ + __disk_stat_add(gendiskp, field, addnd); \ +}) + +#define part_stat_read(part, field) (part->dkstats.field) + +static inline void part_stat_set_all(struct hd_struct *part, int value) +{ + memset(&part->dkstats, value, sizeof(struct disk_stats)); +} + #endif #define disk_stat_add(gendiskp, field, addnd) \ @@ -206,6 +274,45 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { #define disk_stat_sub(gendiskp, field, subnd) \ disk_stat_add(gendiskp, field, -subnd) +#define part_stat_add(gendiskp, field, addnd) \ + do { \ + preempt_disable(); \ + __part_stat_add(gendiskp, field, addnd);\ + preempt_enable(); \ + } while (0) + +#define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1) +#define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1) + +#define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1) +#define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1) + +#define __part_stat_sub(gendiskp, field, subnd) \ + __part_stat_add(gendiskp, field, -subnd) +#define part_stat_sub(gendiskp, field, subnd) \ + part_stat_add(gendiskp, field, -subnd) + +#define all_stat_add(gendiskp, field, addnd, sector) \ + do { \ + preempt_disable(); \ + __all_stat_add(gendiskp, field, addnd, sector); \ + preempt_enable(); \ + } while (0) + +#define __all_stat_dec(gendiskp, field, sector) \ + __all_stat_add(gendiskp, field, -1, sector) +#define all_stat_dec(gendiskp, field, sector) \ + all_stat_add(gendiskp, field, -1, sector) + +#define __all_stat_inc(gendiskp, field, sector) \ + __all_stat_add(gendiskp, field, 1, sector) +#define all_stat_inc(gendiskp, field, sector) \ + all_stat_add(gendiskp, field, 1, sector) + +#define __all_stat_sub(gendiskp, field, subnd, sector) \ + __all_stat_add(gendiskp, field, -subnd, sector) +#define all_stat_sub(gendiskp, field, subnd, sector) \ + all_stat_add(gendiskp, field, -subnd, sector) /* Inlines to alloc and free disk stats in struct gendisk */ #ifdef CONFIG_SMP @@ -221,6 +328,20 @@ static inline void free_disk_stats(struct gendisk *disk) { free_percpu(disk->dkstats); } + +static inline int init_part_stats(struct hd_struct *part) +{ + part->dkstats = alloc_percpu(struct disk_stats); + if (!part->dkstats) + return 0; + return 1; +} + +static inline void free_part_stats(struct hd_struct *part) +{ + free_percpu(part->dkstats); +} + #else /* CONFIG_SMP */ static inline int init_disk_stats(struct gendisk *disk) { @@ -230,10 +351,20 @@ static inline int init_disk_stats(struct gendisk *disk) static inline void free_disk_stats(struct gendisk *disk) { } + +static inline int init_part_stats(struct hd_struct *part) +{ + return 1; +} + +static inline void free_part_stats(struct hd_struct *part) +{ +} #endif /* CONFIG_SMP */ /* drivers/block/ll_rw_blk.c */ extern void disk_round_stats(struct gendisk *disk); +extern void part_round_stats(struct hd_struct *part); /* drivers/block/genhd.c */ extern int get_blkdev_list(char *, int); diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0c6ce51..164be9d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -172,8 +172,7 @@ static inline void arch_free_page(struct page *page, int order) { } static inline void arch_alloc_page(struct page *page, int order) { } #endif -extern struct page * -FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *)); +extern struct page *__alloc_pages(gfp_t, unsigned int, struct zonelist *); static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) @@ -209,8 +208,8 @@ extern struct page *alloc_page_vma(gfp_t gfp_mask, #endif #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) -extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order)); -extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask)); +extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); +extern unsigned long get_zeroed_page(gfp_t gfp_mask); #define __get_free_page(gfp_mask) \ __get_free_pages((gfp_mask),0) @@ -218,10 +217,10 @@ extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask)); #define __get_dma_pages(gfp_mask, order) \ __get_free_pages((gfp_mask) | GFP_DMA,(order)) -extern void FASTCALL(__free_pages(struct page *page, unsigned int order)); -extern void FASTCALL(free_pages(unsigned long addr, unsigned int order)); -extern void FASTCALL(free_hot_page(struct page *page)); -extern void FASTCALL(free_cold_page(struct page *page)); +extern void __free_pages(struct page *page, unsigned int order); +extern void free_pages(unsigned long addr, unsigned int order); +extern void free_hot_page(struct page *page); +extern void free_cold_page(struct page *page); #define __free_page(page) __free_pages((page), 0) #define free_page(addr) free_pages((addr),0) diff --git a/include/linux/hash.h b/include/linux/hash.h index acf17bb..06d25c1 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h @@ -1,6 +1,6 @@ #ifndef _LINUX_HASH_H #define _LINUX_HASH_H -/* Fast hashing routine for a long. +/* Fast hashing routine for ints, longs and pointers. (C) 2002 William Lee Irwin III, IBM */ /* @@ -13,23 +13,30 @@ * them can use shifts and additions instead of multiplications for * machines where multiplications are slow. */ -#if BITS_PER_LONG == 32 + +#include <asm/types.h> + /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ -#define GOLDEN_RATIO_PRIME 0x9e370001UL -#elif BITS_PER_LONG == 64 +#define GOLDEN_RATIO_PRIME_32 0x9e370001UL /* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ -#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL +#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL + +#if BITS_PER_LONG == 32 +#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32 +#define hash_long(val, bits) hash_32(val, bits) +#elif BITS_PER_LONG == 64 +#define hash_long(val, bits) hash_64(val, bits) +#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64 #else -#error Define GOLDEN_RATIO_PRIME for your wordsize. +#error Wordsize not 32 or 64 #endif -static inline unsigned long hash_long(unsigned long val, unsigned int bits) +static inline u64 hash_64(u64 val, unsigned int bits) { - unsigned long hash = val; + u64 hash = val; -#if BITS_PER_LONG == 64 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ - unsigned long n = hash; + u64 n = hash; n <<= 18; hash -= n; n <<= 33; @@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits) hash += n; n <<= 2; hash += n; -#else + + /* High bits are more random, so use them. */ + return hash >> (64 - bits); +} + +static inline u32 hash_32(u32 val, unsigned int bits) +{ /* On some cpus multiply is faster, on others gcc will do shifts */ - hash *= GOLDEN_RATIO_PRIME; -#endif + u32 hash = val * GOLDEN_RATIO_PRIME_32; /* High bits are more random, so use them. */ - return hash >> (BITS_PER_LONG - bits); + return hash >> (32 - bits); } - + static inline unsigned long hash_ptr(void *ptr, unsigned int bits) { return hash_long((unsigned long)ptr, bits); diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index b436be7..2177ee5 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h @@ -71,7 +71,6 @@ struct hayes_esp_config { #define ESP_STAT_NEVER_DMA 0x08 #define ESP_STAT_USE_PIO 0x10 -#define ESP_EVENT_WRITE_WAKEUP 0 #define ESP_MAGIC 0x53ee #define ESP_XMIT_SIZE 4096 @@ -92,7 +91,6 @@ struct esp_struct { unsigned short closing_wait2; int IER; /* Interrupt Enable Register */ int MCR; /* Modem control register */ - unsigned long event; unsigned long last_active; int line; int count; /* # of fd on device */ @@ -101,8 +99,6 @@ struct esp_struct { int xmit_head; int xmit_tail; int xmit_cnt; - struct work_struct tqueue; - struct work_struct tqueue_hangup; wait_queue_head_t open_wait; wait_queue_head_t close_wait; wait_queue_head_t delta_msr_wait; diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index db390c5..6115545 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h @@ -26,13 +26,6 @@ #include <linux/netdevice.h> #include <linux/hdlc/ioctl.h> - -/* Used by all network devices here, pointed to by netdev_priv(dev) */ -struct hdlc_device_desc { - int (*netif_rx)(struct sk_buff *skb); - struct net_device_stats stats; -}; - /* This structure is a private property of HDLC protocols. Hardware drivers have no interest here */ @@ -44,12 +37,15 @@ struct hdlc_proto { void (*detach)(struct net_device *dev); int (*ioctl)(struct net_device *dev, struct ifreq *ifr); __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); + int (*netif_rx)(struct sk_buff *skb); struct module *module; struct hdlc_proto *next; /* next protocol in the list */ }; +/* Pointed to by dev->priv */ typedef struct hdlc_device { + struct net_device_stats stats; /* used by HDLC layer to take control over HDLC device from hw driver*/ int (*attach)(struct net_device *dev, unsigned short encoding, unsigned short parity); @@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto); struct net_device *alloc_hdlcdev(void *priv); - -static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev) -{ - return netdev_priv(dev); -} - -static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) +static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) { - return netdev_priv(dev) + sizeof(struct hdlc_device_desc); + return dev->priv; } - static __inline__ void debug_frame(const struct sk_buff *skb) { int i; @@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev); void hdlc_close(struct net_device *dev); int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, - int (*rx)(struct sk_buff *skb), size_t size); + size_t size); /* May be used by hardware driver to gain control over HDLC device */ void detach_hdlc_protocol(struct net_device *dev); static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) { - return &dev_to_desc(dev)->stats; + return &dev_to_hdlc(dev)->stats; } diff --git a/include/linux/hid.h b/include/linux/hid.h index 3902690..74ff575 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -528,7 +528,7 @@ int hid_set_field(struct hid_field *, unsigned, __s32); int hid_input_report(struct hid_device *, int type, u8 *, int, int); int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *); -void hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); +int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32); void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt); void hid_output_report(struct hid_report *report, __u8 *data); diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 8371b66..1ad56a7 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -78,7 +78,7 @@ enum hrtimer_cb_mode { * as otherwise the timer could be removed before the softirq code finishes the * the handling of the timer. * - * The HRTIMER_STATE_ENQUEUE bit is always or'ed to the current state to + * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. * * All state transitions are protected by cpu_base->lock. @@ -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 /* @@ -313,7 +316,7 @@ static inline u64 hrtimer_forward_now(struct hrtimer *timer, /* Precise sleep: */ extern long hrtimer_nanosleep(struct timespec *rqtp, - struct timespec *rmtp, + struct timespec __user *rmtp, const enum hrtimer_mode mode, const clockid_t clockid); extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 30d606a..addca4c 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -17,6 +17,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) } int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); +int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); @@ -32,8 +33,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to); void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); extern unsigned long max_huge_pages; +extern unsigned long sysctl_overcommit_huge_pages; extern unsigned long hugepages_treat_as_movable; -extern unsigned long nr_overcommit_huge_pages; extern const unsigned long hugetlb_zero, hugetlb_infinity; extern int sysctl_hugetlb_shm_group; 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/i2c/pca9539.h b/include/linux/i2c/pca953x.h index 611d84a..3c73612 100644 --- a/include/linux/i2c/pca9539.h +++ b/include/linux/i2c/pca953x.h @@ -1,6 +1,6 @@ /* platform data for the PCA9539 16-bit I/O expander driver */ -struct pca9539_platform_data { +struct pca953x_platform_data { /* number of the first GPIO */ unsigned gpio_base; diff --git a/include/linux/ide.h b/include/linux/ide.h index acec99d..a3b69c1 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -906,6 +906,8 @@ enum { IDE_TFLAG_IN_DEVICE, /* force 16-bit I/O operations */ IDE_TFLAG_IO_16BIT = (1 << 30), + /* ide_task_t was allocated using kmalloc() */ + IDE_TFLAG_DYN = (1 << 31), }; struct ide_taskfile { @@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); -/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ -#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI) +#ifdef CONFIG_BLK_DEV_IDEDMA_PCI void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); #else static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, @@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *); int ide_build_sglist(ide_drive_t *, struct request *); void ide_destroy_dmatable(ide_drive_t *); -#ifdef CONFIG_BLK_DEV_IDEDMA_PCI +#ifdef CONFIG_BLK_DEV_IDEDMA_SFF extern int ide_build_dmatable(ide_drive_t *, struct request *); extern int ide_release_dma(ide_hwif_t *); extern void ide_setup_dma(ide_hwif_t *, unsigned long); @@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *); extern int __ide_dma_end(ide_drive_t *); extern void ide_dma_lost_irq(ide_drive_t *); extern void ide_dma_timeout(ide_drive_t *); -#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ +#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ #else static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } @@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; } static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } #endif /* CONFIG_BLK_DEV_IDEDMA */ -#ifndef CONFIG_BLK_DEV_IDEDMA_PCI +#ifndef CONFIG_BLK_DEV_IDEDMA_SFF static inline void ide_release_dma(ide_hwif_t *drive) {;} #endif @@ -1294,7 +1295,7 @@ static inline void ide_dump_identify(u8 *id) static inline int hwif_to_node(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); - return dev ? pcibus_to_node(dev->bus) : -1; + return hwif->dev ? pcibus_to_node(dev->bus) : -1; } static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 34f40ef..79504b2 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -327,7 +327,7 @@ static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short t * * Returns error if the skb is not of VLAN type */ -static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) { struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; @@ -347,7 +347,8 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) * * Returns error if @skb->cb[] is not set correctly */ -static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) +static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, + unsigned short *tag) { struct vlan_skb_tx_cookie *cookie; @@ -370,7 +371,7 @@ static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *ta * * Returns error if the skb is not VLAN tagged */ -static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) { if (skb->dev->features & NETIF_F_HW_VLAN_TX) { return __vlan_hwaccel_get_tag(skb, tag); diff --git a/include/linux/init.h b/include/linux/init.h index 90cdbbb..a404a00 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -110,6 +110,7 @@ #define __FINIT .previous #define __INITDATA .section ".init.data","aw" +#define __FINITDATA .previous #define __DEVINIT .section ".devinit.text", "ax" #define __DEVINITDATA .section ".devinit.data", "aw" diff --git a/include/linux/input.h b/include/linux/input.h index 056a17a..1bdc39a 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -1020,7 +1020,6 @@ struct ff_effect { * @going_away: marks devices that are in a middle of unregistering and * causes input_open_device*() fail with -ENODEV. * @dev: driver model's view of this device - * @cdev: union for struct device pointer * @h_list: list of input handles associated with the device. When * accessing the list dev->mutex must be held * @node: used to place the device onto input_dev_list @@ -1085,9 +1084,6 @@ struct input_dev { int going_away; struct device dev; - union { /* temporarily so while we switching to struct device */ - struct device *dev; - } cdev; struct list_head h_list; struct list_head node; @@ -1311,6 +1307,9 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); } +int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); +int input_set_keycode(struct input_dev *dev, int scancode, int keycode); + extern struct class input_class; /** diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c3db4a0..f8ab4ce 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -273,8 +273,8 @@ asmlinkage void do_softirq(void); extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); extern void softirq_init(void); #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) -extern void FASTCALL(raise_softirq_irqoff(unsigned int nr)); -extern void FASTCALL(raise_softirq(unsigned int nr)); +extern void raise_softirq_irqoff(unsigned int nr); +extern void raise_softirq(unsigned int nr); /* Tasklets --- multithreaded analogue of BHs. @@ -341,7 +341,7 @@ static inline void tasklet_unlock_wait(struct tasklet_struct *t) #define tasklet_unlock(t) do { } while (0) #endif -extern void FASTCALL(__tasklet_schedule(struct tasklet_struct *t)); +extern void __tasklet_schedule(struct tasklet_struct *t); static inline void tasklet_schedule(struct tasklet_struct *t) { @@ -349,7 +349,7 @@ static inline void tasklet_schedule(struct tasklet_struct *t) __tasklet_schedule(t); } -extern void FASTCALL(__tasklet_hi_schedule(struct tasklet_struct *t)); +extern void __tasklet_hi_schedule(struct tasklet_struct *t); static inline void tasklet_hi_schedule(struct tasklet_struct *t) { @@ -444,4 +444,6 @@ static inline void init_irq_proc(void) } #endif +int show_interrupts(struct seq_file *p, void *v); + #endif diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 408696e..b882610 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h @@ -100,58 +100,6 @@ struct kern_ipc_perm void *security; }; -struct ipc_ids; -struct ipc_namespace { - struct kref kref; - struct ipc_ids *ids[3]; - - int sem_ctls[4]; - int used_sems; - - int msg_ctlmax; - int msg_ctlmnb; - int msg_ctlmni; - atomic_t msg_bytes; - atomic_t msg_hdrs; - - size_t shm_ctlmax; - size_t shm_ctlall; - int shm_ctlmni; - int shm_tot; -}; - -extern struct ipc_namespace init_ipc_ns; - -#ifdef CONFIG_SYSVIPC -#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, -extern void free_ipc_ns(struct kref *kref); -extern struct ipc_namespace *copy_ipcs(unsigned long flags, - struct ipc_namespace *ns); -#else -#define INIT_IPC_NS(ns) -static inline struct ipc_namespace *copy_ipcs(unsigned long flags, - struct ipc_namespace *ns) -{ - return ns; -} -#endif - -static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) -{ -#ifdef CONFIG_SYSVIPC - if (ns) - kref_get(&ns->kref); -#endif - return ns; -} - -static inline void put_ipc_ns(struct ipc_namespace *ns) -{ -#ifdef CONFIG_SYSVIPC - kref_put(&ns->kref, free_ipc_ns); -#endif -} - #endif /* __KERNEL__ */ #endif /* _LINUX_IPC_H */ diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h new file mode 100644 index 0000000..e4451d1 --- /dev/null +++ b/include/linux/ipc_namespace.h @@ -0,0 +1,81 @@ +#ifndef __IPC_NAMESPACE_H__ +#define __IPC_NAMESPACE_H__ + +#include <linux/err.h> +#include <linux/idr.h> +#include <linux/rwsem.h> + +struct ipc_ids { + int in_use; + unsigned short seq; + unsigned short seq_max; + struct rw_semaphore rw_mutex; + struct idr ipcs_idr; +}; + +struct ipc_namespace { + struct kref kref; + struct ipc_ids ids[3]; + + int sem_ctls[4]; + int used_sems; + + int msg_ctlmax; + int msg_ctlmnb; + int msg_ctlmni; + atomic_t msg_bytes; + atomic_t msg_hdrs; + + size_t shm_ctlmax; + size_t shm_ctlall; + int shm_ctlmni; + int shm_tot; +}; + +extern struct ipc_namespace init_ipc_ns; + +#ifdef CONFIG_SYSVIPC +#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, +#else +#define INIT_IPC_NS(ns) +#endif + +#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) +extern void free_ipc_ns(struct kref *kref); +extern struct ipc_namespace *copy_ipcs(unsigned long flags, + struct ipc_namespace *ns); +extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, + void (*free)(struct ipc_namespace *, + struct kern_ipc_perm *)); + +static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) +{ + if (ns) + kref_get(&ns->kref); + return ns; +} + +static inline void put_ipc_ns(struct ipc_namespace *ns) +{ + kref_put(&ns->kref, free_ipc_ns); +} +#else +static inline struct ipc_namespace *copy_ipcs(unsigned long flags, + struct ipc_namespace *ns) +{ + if (flags & CLONE_NEWIPC) + return ERR_PTR(-EINVAL); + + return ns; +} + +static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) +{ + return ns; +} + +static inline void put_ipc_ns(struct ipc_namespace *ns) +{ +} +#endif +#endif diff --git a/include/linux/irq.h b/include/linux/irq.h index 4669be0..176e5e7 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -25,7 +25,7 @@ #include <asm/irq_regs.h> struct irq_desc; -typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, +typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc); @@ -276,19 +276,18 @@ extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); * Built-in IRQ handlers for various IRQ types, * callable via desc->chip->handle_irq() */ -extern void fastcall handle_level_irq(unsigned int irq, struct irq_desc *desc); -extern void fastcall handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); -extern void fastcall handle_edge_irq(unsigned int irq, struct irq_desc *desc); -extern void fastcall handle_simple_irq(unsigned int irq, struct irq_desc *desc); -extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc); -extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); +extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); /* * Monolithic do_IRQ implementation. - * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) */ #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ -extern fastcall unsigned int __do_IRQ(unsigned int irq); +extern unsigned int __do_IRQ(unsigned int irq); #endif /* @@ -367,6 +366,9 @@ set_irq_chained_handler(unsigned int irq, __set_irq_handler(irq, handle, 1, NULL); } +extern void set_irq_noprobe(unsigned int irq); +extern void set_irq_probe(unsigned int irq); + /* Handle dynamic irq creation and destruction */ extern int create_irq(void); extern void destroy_irq(unsigned int irq); diff --git a/include/linux/isdn.h b/include/linux/isdn.h index d0ecc8e..9cb2855 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -507,7 +507,6 @@ typedef struct modem_info { struct ktermios normal_termios; /* For saving termios structs */ struct ktermios callout_termios; wait_queue_head_t open_wait, close_wait; - struct semaphore write_sem; spinlock_t readlock; } modem_info; diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 45b3d48..8f4c717 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h @@ -37,8 +37,6 @@ #define BOARD_COUNT 4 #define PORT_COUNT (BOARD_COUNT*16) -#define SERIAL_TYPE_NORMAL 1 - /* character sizes */ #define ISICOM_CS5 0x0000 diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 106a5e8..5a84fe9 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h @@ -71,7 +71,6 @@ struct stliport { wait_queue_head_t open_wait; wait_queue_head_t close_wait; wait_queue_head_t raw_wait; - struct work_struct tqhangup; struct asysigs asig; unsigned long addr; unsigned long rxoffset; diff --git a/include/linux/jbd.h b/include/linux/jbd.h index d9ecd13..b18fd3b 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -33,7 +33,6 @@ #include <linux/lockdep.h> #include <asm/semaphore.h> -#endif #define journal_oom_retry 1 @@ -84,7 +83,6 @@ static inline void jbd_free(void *ptr, size_t size) #define JFS_MIN_JOURNAL_BLOCKS 1024 -#ifdef __KERNEL__ /** * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. @@ -924,7 +922,6 @@ extern int journal_recover (journal_t *journal); extern int journal_wipe (journal_t *, int); extern int journal_skip_recovery (journal_t *); extern void journal_update_superblock (journal_t *, int); -extern void __journal_abort_hard (journal_t *); extern void journal_abort (journal_t *, int); extern int journal_errno (journal_t *); extern void journal_ack_err (journal_t *); diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 7ba9e47..e0b5b68 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -42,7 +42,7 @@ /* LATCH is used in the interval timer and ftape setup. */ #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ -/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can +/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, then we can * improve accuracy by shifting LSH bits, hence calculating: * (NOM << LSH) / DEN * This however means trouble for large NOM, because (NOM << LSH) may no @@ -160,7 +160,7 @@ extern unsigned long preset_lpj; * We want to do realistic conversions of time so we need to use the same * values the update wall clock code uses as the jiffies size. This value * is: TICK_NSEC (which is defined in timex.h). This - * is a constant and is in nanoseconds. We will used scaled math + * is a constant and is in nanoseconds. We will use scaled math * with a set of scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and * NSEC_JIFFIE_SC. Note that these defines contain nothing but * constants and so are computed at compile time. SHIFT_HZ (computed in @@ -204,7 +204,7 @@ extern unsigned long preset_lpj; * operator if the result is a long long AND at least one of the * operands is cast to long long (usually just prior to the "*" so as * not to confuse it into thinking it really has a 64-bit operand, - * which, buy the way, it can do, but it take more code and at least 2 + * which, buy the way, it can do, but it takes more code and at least 2 * mpys). * We also need to be aware that one second in nanoseconds is only a diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ff356b2..2df44e7 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -35,7 +35,7 @@ extern const char linux_proc_banner[]; #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) -#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) +#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) @@ -133,7 +133,7 @@ NORET_TYPE void panic(const char * fmt, ...) extern void oops_enter(void); extern void oops_exit(void); extern int oops_may_print(void); -fastcall NORET_TYPE void do_exit(long error_code) +NORET_TYPE void do_exit(long error_code) ATTRIB_NORET; NORET_TYPE void complete_and_exit(struct completion *, long) ATTRIB_NORET; @@ -141,6 +141,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int); extern long simple_strtol(const char *,char **,unsigned int); extern unsigned long long simple_strtoull(const char *,char **,unsigned int); extern long long simple_strtoll(const char *,char **,unsigned int); +extern int strict_strtoul(const char *, unsigned int, unsigned long *); +extern int strict_strtol(const char *, unsigned int, long *); +extern int strict_strtoull(const char *, unsigned int, unsigned long long *); +extern int strict_strtoll(const char *, unsigned int, long long *); extern int sprintf(char * buf, const char * fmt, ...) __attribute__ ((format (printf, 2, 3))); extern int vsprintf(char *buf, const char *, va_list) @@ -172,8 +176,6 @@ extern int kernel_text_address(unsigned long addr); struct pid; extern struct pid *session_of_pgrp(struct pid *pgrp); -extern void dump_thread(struct pt_regs *regs, struct user *dump); - #ifdef CONFIG_PRINTK asmlinkage int vprintk(const char *fmt, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -182,6 +184,13 @@ asmlinkage int printk(const char * fmt, ...) extern int log_buf_get_len(void); extern int log_buf_read(int idx); extern int log_buf_copy(char *dest, int idx, int len); + +extern int printk_ratelimit_jiffies; +extern int printk_ratelimit_burst; +extern int printk_ratelimit(void); +extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); +extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, + unsigned int interval_msec); #else static inline int vprintk(const char *s, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -192,6 +201,12 @@ static inline int __cold printk(const char *s, ...) { return 0; } static inline int log_buf_get_len(void) { return 0; } static inline int log_buf_read(int idx) { return 0; } static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } +static inline int printk_ratelimit(void) { return 0; } +static inline int __printk_ratelimit(int ratelimit_jiffies, \ + int ratelimit_burst) { return 0; } +static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ + unsigned int interval_msec) \ + { return false; } #endif extern void __attribute__((format(printf, 1, 2))) @@ -199,11 +214,6 @@ extern void __attribute__((format(printf, 1, 2))) unsigned long int_sqrt(unsigned long); -extern int printk_ratelimit(void); -extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); -extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, - unsigned int interval_msec); - static inline void console_silent(void) { console_loglevel = 0; @@ -224,6 +234,7 @@ extern int panic_on_unrecovered_nmi; extern int tainted; extern const char *print_tainted(void); extern void add_taint(unsigned); +extern int root_mountflags; /* Values used for system_state */ extern enum system_states { @@ -243,6 +254,7 @@ extern enum system_states { #define TAINT_BAD_PAGE (1<<5) #define TAINT_USER (1<<6) #define TAINT_DIE (1<<7) +#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) extern void dump_stack(void) __cold; diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2d9c448..3265968 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -127,17 +127,21 @@ void vmcoreinfo_append_str(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); unsigned long paddr_vmcoreinfo_note(void); +#define VMCOREINFO_OSRELEASE(name) \ + vmcoreinfo_append_str("OSRELEASE=%s\n", #name) +#define VMCOREINFO_PAGESIZE(value) \ + vmcoreinfo_append_str("PAGESIZE=%ld\n", value) #define VMCOREINFO_SYMBOL(name) \ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) #define VMCOREINFO_SIZE(name) \ vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ - (unsigned long)sizeof(struct name)) -#define VMCOREINFO_TYPEDEF_SIZE(name) \ - vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ (unsigned long)sizeof(name)) +#define VMCOREINFO_STRUCT_SIZE(name) \ + vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ + (unsigned long)sizeof(struct name)) #define VMCOREINFO_OFFSET(name, field) \ vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ - (unsigned long)&(((struct name *)0)->field)) + (unsigned long)offsetof(struct name, field)) #define VMCOREINFO_LENGTH(name, value) \ vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) #define VMCOREINFO_NUMBER(name) \ diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 6168c0a..4a6ce82 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -152,8 +152,10 @@ static inline int arch_trampoline_kprobe(struct kprobe *p) struct kretprobe { struct kprobe kp; kretprobe_handler_t handler; + kretprobe_handler_t entry_handler; int maxactive; int nmissed; + size_t data_size; struct hlist_head free_instances; struct hlist_head used_instances; }; @@ -164,6 +166,7 @@ struct kretprobe_instance { struct kretprobe *rp; kprobe_opcode_t *ret_addr; struct task_struct *task; + char data[0]; }; struct kretprobe_blackpoint { diff --git a/include/linux/ktime.h b/include/linux/ktime.h index a6ddec1..2cd7fa7 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -310,13 +310,16 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) return ktime_sub_ns(kt, usec * 1000); } +extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); + /* * The resolution of the clocks. The resolution value is returned in * the clock_getres() system call to give application programmers an * 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/leds.h b/include/linux/leds.h index 00f89fd..0201f6f 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -38,6 +38,11 @@ struct led_classdev { void (*brightness_set)(struct led_classdev *led_cdev, enum led_brightness brightness); + /* Activate hardware accelerated blink */ + int (*blink_set)(struct led_classdev *led_cdev, + unsigned long *delay_on, + unsigned long *delay_off); + struct device *dev; struct list_head node; /* LED Device list */ char *default_trigger; /* Trigger to use */ diff --git a/include/linux/libata.h b/include/linux/libata.h index 4374c42..bc5a8d0 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -457,7 +457,6 @@ struct ata_queued_cmd { unsigned long flags; /* ATA_QCFLAG_xxx */ unsigned int tag; unsigned int n_elem; - unsigned int n_iter; unsigned int mapped_n_elem; int dma_dir; @@ -1367,7 +1366,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; qc->n_elem = 0; qc->mapped_n_elem = 0; - qc->n_iter = 0; qc->err_mask = 0; qc->pad_len = 0; qc->last_sg = NULL; diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 3faf599..0592936 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -73,9 +73,4 @@ #define ATTRIB_NORET __attribute__((noreturn)) #define NORET_AND noreturn, -#ifndef FASTCALL -#define FASTCALL(x) x -#define fastcall -#endif - #endif diff --git a/include/linux/log2.h b/include/linux/log2.h index c8cf5e8..25b8086 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n) __rounddown_pow_of_two(n) \ ) +/** + * order_base_2 - calculate the (rounded up) base 2 order of the argument + * @n: parameter + * + * The first few values calculated by this routine: + * ob2(0) = 0 + * ob2(1) = 0 + * ob2(2) = 1 + * ob2(3) = 2 + * ob2(4) = 2 + * ob2(5) = 3 + * ... and so on. + */ + +#define order_base_2(n) ilog2(roundup_pow_of_two(n)) + #endif /* _LINUX_LOG2_H */ diff --git a/include/linux/loop.h b/include/linux/loop.h index 26a0a10..46169a7 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h @@ -76,6 +76,7 @@ struct loop_device { enum { LO_FLAGS_READ_ONLY = 1, LO_FLAGS_USE_AOPS = 2, + LO_FLAGS_AUTOCLEAR = 4, }; #include <asm/posix_types.h> /* for __kernel_old_dev_t */ diff --git a/include/linux/lp.h b/include/linux/lp.h index 7059b6b..0df024b 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -99,7 +99,7 @@ #ifdef __KERNEL__ #include <linux/wait.h> -#include <asm/semaphore.h> +#include <linux/mutex.h> /* Magic numbers for defining port-device mappings */ #define LP_PARPORT_UNSPEC -4 @@ -145,7 +145,7 @@ struct lp_struct { #endif wait_queue_head_t waitq; unsigned int last_error; - struct semaphore port_mutex; + struct mutex port_mutex; wait_queue_head_t dataq; long timeout; unsigned int best_mode; diff --git a/include/linux/maple.h b/include/linux/maple.h index bad9a7b..3f01e2b 100644 --- a/include/linux/maple.h +++ b/include/linux/maple.h @@ -7,74 +7,74 @@ extern struct bus_type maple_bus_type; /* Maple Bus command and response codes */ enum maple_code { - MAPLE_RESPONSE_FILEERR = -5, - MAPLE_RESPONSE_AGAIN = -4, /* request should be retransmitted */ - MAPLE_RESPONSE_BADCMD = -3, - MAPLE_RESPONSE_BADFUNC = -2, - MAPLE_RESPONSE_NONE = -1, /* unit didn't respond at all */ - MAPLE_COMMAND_DEVINFO = 1, - MAPLE_COMMAND_ALLINFO = 2, - MAPLE_COMMAND_RESET = 3, - MAPLE_COMMAND_KILL = 4, - MAPLE_RESPONSE_DEVINFO = 5, - MAPLE_RESPONSE_ALLINFO = 6, - MAPLE_RESPONSE_OK = 7, - MAPLE_RESPONSE_DATATRF = 8, - MAPLE_COMMAND_GETCOND = 9, - MAPLE_COMMAND_GETMINFO = 10, - MAPLE_COMMAND_BREAD = 11, - MAPLE_COMMAND_BWRITE = 12, - MAPLE_COMMAND_SETCOND = 14 + MAPLE_RESPONSE_FILEERR = -5, + MAPLE_RESPONSE_AGAIN = -4, /* request should be retransmitted */ + MAPLE_RESPONSE_BADCMD = -3, + MAPLE_RESPONSE_BADFUNC = -2, + MAPLE_RESPONSE_NONE = -1, /* unit didn't respond at all */ + MAPLE_COMMAND_DEVINFO = 1, + MAPLE_COMMAND_ALLINFO = 2, + MAPLE_COMMAND_RESET = 3, + MAPLE_COMMAND_KILL = 4, + MAPLE_RESPONSE_DEVINFO = 5, + MAPLE_RESPONSE_ALLINFO = 6, + MAPLE_RESPONSE_OK = 7, + MAPLE_RESPONSE_DATATRF = 8, + MAPLE_COMMAND_GETCOND = 9, + MAPLE_COMMAND_GETMINFO = 10, + MAPLE_COMMAND_BREAD = 11, + MAPLE_COMMAND_BWRITE = 12, + MAPLE_COMMAND_SETCOND = 14 }; struct mapleq { - struct list_head list; - struct maple_device *dev; - void *sendbuf, *recvbuf, *recvbufdcsp; - unsigned char length; - enum maple_code command; + struct list_head list; + struct maple_device *dev; + void *sendbuf, *recvbuf, *recvbufdcsp; + unsigned char length; + enum maple_code command; }; struct maple_devinfo { - unsigned long function; - unsigned long function_data[3]; - unsigned char area_code; - unsigned char connector_directon; - char product_name[31]; - char product_licence[61]; - unsigned short standby_power; - unsigned short max_power; + unsigned long function; + unsigned long function_data[3]; + unsigned char area_code; + unsigned char connector_direction; + char product_name[31]; + char product_licence[61]; + unsigned short standby_power; + unsigned short max_power; }; struct maple_device { - struct maple_driver *driver; - struct mapleq *mq; - void *private_data; - void (*callback) (struct mapleq * mq); - unsigned long when, interval, function; - struct maple_devinfo devinfo; - unsigned char port, unit; - char product_name[32]; - char product_licence[64]; - int registered; - struct device dev; + struct maple_driver *driver; + struct mapleq *mq; + void *private_data; + void (*callback) (struct mapleq * mq); + unsigned long when, interval, function; + struct maple_devinfo devinfo; + unsigned char port, unit; + char product_name[32]; + char product_licence[64]; + struct device dev; }; struct maple_driver { - unsigned long function; - int (*connect) (struct maple_device * dev); - void (*disconnect) (struct maple_device * dev); - struct device_driver drv; + unsigned long function; + int (*connect) (struct maple_device * dev); + void (*disconnect) (struct maple_device * dev); + struct device_driver drv; + int registered; }; void maple_getcond_callback(struct maple_device *dev, - void (*callback) (struct mapleq * mq), - unsigned long interval, - unsigned long function); + void (*callback) (struct mapleq * mq), + unsigned long interval, + unsigned long function); int maple_driver_register(struct device_driver *drv); void maple_add_packet(struct mapleq *mq); #define to_maple_dev(n) container_of(n, struct maple_device, dev) #define to_maple_driver(n) container_of(n, struct maple_driver, drv) -#endif /* __LINUX_MAPLE_H */ +#endif /* __LINUX_MAPLE_H */ diff --git a/include/linux/marker.h b/include/linux/marker.h index 5f36cf9..5df879d 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h @@ -19,16 +19,23 @@ struct marker; /** * marker_probe_func - Type of a marker probe function - * @mdata: pointer of type struct marker - * @private_data: caller site private data + * @probe_private: probe private data + * @call_private: call site private data * @fmt: format string - * @...: variable argument list + * @args: variable argument list pointer. Use a pointer to overcome C's + * inability to pass this around as a pointer in a portable manner in + * the callee otherwise. * * Type of marker probe functions. They receive the mdata and need to parse the * format string to recover the variable argument list. */ -typedef void marker_probe_func(const struct marker *mdata, - void *private_data, const char *fmt, ...); +typedef void marker_probe_func(void *probe_private, void *call_private, + const char *fmt, va_list *args); + +struct marker_probe_closure { + marker_probe_func *func; /* Callback */ + void *probe_private; /* Private probe data */ +}; struct marker { const char *name; /* Marker name */ @@ -36,8 +43,11 @@ struct marker { * variable argument list. */ char state; /* Marker state. */ - marker_probe_func *call;/* Probe handler function pointer */ - void *private; /* Private probe data */ + char ptype; /* probe type : 0 : single, 1 : multi */ + void (*call)(const struct marker *mdata, /* Probe wrapper */ + void *call_private, const char *fmt, ...); + struct marker_probe_closure single; + struct marker_probe_closure *multi; } __attribute__((aligned(8))); #ifdef CONFIG_MARKERS @@ -49,35 +59,31 @@ struct marker { * not add unwanted padding between the beginning of the section and the * structure. Force alignment to the same alignment as the section start. */ -#define __trace_mark(name, call_data, format, args...) \ +#define __trace_mark(name, call_private, format, args...) \ do { \ - static const char __mstrtab_name_##name[] \ - __attribute__((section("__markers_strings"))) \ - = #name; \ - static const char __mstrtab_format_##name[] \ + static const char __mstrtab_##name[] \ __attribute__((section("__markers_strings"))) \ - = format; \ + = #name "\0" format; \ static struct marker __mark_##name \ __attribute__((section("__markers"), aligned(8))) = \ - { __mstrtab_name_##name, __mstrtab_format_##name, \ - 0, __mark_empty_function, NULL }; \ + { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \ + 0, 0, marker_probe_cb, \ + { __mark_empty_function, NULL}, NULL }; \ __mark_check_format(format, ## args); \ if (unlikely(__mark_##name.state)) { \ - preempt_disable(); \ (*__mark_##name.call) \ - (&__mark_##name, call_data, \ + (&__mark_##name, call_private, \ format, ## args); \ - preempt_enable(); \ } \ } while (0) extern void marker_update_probe_range(struct marker *begin, - struct marker *end, struct module *probe_module, int *refcount); + struct marker *end); #else /* !CONFIG_MARKERS */ -#define __trace_mark(name, call_data, format, args...) \ +#define __trace_mark(name, call_private, format, args...) \ __mark_check_format(format, ## args) static inline void marker_update_probe_range(struct marker *begin, - struct marker *end, struct module *probe_module, int *refcount) + struct marker *end) { } #endif /* CONFIG_MARKERS */ @@ -92,8 +98,6 @@ static inline void marker_update_probe_range(struct marker *begin, #define trace_mark(name, format, args...) \ __trace_mark(name, NULL, format, ## args) -#define MARK_MAX_FORMAT_LEN 1024 - /** * MARK_NOARGS - Format string for a marker with no argument. */ @@ -106,24 +110,30 @@ static inline void __printf(1, 2) __mark_check_format(const char *fmt, ...) extern marker_probe_func __mark_empty_function; +extern void marker_probe_cb(const struct marker *mdata, + void *call_private, const char *fmt, ...); +extern void marker_probe_cb_noarg(const struct marker *mdata, + void *call_private, const char *fmt, ...); + /* * Connect a probe to a marker. * private data pointer must be a valid allocated memory address, or NULL. */ extern int marker_probe_register(const char *name, const char *format, - marker_probe_func *probe, void *private); + marker_probe_func *probe, void *probe_private); /* * Returns the private data given to marker_probe_register. */ -extern void *marker_probe_unregister(const char *name); +extern int marker_probe_unregister(const char *name, + marker_probe_func *probe, void *probe_private); /* * Unregister a marker by providing the registered private data. */ -extern void *marker_probe_unregister_private_data(void *private); +extern int marker_probe_unregister_private_data(marker_probe_func *probe, + void *probe_private); -extern int marker_arm(const char *name); -extern int marker_disarm(const char *name); -extern void *marker_get_private_data(const char *name); +extern void *marker_get_private_data(const char *name, marker_probe_func *probe, + int num); #endif diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h new file mode 100644 index 0000000..925d57b --- /dev/null +++ b/include/linux/memcontrol.h @@ -0,0 +1,188 @@ +/* memcontrol.h - Memory Controller + * + * Copyright IBM Corporation, 2007 + * Author Balbir Singh <balbir@linux.vnet.ibm.com> + * + * Copyright 2007 OpenVZ SWsoft Inc + * Author: Pavel Emelianov <xemul@openvz.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _LINUX_MEMCONTROL_H +#define _LINUX_MEMCONTROL_H + +#include <linux/rcupdate.h> +#include <linux/mm.h> + +struct mem_cgroup; +struct page_cgroup; +struct page; +struct mm_struct; + +#ifdef CONFIG_CGROUP_MEM_CONT + +extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); +extern void mm_free_cgroup(struct mm_struct *mm); +extern void page_assign_page_cgroup(struct page *page, + struct page_cgroup *pc); +extern struct page_cgroup *page_get_page_cgroup(struct page *page); +extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, + gfp_t gfp_mask); +extern void mem_cgroup_uncharge(struct page_cgroup *pc); +extern void mem_cgroup_uncharge_page(struct page *page); +extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active); +extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, + struct list_head *dst, + unsigned long *scanned, int order, + int mode, struct zone *z, + struct mem_cgroup *mem_cont, + int active); +extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); +extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, + gfp_t gfp_mask); +int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); + +#define vm_match_cgroup(mm, cgroup) \ + ((cgroup) == rcu_dereference((mm)->mem_cgroup)) + +extern int mem_cgroup_prepare_migration(struct page *page); +extern void mem_cgroup_end_migration(struct page *page); +extern void mem_cgroup_page_migration(struct page *page, struct page *newpage); + +/* + * For memory reclaim. + */ +extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem); +extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem); + +extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem); +extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, + int priority); +extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, + int priority); + +extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, + struct zone *zone, int priority); +extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, + struct zone *zone, int priority); + +#else /* CONFIG_CGROUP_MEM_CONT */ +static inline void mm_init_cgroup(struct mm_struct *mm, + struct task_struct *p) +{ +} + +static inline void mm_free_cgroup(struct mm_struct *mm) +{ +} + +static inline void page_assign_page_cgroup(struct page *page, + struct page_cgroup *pc) +{ +} + +static inline struct page_cgroup *page_get_page_cgroup(struct page *page) +{ + return NULL; +} + +static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, + gfp_t gfp_mask) +{ + return 0; +} + +static inline void mem_cgroup_uncharge(struct page_cgroup *pc) +{ +} + +static inline void mem_cgroup_uncharge_page(struct page *page) +{ +} + +static inline void mem_cgroup_move_lists(struct page_cgroup *pc, + bool active) +{ +} + +static inline int mem_cgroup_cache_charge(struct page *page, + struct mm_struct *mm, + gfp_t gfp_mask) +{ + return 0; +} + +static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) +{ + return 1; +} + +static inline int task_in_mem_cgroup(struct task_struct *task, + const struct mem_cgroup *mem) +{ + return 1; +} + +static inline int mem_cgroup_prepare_migration(struct page *page) +{ + return 0; +} + +static inline void mem_cgroup_end_migration(struct page *page) +{ +} + +static inline void +mem_cgroup_page_migration(struct page *page, struct page *newpage) +{ +} + +static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem) +{ + return 0; +} + +static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem) +{ + return 0; +} + +static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) +{ + return 0; +} + +static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, + int priority) +{ +} + +static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, + int priority) +{ +} + +static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, + struct zone *zone, int priority) +{ + return 0; +} + +static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, + struct zone *zone, int priority) +{ + return 0; +} +#endif /* CONFIG_CGROUP_MEM_CONT */ + +#endif /* _LINUX_MEMCONTROL_H */ + diff --git a/include/linux/memstick.h b/include/linux/memstick.h new file mode 100644 index 0000000..334d059 --- /dev/null +++ b/include/linux/memstick.h @@ -0,0 +1,299 @@ +/* + * Sony MemoryStick support + * + * Copyright (C) 2007 Alex Dubov <oakad@yahoo.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. + * + */ + +#ifndef _MEMSTICK_H +#define _MEMSTICK_H + +#include <linux/workqueue.h> +#include <linux/scatterlist.h> +#include <linux/device.h> + +/*** Hardware based structures ***/ + +struct ms_status_register { + unsigned char reserved; + unsigned char interrupt; +#define MEMSTICK_INT_CMDNAK 0x0001 +#define MEMSTICK_INT_BREQ 0x0020 +#define MEMSTICK_INT_ERR 0x0040 +#define MEMSTICK_INT_CED 0x0080 + + unsigned char status0; +#define MEMSTICK_STATUS0_WP 0x0001 +#define MEMSTICK_STATUS0_SL 0x0002 +#define MEMSTICK_STATUS0_BF 0x0010 +#define MEMSTICK_STATUS0_BE 0x0020 +#define MEMSTICK_STATUS0_FB0 0x0040 +#define MEMSTICK_STATUS0_MB 0x0080 + + unsigned char status1; +#define MEMSTICK_STATUS1_UCFG 0x0001 +#define MEMSTICK_STATUS1_FGER 0x0002 +#define MEMSTICK_STATUS1_UCEX 0x0004 +#define MEMSTICK_STATUS1_EXER 0x0008 +#define MEMSTICK_STATUS1_UCDT 0x0010 +#define MEMSTICK_STATUS1_DTER 0x0020 +#define MEMSTICK_STATUS1_FBI 0x0040 +#define MEMSTICK_STATUS1_MB 0x0080 +} __attribute__((packed)); + +struct ms_id_register { + unsigned char type; + unsigned char reserved; + unsigned char category; + unsigned char class; +} __attribute__((packed)); + +struct ms_param_register { + unsigned char system; + unsigned char block_address_msb; + unsigned short block_address; + unsigned char cp; +#define MEMSTICK_CP_BLOCK 0x0000 +#define MEMSTICK_CP_PAGE 0x0020 +#define MEMSTICK_CP_EXTRA 0x0040 +#define MEMSTICK_CP_OVERWRITE 0x0080 + + unsigned char page_address; +} __attribute__((packed)); + +struct ms_extra_data_register { + unsigned char overwrite_flag; +#define MEMSTICK_OVERWRITE_UPDATA 0x0010 +#define MEMSTICK_OVERWRITE_PAGE 0x0060 +#define MEMSTICK_OVERWRITE_BLOCK 0x0080 + + unsigned char management_flag; +#define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 +#define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 +#define MEMSTICK_MANAGEMENT_COPY 0x0010 +#define MEMSTICK_MANAGEMENT_ACCESS 0x0020 + + unsigned short logical_address; +} __attribute__((packed)); + +struct ms_register { + struct ms_status_register status; + struct ms_id_register id; + unsigned char reserved[8]; + struct ms_param_register param; + struct ms_extra_data_register extra_data; +} __attribute__((packed)); + +struct mspro_param_register { + unsigned char system; + unsigned short data_count; + unsigned int data_address; + unsigned char cmd_param; +} __attribute__((packed)); + +struct mspro_register { + struct ms_status_register status; + struct ms_id_register id; + unsigned char reserved[8]; + struct mspro_param_register param; +} __attribute__((packed)); + +struct ms_register_addr { + unsigned char r_offset; + unsigned char r_length; + unsigned char w_offset; + unsigned char w_length; +} __attribute__((packed)); + +enum { + MS_TPC_READ_LONG_DATA = 0x02, + MS_TPC_READ_SHORT_DATA = 0x03, + MS_TPC_READ_REG = 0x04, + MS_TPC_READ_IO_DATA = 0x05, /* unverified */ + MS_TPC_GET_INT = 0x07, + MS_TPC_SET_RW_REG_ADRS = 0x08, + MS_TPC_EX_SET_CMD = 0x09, + MS_TPC_WRITE_IO_DATA = 0x0a, /* unverified */ + MS_TPC_WRITE_REG = 0x0b, + MS_TPC_WRITE_SHORT_DATA = 0x0c, + MS_TPC_WRITE_LONG_DATA = 0x0d, + MS_TPC_SET_CMD = 0x0e +}; + +enum { + MS_CMD_BLOCK_END = 0x33, + MS_CMD_RESET = 0x3c, + MS_CMD_BLOCK_WRITE = 0x55, + MS_CMD_SLEEP = 0x5a, + MS_CMD_BLOCK_ERASE = 0x99, + MS_CMD_BLOCK_READ = 0xaa, + MS_CMD_CLEAR_BUF = 0xc3, + MS_CMD_FLASH_STOP = 0xcc, + MSPRO_CMD_FORMAT = 0x10, + MSPRO_CMD_SLEEP = 0x11, + MSPRO_CMD_READ_DATA = 0x20, + MSPRO_CMD_WRITE_DATA = 0x21, + MSPRO_CMD_READ_ATRB = 0x24, + MSPRO_CMD_STOP = 0x25, + MSPRO_CMD_ERASE = 0x26, + MSPRO_CMD_SET_IBA = 0x46, + MSPRO_CMD_SET_IBD = 0x47 +/* + MSPRO_CMD_RESET + MSPRO_CMD_WAKEUP + MSPRO_CMD_IN_IO_DATA + MSPRO_CMD_OUT_IO_DATA + MSPRO_CMD_READ_IO_ATRB + MSPRO_CMD_IN_IO_FIFO + MSPRO_CMD_OUT_IO_FIFO + MSPRO_CMD_IN_IOM + MSPRO_CMD_OUT_IOM +*/ +}; + +/*** Driver structures and functions ***/ + +#define MEMSTICK_PART_SHIFT 3 + +enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; + +#define MEMSTICK_POWER_OFF 0 +#define MEMSTICK_POWER_ON 1 + +#define MEMSTICK_SERIAL 0 +#define MEMSTICK_PARALLEL 1 + +struct memstick_host; +struct memstick_driver; + +#define MEMSTICK_MATCH_ALL 0x01 + +#define MEMSTICK_TYPE_LEGACY 0xff +#define MEMSTICK_TYPE_DUO 0x00 +#define MEMSTICK_TYPE_PRO 0x01 + +#define MEMSTICK_CATEGORY_STORAGE 0xff +#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 + +#define MEMSTICK_CLASS_GENERIC 0xff +#define MEMSTICK_CLASS_GENERIC_DUO 0x00 + + +struct memstick_device_id { + unsigned char match_flags; + unsigned char type; + unsigned char category; + unsigned char class; +}; + +struct memstick_request { + unsigned char tpc; + unsigned char data_dir:1, + need_card_int:1, + get_int_reg:1, + io_type:2; +#define MEMSTICK_IO_NONE 0 +#define MEMSTICK_IO_VAL 1 +#define MEMSTICK_IO_SG 2 + + unsigned char int_reg; + int error; + union { + struct scatterlist sg; + struct { + unsigned char data_len; + unsigned char data[15]; + }; + }; +}; + +struct memstick_dev { + struct memstick_device_id id; + struct memstick_host *host; + struct ms_register_addr reg_addr; + struct completion mrq_complete; + struct memstick_request current_mrq; + + /* Check that media driver is still willing to operate the device. */ + int (*check)(struct memstick_dev *card); + /* Get next request from the media driver. */ + int (*next_request)(struct memstick_dev *card, + struct memstick_request **mrq); + + struct device dev; +}; + +struct memstick_host { + struct mutex lock; + unsigned int id; + unsigned int caps; +#define MEMSTICK_CAP_PARALLEL 1 +#define MEMSTICK_CAP_AUTO_GET_INT 2 + + struct work_struct media_checker; + struct class_device cdev; + + struct memstick_dev *card; + unsigned int retries; + + /* Notify the host that some requests are pending. */ + void (*request)(struct memstick_host *host); + /* Set host IO parameters (power, clock, etc). */ + void (*set_param)(struct memstick_host *host, + enum memstick_param param, + int value); + unsigned long private[0] ____cacheline_aligned; +}; + +struct memstick_driver { + struct memstick_device_id *id_table; + int (*probe)(struct memstick_dev *card); + void (*remove)(struct memstick_dev *card); + int (*suspend)(struct memstick_dev *card, + pm_message_t state); + int (*resume)(struct memstick_dev *card); + + struct device_driver driver; +}; + +int memstick_register_driver(struct memstick_driver *drv); +void memstick_unregister_driver(struct memstick_driver *drv); + +struct memstick_host *memstick_alloc_host(unsigned int extra, + struct device *dev); + +int memstick_add_host(struct memstick_host *host); +void memstick_remove_host(struct memstick_host *host); +void memstick_free_host(struct memstick_host *host); +void memstick_detect_change(struct memstick_host *host); + +void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, + struct scatterlist *sg); +void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, + void *buf, size_t length); +int memstick_next_req(struct memstick_host *host, + struct memstick_request **mrq); +void memstick_new_req(struct memstick_host *host); + +int memstick_set_rw_addr(struct memstick_dev *card); + +static inline void *memstick_priv(struct memstick_host *host) +{ + return (void *)host->private; +} + +static inline void *memstick_get_drvdata(struct memstick_dev *card) +{ + return dev_get_drvdata(&card->dev); +} + +static inline void memstick_set_drvdata(struct memstick_dev *card, void *data) +{ + dev_set_drvdata(&card->dev, data); +} + +#endif diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h new file mode 100644 index 0000000..4ab2162 --- /dev/null +++ b/include/linux/mfd/asic3.h @@ -0,0 +1,497 @@ +/* + * include/linux/mfd/asic3.h + * + * Compaq ASIC3 headers. + * + * 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. + * + * Copyright 2001 Compaq Computer Corporation. + * Copyright 2007 OpendHand. + */ + +#ifndef __ASIC3_H__ +#define __ASIC3_H__ + +#include <linux/types.h> + +struct asic3 { + void __iomem *mapping; + unsigned int bus_shift; + unsigned int irq_nr; + unsigned int irq_base; + spinlock_t lock; + u16 irq_bothedge[4]; + struct device *dev; +}; + +struct asic3_platform_data { + struct { + u32 dir; + u32 init; + u32 sleep_mask; + u32 sleep_out; + u32 batt_fault_out; + u32 sleep_conf; + u32 alt_function; + } gpio_a, gpio_b, gpio_c, gpio_d; + + unsigned int bus_shift; + + unsigned int irq_base; + + struct platform_device **children; + unsigned int n_children; +}; + +int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio); +void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); + +#define ASIC3_NUM_GPIO_BANKS 4 +#define ASIC3_GPIOS_PER_BANK 16 +#define ASIC3_NUM_GPIOS 64 +#define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 + +#define ASIC3_GPIO_BANK_A 0 +#define ASIC3_GPIO_BANK_B 1 +#define ASIC3_GPIO_BANK_C 2 +#define ASIC3_GPIO_BANK_D 3 + +#define ASIC3_GPIO(bank, gpio) \ + ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio)) +#define ASIC3_GPIO_bit(gpio) (1 << (gpio & 0xf)) +/* All offsets below are specified with this address bus shift */ +#define ASIC3_DEFAULT_ADDR_SHIFT 2 + +#define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg) +#define ASIC3_GPIO_OFFSET(base, reg) \ + (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg) + +#define ASIC3_GPIO_A_Base 0x0000 +#define ASIC3_GPIO_B_Base 0x0100 +#define ASIC3_GPIO_C_Base 0x0200 +#define ASIC3_GPIO_D_Base 0x0300 + +#define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */ +#define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */ +#define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */ +#define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */ +#define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */ +#define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */ +#define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */ +#define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */ +#define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */ +#define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */ +#define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */ +#define ASIC3_GPIO_SleepConf 0x2c /* + * R/W bit 1: autosleep + * 0: disable gposlpout in normal mode, + * enable gposlpout in sleep mode. + */ +#define ASIC3_GPIO_Status 0x30 /* R Pin status */ + +#define ASIC3_SPI_Base 0x0400 +#define ASIC3_SPI_Control 0x0000 +#define ASIC3_SPI_TxData 0x0004 +#define ASIC3_SPI_RxData 0x0008 +#define ASIC3_SPI_Int 0x000c +#define ASIC3_SPI_Status 0x0010 + +#define SPI_CONTROL_SPR(clk) ((clk) & 0x0f) /* Clock rate */ + +#define ASIC3_PWM_0_Base 0x0500 +#define ASIC3_PWM_1_Base 0x0600 +#define ASIC3_PWM_TimeBase 0x0000 +#define ASIC3_PWM_PeriodTime 0x0004 +#define ASIC3_PWM_DutyTime 0x0008 + +#define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ +#define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ + +#define ASIC3_LED_0_Base 0x0700 +#define ASIC3_LED_1_Base 0x0800 +#define ASIC3_LED_2_Base 0x0900 +#define ASIC3_LED_TimeBase 0x0000 /* R/W 7 bits */ +#define ASIC3_LED_PeriodTime 0x0004 /* R/W 12 bits */ +#define ASIC3_LED_DutyTime 0x0008 /* R/W 12 bits */ +#define ASIC3_LED_AutoStopCount 0x000c /* R/W 16 bits */ + +/* LED TimeBase bits - match ASIC2 */ +#define LED_TBS 0x0f /* Low 4 bits sets time base, max = 13 */ + /* Note: max = 5 on hx4700 */ + /* 0: maximum time base */ + /* 1: maximum time base / 2 */ + /* n: maximum time base / 2^n */ + +#define LED_EN (1 << 4) /* LED ON/OFF 0:off, 1:on */ +#define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ +#define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ + +#define ASIC3_CLOCK_Base 0x0A00 +#define ASIC3_CLOCK_CDEX 0x00 +#define ASIC3_CLOCK_SEL 0x04 + +#define CLOCK_CDEX_SOURCE (1 << 0) /* 2 bits */ +#define CLOCK_CDEX_SOURCE0 (1 << 0) +#define CLOCK_CDEX_SOURCE1 (1 << 1) +#define CLOCK_CDEX_SPI (1 << 2) +#define CLOCK_CDEX_OWM (1 << 3) +#define CLOCK_CDEX_PWM0 (1 << 4) +#define CLOCK_CDEX_PWM1 (1 << 5) +#define CLOCK_CDEX_LED0 (1 << 6) +#define CLOCK_CDEX_LED1 (1 << 7) +#define CLOCK_CDEX_LED2 (1 << 8) + +/* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */ +#define CLOCK_CDEX_SD_HOST (1 << 9) /* R/W: SD host clock source */ +#define CLOCK_CDEX_SD_BUS (1 << 10) /* R/W: SD bus clock source ctrl */ +#define CLOCK_CDEX_SMBUS (1 << 11) +#define CLOCK_CDEX_CONTROL_CX (1 << 12) + +#define CLOCK_CDEX_EX0 (1 << 13) /* R/W: 32.768 kHz crystal */ +#define CLOCK_CDEX_EX1 (1 << 14) /* R/W: 24.576 MHz crystal */ + +#define CLOCK_SEL_SD_HCLK_SEL (1 << 0) /* R/W: SDIO host clock select */ +#define CLOCK_SEL_SD_BCLK_SEL (1 << 1) /* R/W: SDIO bus clock select */ + +/* R/W: INT clock source control (32.768 kHz) */ +#define CLOCK_SEL_CX (1 << 2) + + +#define ASIC3_INTR_Base 0x0B00 + +#define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */ +#define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */ +#define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */ +#define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */ + +#define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ +#define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ +#define ASIC3_INTMASK_MASK0 (1 << 2) +#define ASIC3_INTMASK_MASK1 (1 << 3) +#define ASIC3_INTMASK_MASK2 (1 << 4) +#define ASIC3_INTMASK_MASK3 (1 << 5) +#define ASIC3_INTMASK_MASK4 (1 << 6) +#define ASIC3_INTMASK_MASK5 (1 << 7) + +#define ASIC3_INTR_PERIPHERAL_A (1 << 0) +#define ASIC3_INTR_PERIPHERAL_B (1 << 1) +#define ASIC3_INTR_PERIPHERAL_C (1 << 2) +#define ASIC3_INTR_PERIPHERAL_D (1 << 3) +#define ASIC3_INTR_LED0 (1 << 4) +#define ASIC3_INTR_LED1 (1 << 5) +#define ASIC3_INTR_LED2 (1 << 6) +#define ASIC3_INTR_SPI (1 << 7) +#define ASIC3_INTR_SMBUS (1 << 8) +#define ASIC3_INTR_OWM (1 << 9) + +#define ASIC3_INTR_CPS(x) ((x)&0x0f) /* 4 bits, max 14 */ +#define ASIC3_INTR_CPS_SET (1 << 4) /* Time base enable */ + + +/* Basic control of the SD ASIC */ +#define ASIC3_SDHWCTRL_Base 0x0E00 +#define ASIC3_SDHWCTRL_SDConf 0x00 + +#define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ +#define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ +#define ASIC3_SDHWCTRL_PCLR (1 << 2) /* All registers of SDIO cleared */ +#define ASIC3_SDHWCTRL_LEVCD (1 << 3) /* SD card detection: 0:low */ + +/* SD card write protection: 0=high */ +#define ASIC3_SDHWCTRL_LEVWP (1 << 4) +#define ASIC3_SDHWCTRL_SDLED (1 << 5) /* SD card LED signal 0=disable */ + +/* SD card power supply ctrl 1=enable */ +#define ASIC3_SDHWCTRL_SDPWR (1 << 6) + +#define ASIC3_EXTCF_Base 0x1100 + +#define ASIC3_EXTCF_Select 0x00 +#define ASIC3_EXTCF_Reset 0x04 + +#define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ +#define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ +#define ASIC3_EXTCF_SMOD2 (1 << 2) /* slot number of mode 2 */ +#define ASIC3_EXTCF_OWM_EN (1 << 4) /* enable onewire module */ +#define ASIC3_EXTCF_OWM_SMB (1 << 5) /* OWM bus selection */ +#define ASIC3_EXTCF_OWM_RESET (1 << 6) /* ?? used by OWM and CF */ +#define ASIC3_EXTCF_CF0_SLEEP_MODE (1 << 7) /* CF0 sleep state */ +#define ASIC3_EXTCF_CF1_SLEEP_MODE (1 << 8) /* CF1 sleep state */ +#define ASIC3_EXTCF_CF0_PWAIT_EN (1 << 10) /* CF0 PWAIT_n control */ +#define ASIC3_EXTCF_CF1_PWAIT_EN (1 << 11) /* CF1 PWAIT_n control */ +#define ASIC3_EXTCF_CF0_BUF_EN (1 << 12) /* CF0 buffer control */ +#define ASIC3_EXTCF_CF1_BUF_EN (1 << 13) /* CF1 buffer control */ +#define ASIC3_EXTCF_SD_MEM_ENABLE (1 << 14) +#define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ + +/********************************************* + * The Onewire interface registers + * + * OWM_CMD + * OWM_DAT + * OWM_INTR + * OWM_INTEN + * OWM_CLKDIV + * + *********************************************/ + +#define ASIC3_OWM_Base 0xC00 + +#define ASIC3_OWM_CMD 0x00 +#define ASIC3_OWM_DAT 0x04 +#define ASIC3_OWM_INTR 0x08 +#define ASIC3_OWM_INTEN 0x0C +#define ASIC3_OWM_CLKDIV 0x10 + +#define ASIC3_OWM_CMD_ONEWR (1 << 0) +#define ASIC3_OWM_CMD_SRA (1 << 1) +#define ASIC3_OWM_CMD_DQO (1 << 2) +#define ASIC3_OWM_CMD_DQI (1 << 3) + +#define ASIC3_OWM_INTR_PD (1 << 0) +#define ASIC3_OWM_INTR_PDR (1 << 1) +#define ASIC3_OWM_INTR_TBE (1 << 2) +#define ASIC3_OWM_INTR_TEMP (1 << 3) +#define ASIC3_OWM_INTR_RBF (1 << 4) + +#define ASIC3_OWM_INTEN_EPD (1 << 0) +#define ASIC3_OWM_INTEN_IAS (1 << 1) +#define ASIC3_OWM_INTEN_ETBE (1 << 2) +#define ASIC3_OWM_INTEN_ETMT (1 << 3) +#define ASIC3_OWM_INTEN_ERBF (1 << 4) + +#define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */ +#define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */ + + +/***************************************************************************** + * The SD configuration registers are at a completely different location + * in memory. They are divided into three sets of registers: + * + * SD_CONFIG Core configuration register + * SD_CTRL Control registers for SD operations + * SDIO_CTRL Control registers for SDIO operations + * + *****************************************************************************/ +#define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */ + +#define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */ + +/* [0:8] SD Control Register Base Address */ +#define ASIC3_SD_CONFIG_Addr0 0x20 + +/* [9:31] SD Control Register Base Address */ +#define ASIC3_SD_CONFIG_Addr1 0x24 + +/* R/O: interrupt assigned to pin */ +#define ASIC3_SD_CONFIG_IntPin 0x78 + +/* + * Set to 0x1f to clock SD controller, 0 otherwise. + * At 0x82 - Gated Clock Ctrl + */ +#define ASIC3_SD_CONFIG_ClkStop 0x80 + +/* Control clock of SD controller */ +#define ASIC3_SD_CONFIG_ClockMode 0x84 +#define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */ +#define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */ + +/* auto power up after card inserted */ +#define ASIC3_SD_CONFIG_SDHC_Power2 0x92 + +/* auto power down when card removed */ +#define ASIC3_SD_CONFIG_SDHC_Power3 0x94 +#define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98 +#define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */ +#define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */ +#define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/ + +/* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */ +#define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8 +#define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */ + +/* Bit 1: double buffer/single buffer */ +#define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0 + +/* Memory access enable (set to 1 to access SD Controller) */ +#define SD_CONFIG_COMMAND_MAE (1<<1) + +#define SD_CONFIG_CLK_ENABLE_ALL 0x1f + +#define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */ +#define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */ + + /* two bits - number of cycles for card detection */ +#define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3) + + +#define ASIC3_SD_CTRL_Base 0x1000 + +#define ASIC3_SD_CTRL_Cmd 0x00 +#define ASIC3_SD_CTRL_Arg0 0x08 +#define ASIC3_SD_CTRL_Arg1 0x0C +#define ASIC3_SD_CTRL_StopInternal 0x10 +#define ASIC3_SD_CTRL_TransferSectorCount 0x14 +#define ASIC3_SD_CTRL_Response0 0x18 +#define ASIC3_SD_CTRL_Response1 0x1C +#define ASIC3_SD_CTRL_Response2 0x20 +#define ASIC3_SD_CTRL_Response3 0x24 +#define ASIC3_SD_CTRL_Response4 0x28 +#define ASIC3_SD_CTRL_Response5 0x2C +#define ASIC3_SD_CTRL_Response6 0x30 +#define ASIC3_SD_CTRL_Response7 0x34 +#define ASIC3_SD_CTRL_CardStatus 0x38 +#define ASIC3_SD_CTRL_BufferCtrl 0x3C +#define ASIC3_SD_CTRL_IntMaskCard 0x40 +#define ASIC3_SD_CTRL_IntMaskBuffer 0x44 +#define ASIC3_SD_CTRL_CardClockCtrl 0x48 +#define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C +#define ASIC3_SD_CTRL_MemCardOptionSetup 0x50 +#define ASIC3_SD_CTRL_ErrorStatus0 0x58 +#define ASIC3_SD_CTRL_ErrorStatus1 0x5C +#define ASIC3_SD_CTRL_DataPort 0x60 +#define ASIC3_SD_CTRL_TransactionCtrl 0x68 +#define ASIC3_SD_CTRL_SoftwareReset 0x1C0 + +#define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0) + +#define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8) + +#define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15) +#define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0) +#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0) + +#define MEM_CARD_OPTION_REQUIRED 0x000e +#define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4) +#define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14) +#define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15) +#define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0 + +#define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f) +#define SD_CTRL_COMMAND_TYPE_CMD (0 << 6) +#define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6) +#define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6) +#define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8) +#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8) +#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8) +#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8) +#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8) +#define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11) +#define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12) +#define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12) +#define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13) +#define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14) + +#define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0) +#define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8) + +#define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0) +#define SD_CTRL_CARDSTATUS_RW_END (1 << 2) +#define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3) +#define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4) +#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5) +#define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7) +#define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8) +#define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9) +#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10) + +#define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0) +#define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1) +#define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2) +#define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3) +#define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4) +#define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5) +#define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6) +#define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7) +#define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8) +#define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9) +#define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13) +#define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14) +#define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15) + +#define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0) +#define SD_CTRL_INTMASKCARD_RW_END (1 << 2) +#define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3) +#define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4) +#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5) +#define SD_CTRL_INTMASKCARD_UNK6 (1 << 6) +#define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7) +#define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8) +#define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9) +#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10) + +#define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0) +#define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1) +#define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2) +#define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3) +#define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4) +#define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5) +#define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6) +#define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7) +#define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8) +#define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9) +#define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13) +#define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14) +#define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15) + +#define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0) +#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2) +#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3) +#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4) +#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5) +#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8) +#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9) +#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10) +#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11) + +#define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0) +#define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4) +#define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5) +#define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6) + +#define ASIC3_SDIO_CTRL_Base 0x1200 + +#define ASIC3_SDIO_CTRL_Cmd 0x00 +#define ASIC3_SDIO_CTRL_CardPortSel 0x04 +#define ASIC3_SDIO_CTRL_Arg0 0x08 +#define ASIC3_SDIO_CTRL_Arg1 0x0C +#define ASIC3_SDIO_CTRL_TransferBlockCount 0x14 +#define ASIC3_SDIO_CTRL_Response0 0x18 +#define ASIC3_SDIO_CTRL_Response1 0x1C +#define ASIC3_SDIO_CTRL_Response2 0x20 +#define ASIC3_SDIO_CTRL_Response3 0x24 +#define ASIC3_SDIO_CTRL_Response4 0x28 +#define ASIC3_SDIO_CTRL_Response5 0x2C +#define ASIC3_SDIO_CTRL_Response6 0x30 +#define ASIC3_SDIO_CTRL_Response7 0x34 +#define ASIC3_SDIO_CTRL_CardStatus 0x38 +#define ASIC3_SDIO_CTRL_BufferCtrl 0x3C +#define ASIC3_SDIO_CTRL_IntMaskCard 0x40 +#define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44 +#define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C +#define ASIC3_SDIO_CTRL_CardOptionSetup 0x50 +#define ASIC3_SDIO_CTRL_ErrorStatus0 0x54 +#define ASIC3_SDIO_CTRL_ErrorStatus1 0x58 +#define ASIC3_SDIO_CTRL_DataPort 0x60 +#define ASIC3_SDIO_CTRL_TransactionCtrl 0x68 +#define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C +#define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70 +#define ASIC3_SDIO_CTRL_HostInformation 0x74 +#define ASIC3_SDIO_CTRL_ErrorCtrl 0x78 +#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C +#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 + +#define ASIC3_MAP_SIZE 0x2000 + +#endif /* __ASIC3_H__ */ diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 222815d..6cdf813 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -133,6 +133,11 @@ enum { MLX4_STAT_RATE_OFFSET = 5 }; +static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) +{ + return (major << 32) | (minor << 16) | subminor; +} + struct mlx4_caps { u64 fw_ver; int num_ports; @@ -189,10 +194,8 @@ struct mlx4_buf_list { }; struct mlx4_buf { - union { - struct mlx4_buf_list direct; - struct mlx4_buf_list *page_list; - } u; + struct mlx4_buf_list direct; + struct mlx4_buf_list *page_list; int nbufs; int npages; int page_shift; @@ -308,6 +311,14 @@ struct mlx4_init_port_param { int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, struct mlx4_buf *buf); void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); +static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) +{ + if (BITS_PER_LONG == 64 || buf->nbufs == 1) + return buf->direct.buf + offset; + else + return buf->page_list[offset >> PAGE_SHIFT].buf + + (offset & (PAGE_SIZE - 1)); +} int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 3968b94..09a2230 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h @@ -154,7 +154,11 @@ struct mlx4_qp_context { u32 reserved5[10]; }; +/* Which firmware version adds support for NEC (NoErrorCompletion) bit */ +#define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) + enum { + MLX4_WQE_CTRL_NEC = 1 << 29, MLX4_WQE_CTRL_FENCE = 1 << 6, MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, MLX4_WQE_CTRL_SOLICITED = 1 << 1, diff --git a/include/linux/mm.h b/include/linux/mm.h index 89d7c69..26c7124 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -786,7 +786,7 @@ int __set_page_dirty_nobuffers(struct page *page); int __set_page_dirty_no_writeback(struct page *page); int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page); -int FASTCALL(set_page_dirty(struct page *page)); +int set_page_dirty(struct page *page); int set_page_dirty_lock(struct page *page); int clear_page_dirty_for_io(struct page *page); @@ -829,7 +829,7 @@ extern void unregister_shrinker(struct shrinker *); int vma_wants_writenotify(struct vm_area_struct *vma); -extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); +extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); #ifdef __PAGETABLE_PUD_FOLDED static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, @@ -894,6 +894,18 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ +static inline void pgtable_page_ctor(struct page *page) +{ + pte_lock_init(page); + inc_zone_page_state(page, NR_PAGETABLE); +} + +static inline void pgtable_page_dtor(struct page *page) +{ + pte_lock_deinit(page); + dec_zone_page_state(page, NR_PAGETABLE); +} + #define pte_offset_map_lock(mm, pmd, address, ptlp) \ ({ \ spinlock_t *__ptl = pte_lockptr(mm, pmd); \ @@ -1136,7 +1148,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, #define FOLL_GET 0x04 /* do get_page on page */ #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ -typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr, +typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, void *data); extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index f4c03e0..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 { @@ -88,6 +91,9 @@ struct page { void *virtual; /* Kernel virtual address (NULL if not kmapped, ie. highmem) */ #endif /* WANT_PAGE_VIRTUAL */ +#ifdef CONFIG_CGROUP_MEM_CONT + unsigned long page_cgroup; +#endif }; /* @@ -219,6 +225,9 @@ struct mm_struct { /* aio bits */ rwlock_t ioctx_list_lock; struct kioctx *ioctx_list; +#ifdef CONFIG_CGROUP_MEM_CONT + struct mem_cgroup *mem_cgroup; +#endif }; #endif /* _LINUX_MM_TYPES_H */ diff --git a/include/linux/module.h b/include/linux/module.h index ac481e2..819c4e8 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -449,7 +449,7 @@ static inline void __module_get(struct module *module) /* For kallsyms to ask for address resolution. namebuf should be at * least KSYM_NAME_LEN long: a pointer to namebuf is returned if * found, otherwise NULL. */ -char *module_address_lookup(unsigned long addr, +const char *module_address_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, @@ -465,7 +465,7 @@ int unregister_module_notifier(struct notifier_block * nb); extern void print_modules(void); -extern void module_update_markers(struct module *probe_module, int *refcount); +extern void module_update_markers(void); #else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL(sym) @@ -519,7 +519,7 @@ static inline void module_put(struct module *module) #define module_name(mod) "kernel" /* For kallsyms to ask for address resolution. NULL means not found. */ -static inline char *module_address_lookup(unsigned long addr, +static inline const char *module_address_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, @@ -567,8 +567,7 @@ static inline void print_modules(void) { } -static inline void module_update_markers(struct module *probe_module, - int *refcount) +static inline void module_update_markers(void) { } diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 8126e55..ec62438 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -62,6 +62,16 @@ struct kparam_array void *elem; }; +/* On alpha, ia64 and ppc64 relocations to global data cannot go into + read-only sections (which is part of respective UNIX ABI on these + platforms). So 'const' makes no sense and even causes compile failures + with some compilers. */ +#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) +#define __moduleparam_const +#else +#define __moduleparam_const const +#endif + /* This is the fundamental function for registering boot/module parameters. perm sets the visibility in sysfs: 000 means it's not there, read bits mean it's readable, write bits mean it's @@ -71,7 +81,7 @@ struct kparam_array static int __param_perm_check_##name __attribute__((unused)) = \ BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ static const char __param_str_##name[] = prefix #name; \ - static struct kernel_param const __param_##name \ + static struct kernel_param __moduleparam_const __param_##name \ __used \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, { arg } } diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index e17c534..b0ddf4b 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -98,6 +98,18 @@ static inline int cfi_interleave_supported(int i) #define CFI_DEVICETYPE_X32 (32 / 8) #define CFI_DEVICETYPE_X64 (64 / 8) + +/* Device Interface Code Assignments from the "Common Flash Memory Interface + * Publication 100" dated December 1, 2001. + */ +#define CFI_INTERFACE_X8_ASYNC 0x0000 +#define CFI_INTERFACE_X16_ASYNC 0x0001 +#define CFI_INTERFACE_X8_BY_X16_ASYNC 0x0002 +#define CFI_INTERFACE_X32_ASYNC 0x0003 +#define CFI_INTERFACE_X16_BY_X32_ASYNC 0x0005 +#define CFI_INTERFACE_NOT_ALLOWED 0xffff + + /* NB: We keep these structures in memory in HOST byteorder, except * where individually noted. */ diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 783fc98..0a13bb3 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -152,6 +152,15 @@ struct mtd_info { int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); + /* In blackbox flight recorder like scenarios we want to make successful + writes in interrupt context. panic_write() is only intended to be + called when its known the kernel is about to panic and we need the + write to succeed. Since the kernel is not going to be running for much + longer, this function can break locks and delay to ensure the write + succeeds (but not sleep). */ + + int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); + int (*read_oob) (struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops); int (*write_oob) (struct mtd_info *mtd, loff_t to, diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h new file mode 100644 index 0000000..04fdc07 --- /dev/null +++ b/include/linux/mtd/mtdram.h @@ -0,0 +1,8 @@ +#ifndef __MTD_MTDRAM_H__ +#define __MTD_MTDRAM_H__ + +#include <linux/mtd/mtd.h> +int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, + unsigned long size, char *name); + +#endif /* __MTD_MTDRAM_H__ */ diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index c46161f..d1b310c 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h @@ -67,6 +67,7 @@ /* * Device ID Register F001h (R) */ +#define ONENAND_DEVICE_DENSITY_MASK (0xf) #define ONENAND_DEVICE_DENSITY_SHIFT (4) #define ONENAND_DEVICE_IS_DDP (1 << 3) #define ONENAND_DEVICE_IS_DEMUX (1 << 2) diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index da6b3d6..7c37d7e 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -71,5 +71,12 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types, #define put_partition_parser(p) do { module_put((p)->owner); } while(0) -#endif +struct device; +struct device_node; + +int __devinit of_mtd_parse_partitions(struct device *dev, + struct mtd_info *mtd, + struct device_node *node, + struct mtd_partition **pparts); +#endif diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 3d967b6..f71201d 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h @@ -26,23 +26,6 @@ #include <mtd/ubi-user.h> /* - * UBI data type hint constants. - * - * UBI_LONGTERM: long-term data - * UBI_SHORTTERM: short-term data - * UBI_UNKNOWN: data persistence is unknown - * - * These constants are used when data is written to UBI volumes in order to - * help the UBI wear-leveling unit to find more appropriate physical - * eraseblocks. - */ -enum { - UBI_LONGTERM = 1, - UBI_SHORTTERM, - UBI_UNKNOWN -}; - -/* * enum ubi_open_mode - UBI volume open mode constants. * * UBI_READONLY: read-only mode @@ -167,6 +150,7 @@ int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, int len, int dtype); int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); +int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); /* diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h index 2537285..731d77d 100644 --- a/include/linux/mutex-debug.h +++ b/include/linux/mutex-debug.h @@ -18,6 +18,6 @@ do { \ __mutex_init((mutex), #mutex, &__key); \ } while (0) -extern void FASTCALL(mutex_destroy(struct mutex *lock)); +extern void mutex_destroy(struct mutex *lock); #endif diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 05c5903..bc6da10 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -112,7 +112,7 @@ extern void __mutex_init(struct mutex *lock, const char *name, * * Returns 1 if the mutex is locked, 0 if unlocked. */ -static inline int fastcall mutex_is_locked(struct mutex *lock) +static inline int mutex_is_locked(struct mutex *lock) { return atomic_read(&lock->count) != 1; } @@ -132,9 +132,9 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) #else -extern void fastcall mutex_lock(struct mutex *lock); -extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock); -extern int __must_check fastcall mutex_lock_killable(struct mutex *lock); +extern void mutex_lock(struct mutex *lock); +extern int __must_check mutex_lock_interruptible(struct mutex *lock); +extern int __must_check mutex_lock_killable(struct mutex *lock); # define mutex_lock_nested(lock, subclass) mutex_lock(lock) # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) @@ -145,7 +145,7 @@ extern int __must_check fastcall mutex_lock_killable(struct mutex *lock); * NOTE: mutex_trylock() follows the spin_trylock() convention, * not the down_trylock() convention! */ -extern int fastcall mutex_trylock(struct mutex *lock); -extern void fastcall mutex_unlock(struct mutex *lock); +extern int mutex_trylock(struct mutex *lock); +extern void mutex_unlock(struct mutex *lock); #endif diff --git a/include/linux/namei.h b/include/linux/namei.h index 4cb4f8d..24d88e9 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -3,6 +3,7 @@ #include <linux/dcache.h> #include <linux/linkage.h> +#include <linux/path.h> struct vfsmount; @@ -15,8 +16,7 @@ struct open_intent { enum { MAX_NESTED_LINKS = 8 }; struct nameidata { - struct dentry *dentry; - struct vfsmount *mnt; + struct path path; struct qstr last; unsigned int flags; int last_type; @@ -29,11 +29,6 @@ struct nameidata { } intent; }; -struct path { - struct vfsmount *mnt; - struct dentry *dentry; -}; - /* * Type of the last component on LOOKUP_PARENT */ @@ -62,17 +57,15 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; #define LOOKUP_ACCESS (0x0400) #define LOOKUP_CHDIR (0x0800) -extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); -extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); +extern int __user_walk(const char __user *, unsigned, struct nameidata *); +extern int __user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *); #define user_path_walk(name,nd) \ __user_walk_fd(AT_FDCWD, name, LOOKUP_FOLLOW, nd) #define user_path_walk_link(name,nd) \ __user_walk_fd(AT_FDCWD, name, 0, nd) -extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); +extern int path_lookup(const char *, unsigned, struct nameidata *); extern int vfs_path_lookup(struct dentry *, struct vfsmount *, const char *, unsigned int, struct nameidata *); -extern void path_release(struct nameidata *); -extern void path_release_on_umount(struct nameidata *); extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); diff --git a/include/linux/nbd.h b/include/linux/nbd.h index cc2b472..9865720 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -35,7 +35,6 @@ enum { }; #define nbd_cmd(req) ((req)->cmd[0]) -#define MAX_NBD 128 /* userspace doesn't need the nbd_device structure */ #ifdef __KERNEL__ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 047d432..a2f0032 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -322,7 +322,7 @@ enum NAPI_STATE_DISABLE, /* Disable pending */ }; -extern void FASTCALL(__napi_schedule(struct napi_struct *n)); +extern void __napi_schedule(struct napi_struct *n); static inline int napi_disable_pending(struct napi_struct *n) { @@ -604,6 +604,10 @@ struct net_device unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ + /* ingress path synchronizer */ + spinlock_t ingress_lock; + struct Qdisc *qdisc_ingress; + /* * Cache line mostly used on queue transmit path (qdisc) */ @@ -617,10 +621,6 @@ struct net_device /* Partially transmitted GSO packet. */ struct sk_buff *gso_skb; - /* ingress path synchronizer */ - spinlock_t ingress_lock; - struct Qdisc *qdisc_ingress; - /* * One part is mostly used on xmit path (device) */ diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 3a16872..5431512 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -84,9 +84,8 @@ struct svc_export { struct cache_head h; struct auth_domain * ex_client; int ex_flags; - struct vfsmount * ex_mnt; - struct dentry * ex_dentry; - char * ex_path; + struct path ex_path; + char *ex_pathname; uid_t ex_anon_uid; gid_t ex_anon_gid; int ex_fsid; @@ -107,8 +106,7 @@ struct svc_expkey { int ek_fsidtype; u32 ek_fsid[6]; - struct vfsmount * ek_mnt; - struct dentry * ek_dentry; + struct path ek_path; }; #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) diff --git a/include/linux/of.h b/include/linux/of.h index b5f33ef..6981016 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from, extern struct device_node *of_find_node_by_path(const char *path); extern struct device_node *of_find_node_by_phandle(phandle handle); extern struct device_node *of_get_parent(const struct device_node *node); +extern struct device_node *of_get_next_parent(struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); #define for_each_child_of_node(parent, child) \ diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 4b62a10..d2fca80 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -156,10 +156,10 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); } -extern void FASTCALL(__lock_page(struct page *page)); -extern int FASTCALL(__lock_page_killable(struct page *page)); -extern void FASTCALL(__lock_page_nosync(struct page *page)); -extern void FASTCALL(unlock_page(struct page *page)); +extern void __lock_page(struct page *page); +extern int __lock_page_killable(struct page *page); +extern void __lock_page_nosync(struct page *page); +extern void unlock_page(struct page *page); /* * lock_page may only be called if we have the page's inode pinned. @@ -199,7 +199,7 @@ static inline void lock_page_nosync(struct page *page) * This is exported only for wait_on_page_locked/wait_on_page_writeback. * Never use this directly! */ -extern void FASTCALL(wait_on_page_bit(struct page *page, int bit_nr)); +extern void wait_on_page_bit(struct page *page, int bit_nr); /* * Wait for a page to be unlocked. diff --git a/include/linux/path.h b/include/linux/path.h new file mode 100644 index 0000000..915e0c3 --- /dev/null +++ b/include/linux/path.h @@ -0,0 +1,15 @@ +#ifndef _LINUX_PATH_H +#define _LINUX_PATH_H + +struct dentry; +struct vfsmount; + +struct path { + struct vfsmount *mnt; + struct dentry *dentry; +}; + +extern void path_get(struct path *); +extern void path_put(struct path *); + +#endif /* _LINUX_PATH_H */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 7215d3b..87195b6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -301,14 +301,14 @@ struct pci_ops { int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); }; -struct pci_raw_ops { - int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 *val); - int (*write)(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 val); -}; - -extern struct pci_raw_ops *raw_pci_ops; +/* + * ACPI needs to be able to access PCI config space before we've done a + * PCI bus scan and created pci_bus structures. + */ +extern int raw_pci_read(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 *val); +extern int raw_pci_write(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 val); struct pci_bus_region { resource_size_t start; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 39d3283..df6dd79a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1765,6 +1765,7 @@ #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 +#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278 #define PCI_VENDOR_ID_SEALEVEL 0x135e #define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 50faa0e..1ac9697 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -54,7 +54,7 @@ #ifdef CONFIG_SMP struct percpu_data { - void *ptrs[NR_CPUS]; + void *ptrs[1]; }; #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 6db69ff..700725d 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h @@ -298,6 +298,7 @@ struct sadb_x_sec_ctx { #define SADB_X_EALG_BLOWFISHCBC 7 #define SADB_EALG_NULL 11 #define SADB_X_EALG_AESCBC 12 +#define SADB_X_EALG_AESCTR 13 #define SADB_X_EALG_AES_CCM_ICV8 14 #define SADB_X_EALG_AES_CCM_ICV12 15 #define SADB_X_EALG_AES_CCM_ICV16 16 diff --git a/include/linux/pid.h b/include/linux/pid.h index e29a900..c798081 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -79,10 +79,9 @@ static inline struct pid *get_pid(struct pid *pid) return pid; } -extern void FASTCALL(put_pid(struct pid *pid)); -extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); -extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, - enum pid_type)); +extern void put_pid(struct pid *pid); +extern struct task_struct *pid_task(struct pid *pid, enum pid_type); +extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type); extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); @@ -90,11 +89,11 @@ extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); * attach_pid() and detach_pid() must be called with the tasklist_lock * write-held. */ -extern int FASTCALL(attach_pid(struct task_struct *task, - enum pid_type type, struct pid *pid)); -extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); -extern void FASTCALL(transfer_pid(struct task_struct *old, - struct task_struct *new, enum pid_type)); +extern int attach_pid(struct task_struct *task, enum pid_type type, + struct pid *pid); +extern void detach_pid(struct task_struct *task, enum pid_type); +extern void transfer_pid(struct task_struct *old, struct task_struct *new, + enum pid_type); struct pid_namespace; extern struct pid_namespace init_pid_ns; @@ -109,7 +108,7 @@ extern struct pid_namespace init_pid_ns; * * see also find_task_by_pid() set in include/linux/sched.h */ -extern struct pid *FASTCALL(find_pid_ns(int nr, struct pid_namespace *ns)); +extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns); extern struct pid *find_vpid(int nr); extern struct pid *find_pid(int nr); @@ -118,18 +117,17 @@ extern struct pid *find_pid(int nr); */ extern struct pid *find_get_pid(int nr); extern struct pid *find_ge_pid(int nr, struct pid_namespace *); +int next_pidmap(struct pid_namespace *pid_ns, int last); extern struct pid *alloc_pid(struct pid_namespace *ns); -extern void FASTCALL(free_pid(struct pid *pid)); -extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); +extern void free_pid(struct pid *pid); /* * the helpers to get the pid's id seen from different namespaces * * pid_nr() : global id, i.e. the id seen from the init namespace; - * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid - * belongs to. this only makes sence when called in the - * context of the task that belongs to the same namespace; + * pid_vnr() : virtual id, i.e. the id seen from the pid namespace of + * current. * pid_nr_ns() : id seen from the ns specified. * * see also task_xid_nr() etc in include/linux/sched.h @@ -144,14 +142,7 @@ static inline pid_t pid_nr(struct pid *pid) } pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns); - -static inline pid_t pid_vnr(struct pid *pid) -{ - pid_t nr = 0; - if (pid) - nr = pid->numbers[pid->level].nr; - return nr; -} +pid_t pid_vnr(struct pid *pid); #define do_each_pid_task(pid, type, task) \ do { \ @@ -160,7 +151,13 @@ static inline pid_t pid_vnr(struct pid *pid) hlist_for_each_entry_rcu((task), pos___, \ &pid->tasks[type], pids[type].node) { + /* + * Both old and new leaders may be attached to + * the same pid in the middle of de_thread(). + */ #define while_each_pid_task(pid, type, task) \ + if (type == PIDTYPE_PID) \ + break; \ } \ } while (0) diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 1689e28..fcd61fa 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -39,6 +39,7 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); extern void free_pid_ns(struct kref *kref); +extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); static inline void put_pid_ns(struct pid_namespace *ns) { @@ -66,6 +67,11 @@ static inline void put_pid_ns(struct pid_namespace *ns) { } + +static inline void zap_pid_ns_processes(struct pid_namespace *ns) +{ + BUG(); +} #endif /* CONFIG_PID_NS */ static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 40fac8c..28dfc61c 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h @@ -348,6 +348,7 @@ enum FLOW_KEY_RTCLASSID, FLOW_KEY_SKUID, FLOW_KEY_SKGID, + FLOW_KEY_VLAN_TAG, __FLOW_KEY_MAX, }; diff --git a/include/linux/pnp.h b/include/linux/pnp.h index b9339d8..cd6332b 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -258,6 +258,7 @@ extern struct pnp_protocol isapnp_protocol; #else #define pnp_device_is_isapnp(dev) 0 #endif +extern struct mutex pnp_res_mutex; #ifdef CONFIG_PNPBIOS extern struct pnp_protocol pnpbios_protocol; diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5cbf3e3..68ed19c 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -94,6 +94,7 @@ enum power_supply_property { /* Properties of type `const char *' */ POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, + POWER_SUPPLY_PROP_SERIAL_NUMBER, }; enum power_supply_type { diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 484988e..23f0c54 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -11,8 +11,8 @@ #include <linux/list.h> #ifdef CONFIG_DEBUG_PREEMPT - extern void fastcall add_preempt_count(int val); - extern void fastcall sub_preempt_count(int val); + extern void add_preempt_count(int val); + extern void sub_preempt_count(int val); #else # define add_preempt_count(val) do { preempt_count() += (val); } while (0) # define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e435515..d9a9e71 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -118,13 +118,17 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); unsigned long task_vsize(struct mm_struct *); int task_statm(struct mm_struct *, int *, int *, int *, int *); -char *task_mem(struct mm_struct *, char *); +void task_mem(struct seq_file *, struct mm_struct *); +void clear_refs_smap(struct mm_struct *mm); struct proc_dir_entry *de_get(struct proc_dir_entry *de); void de_put(struct proc_dir_entry *de); extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent); +struct proc_dir_entry *proc_create(const char *name, mode_t mode, + struct proc_dir_entry *parent, + const struct file_operations *proc_fops); extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); extern struct vfsmount *proc_mnt; @@ -219,7 +223,12 @@ static inline void proc_flush_task(struct task_struct *task) static inline struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return NULL; } - +static inline struct proc_dir_entry *proc_create(const char *name, + mode_t mode, struct proc_dir_entry *parent, + const struct file_operations *proc_fops) +{ + return NULL; +} #define remove_proc_entry(name, parent) do {} while (0) static inline struct proc_dir_entry *proc_symlink(const char *name, @@ -260,8 +269,11 @@ extern void kclist_add(struct kcore_list *, void *, size_t); #endif union proc_op { - int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); + int (*proc_get_link)(struct inode *, struct path *); int (*proc_read)(struct task_struct *task, char *page); + int (*proc_show)(struct seq_file *m, + struct pid_namespace *ns, struct pid *pid, + struct task_struct *task); }; struct proc_inode { diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 515bff0..ebe0c17 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -67,7 +67,6 @@ #define PT_TRACE_EXEC 0x00000080 #define PT_TRACE_VFORK_DONE 0x00000100 #define PT_TRACE_EXIT 0x00000200 -#define PT_ATTACHED 0x00000400 /* parent != real_parent */ #define PT_TRACE_MASK 0x000003f4 @@ -204,6 +203,41 @@ static inline void user_enable_block_step(struct task_struct *task) } #endif /* arch_has_block_step */ +#ifndef arch_ptrace_stop_needed +/** + * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called + * @code: current->exit_code value ptrace will stop with + * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with + * + * This is called with the siglock held, to decide whether or not it's + * necessary to release the siglock and call arch_ptrace_stop() with the + * same @code and @info arguments. It can be defined to a constant if + * arch_ptrace_stop() is never required, or always is. On machines where + * this makes sense, it should be defined to a quick test to optimize out + * calling arch_ptrace_stop() when it would be superfluous. For example, + * if the thread has not been back to user mode since the last stop, the + * thread state might indicate that nothing needs to be done. + */ +#define arch_ptrace_stop_needed(code, info) (0) +#endif + +#ifndef arch_ptrace_stop +/** + * arch_ptrace_stop - Do machine-specific work before stopping for ptrace + * @code: current->exit_code value ptrace will stop with + * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with + * + * This is called with no locks held when arch_ptrace_stop_needed() has + * just returned nonzero. It is allowed to block, e.g. for user memory + * access. The arch can have machine-specific work to be done before + * ptrace stops. On ia64, register backing store gets written back to user + * memory here. Since this can be costly (requires dropping the siglock), + * we only do it when the arch requires it for this particular stop, as + * indicated by arch_ptrace_stop_needed(). + */ +#define arch_ptrace_stop(code, info) do { } while (0) +#endif + #endif #endif diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 19bc9b8..34a196e 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h @@ -110,6 +110,7 @@ struct qnx4_inode_info { struct inode vfs_inode; }; +extern struct inode *qnx4_iget(struct super_block *, unsigned long); extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); extern unsigned long qnx4_count_free_blocks(struct super_block *sb); extern unsigned long qnx4_block_map(struct inode *inode, long iblock); diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 306a1d1a..e51b531 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h @@ -244,6 +244,8 @@ struct bitmap { */ unsigned long daemon_lastrun; /* jiffies of last run */ unsigned long daemon_sleep; /* how many seconds between updates? */ + unsigned long last_end_sync; /* when we lasted called end_sync to + * update bitmap with resync progress */ atomic_t pending_writes; /* pending writes to the bitmap file */ wait_queue_head_t write_wait; @@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); void bitmap_close_sync(struct bitmap *bitmap); +void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); void bitmap_unplug(struct bitmap *bitmap); void bitmap_daemon_work(struct bitmap *bitmap); diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index dcb7292..85a068b 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -81,6 +81,8 @@ struct mdk_rdev_s #define In_sync 2 /* device is in_sync with rest of array */ #define WriteMostly 4 /* Avoid reading if at all possible */ #define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ +#define AllReserved 6 /* If whole device is reserved for + * one array */ int desc_nr; /* descriptor index in the superblock */ int raid_disk; /* role of device in array */ @@ -130,6 +132,9 @@ struct mddev_s minor_version, patch_version; int persistent; + int external; /* metadata is + * managed externally */ + char metadata_type[17]; /* externally set*/ int chunk_size; time_t ctime, utime; int level, layout; @@ -216,6 +221,8 @@ struct mddev_s atomic_t recovery_active; /* blocks scheduled, but not written */ wait_queue_head_t recovery_wait; sector_t recovery_cp; + sector_t resync_max; /* resync should pause + * when it gets here */ spinlock_t write_lock; wait_queue_head_t sb_wait; /* for waiting on superblock updates */ @@ -306,23 +313,17 @@ static inline char * mdname (mddev_t * mddev) * iterates through some rdev ringlist. It's safe to remove the * current 'rdev'. Dont touch 'tmp' though. */ -#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ +#define rdev_for_each_list(rdev, tmp, list) \ \ - for ((tmp) = (head).next; \ + for ((tmp) = (list).next; \ (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ - (tmp) = (tmp)->next, (tmp)->prev != &(head) \ + (tmp) = (tmp)->next, (tmp)->prev != &(list) \ ; ) /* * iterates through the 'same array disks' ringlist */ -#define ITERATE_RDEV(mddev,rdev,tmp) \ - ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) - -/* - * Iterates through 'pending RAID disks' - */ -#define ITERATE_RDEV_PENDING(rdev,tmp) \ - ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) +#define rdev_for_each(rdev, tmp, mddev) \ + rdev_for_each_list(rdev, tmp, (mddev)->disks) typedef struct mdk_thread_s { void (*run) (mddev_t *mddev); diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index d32c14d..37a642c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -174,10 +174,13 @@ struct rcu_head { * code. */ -#define rcu_assign_pointer(p, v) ({ \ - smp_wmb(); \ - (p) = (v); \ - }) +#define rcu_assign_pointer(p, v) \ + ({ \ + if (!__builtin_constant_p(v) || \ + ((v) != NULL)) \ + smp_wmb(); \ + (p) = (v); \ + }) /** * synchronize_sched - block until all CPUs have exited any non-preemptive diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index ece8eb3..60c2a03 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h @@ -46,8 +46,8 @@ #define rcu_bh_qsctr_inc(cpu) #define call_rcu_bh(head, rcu) call_rcu(head, rcu) -extern void __rcu_read_lock(void); -extern void __rcu_read_unlock(void); +extern void __rcu_read_lock(void) __acquires(RCU); +extern void __rcu_read_unlock(void) __releases(RCU); extern int rcu_pending(int cpu); extern int rcu_needs_cpu(int cpu); diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 422eab4..8e7eff2 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -287,7 +287,7 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb) /* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 * which overflows on large file systems. */ -static inline u32 reiserfs_bmap_count(struct super_block *sb) +static inline __u32 reiserfs_bmap_count(struct super_block *sb) { return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; } diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h new file mode 100644 index 0000000..61363ce --- /dev/null +++ b/include/linux/res_counter.h @@ -0,0 +1,127 @@ +#ifndef __RES_COUNTER_H__ +#define __RES_COUNTER_H__ + +/* + * Resource Counters + * Contain common data types and routines for resource accounting + * + * Copyright 2007 OpenVZ SWsoft Inc + * + * Author: Pavel Emelianov <xemul@openvz.org> + * + */ + +#include <linux/cgroup.h> + +/* + * The core object. the cgroup that wishes to account for some + * resource may include this counter into its structures and use + * the helpers described beyond + */ + +struct res_counter { + /* + * the current resource consumption level + */ + unsigned long long usage; + /* + * the limit that usage cannot exceed + */ + unsigned long long limit; + /* + * the number of unsuccessful attempts to consume the resource + */ + unsigned long long failcnt; + /* + * the lock to protect all of the above. + * the routines below consider this to be IRQ-safe + */ + spinlock_t lock; +}; + +/* + * Helpers to interact with userspace + * res_counter_read/_write - put/get the specified fields from the + * res_counter struct to/from the user + * + * @counter: the counter in question + * @member: the field to work with (see RES_xxx below) + * @buf: the buffer to opeate on,... + * @nbytes: its size... + * @pos: and the offset. + */ + +ssize_t res_counter_read(struct res_counter *counter, int member, + const char __user *buf, size_t nbytes, loff_t *pos, + int (*read_strategy)(unsigned long long val, char *s)); +ssize_t res_counter_write(struct res_counter *counter, int member, + const char __user *buf, size_t nbytes, loff_t *pos, + int (*write_strategy)(char *buf, unsigned long long *val)); + +/* + * the field descriptors. one for each member of res_counter + */ + +enum { + RES_USAGE, + RES_LIMIT, + RES_FAILCNT, +}; + +/* + * helpers for accounting + */ + +void res_counter_init(struct res_counter *counter); + +/* + * charge - try to consume more resource. + * + * @counter: the counter + * @val: the amount of the resource. each controller defines its own + * units, e.g. numbers, bytes, Kbytes, etc + * + * returns 0 on success and <0 if the counter->usage will exceed the + * counter->limit _locked call expects the counter->lock to be taken + */ + +int res_counter_charge_locked(struct res_counter *counter, unsigned long val); +int res_counter_charge(struct res_counter *counter, unsigned long val); + +/* + * uncharge - tell that some portion of the resource is released + * + * @counter: the counter + * @val: the amount of the resource + * + * these calls check for usage underflow and show a warning on the console + * _locked call expects the counter->lock to be taken + */ + +void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); +void res_counter_uncharge(struct res_counter *counter, unsigned long val); + +static inline bool res_counter_limit_check_locked(struct res_counter *cnt) +{ + if (cnt->usage < cnt->limit) + return true; + + return false; +} + +/* + * Helper function to detect if the cgroup is within it's limit or + * not. It's currently called from cgroup_rss_prepare() + */ +static inline bool res_counter_check_under_limit(struct res_counter *cnt) +{ + bool ret; + unsigned long flags; + + spin_lock_irqsave(&cnt->lock, flags); + ret = res_counter_limit_check_locked(cnt); + spin_unlock_irqrestore(&cnt->lock, flags); + return ret; +} + +#endif diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 97347f2..1383692 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -8,6 +8,7 @@ #include <linux/slab.h> #include <linux/mm.h> #include <linux/spinlock.h> +#include <linux/memcontrol.h> /* * The anon_vma heads a list of private "related" vmas, to scan if @@ -86,7 +87,7 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, /* * Called from mm/vmscan.c to handle paging out */ -int page_referenced(struct page *, int is_locked); +int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt); int try_to_unmap(struct page *, int ignore_refs); /* @@ -114,7 +115,7 @@ int page_mkclean(struct page *); #define anon_vma_prepare(vma) (0) #define anon_vma_link(vma) do {} while (0) -#define page_referenced(page,l) TestClearPageReferenced(page) +#define page_referenced(page,l,cnt) TestClearPageReferenced(page) #define try_to_unmap(page, refs) SWAP_FAIL static inline int page_mkclean(struct page *page) diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index 813cee1..6c3c0f6 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h @@ -60,14 +60,14 @@ do { \ __init_rwsem((sem), #sem, &__key); \ } while (0) -extern void FASTCALL(__down_read(struct rw_semaphore *sem)); -extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem)); -extern void FASTCALL(__down_write(struct rw_semaphore *sem)); -extern void FASTCALL(__down_write_nested(struct rw_semaphore *sem, int subclass)); -extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem)); -extern void FASTCALL(__up_read(struct rw_semaphore *sem)); -extern void FASTCALL(__up_write(struct rw_semaphore *sem)); -extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem)); +extern void __down_read(struct rw_semaphore *sem); +extern int __down_read_trylock(struct rw_semaphore *sem); +extern void __down_write(struct rw_semaphore *sem); +extern void __down_write_nested(struct rw_semaphore *sem, int subclass); +extern int __down_write_trylock(struct rw_semaphore *sem); +extern void __up_read(struct rw_semaphore *sem); +extern void __up_write(struct rw_semaphore *sem); +extern void __downgrade_write(struct rw_semaphore *sem); static inline int rwsem_is_locked(struct rw_semaphore *sem) { diff --git a/include/linux/sched.h b/include/linux/sched.h index 9c13be3..e217d18 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -92,6 +92,7 @@ struct sched_param { #include <asm/processor.h> +struct mem_cgroup; struct exec_domain; struct futex_pi_state; struct robust_list_head; @@ -322,7 +323,7 @@ extern char __sched_text_start[], __sched_text_end[]; extern int in_sched_functions(unsigned long addr); #define MAX_SCHEDULE_TIMEOUT LONG_MAX -extern signed long FASTCALL(schedule_timeout(signed long timeout)); +extern signed long schedule_timeout(signed long timeout); extern signed long schedule_timeout_interruptible(signed long timeout); extern signed long schedule_timeout_killable(signed long timeout); extern signed long schedule_timeout_uninterruptible(signed long timeout); @@ -459,7 +460,7 @@ struct signal_struct { /* ITIMER_REAL timer for the process */ struct hrtimer real_timer; - struct task_struct *tsk; + struct pid *leader_pid; ktime_t it_real_incr; /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ @@ -589,7 +590,7 @@ struct user_struct { struct hlist_node uidhash_node; uid_t uid; -#ifdef CONFIG_FAIR_USER_SCHED +#ifdef CONFIG_USER_SCHED struct task_group *tg; #ifdef CONFIG_SYSFS struct kobject kobj; @@ -810,7 +811,7 @@ static inline int above_background_load(void) struct io_context; /* See blkdev.h */ #define NGROUPS_SMALL 32 -#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) +#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) struct group_info { int ngroups; atomic_t usage; @@ -972,7 +973,7 @@ struct sched_rt_entity { unsigned long timeout; int nr_cpus_allowed; -#ifdef CONFIG_FAIR_GROUP_SCHED +#ifdef CONFIG_RT_GROUP_SCHED struct sched_rt_entity *parent; /* rq on which this entity is (to be) queued: */ struct rt_rq *rt_rq; @@ -1331,9 +1332,8 @@ struct pid_namespace; * from various namespaces * * task_xid_nr() : global id, i.e. the id seen from the init namespace; - * task_xid_vnr() : virtual id, i.e. the id seen from the namespace the task - * belongs to. this only makes sence when called in the - * context of the task that belongs to the same namespace; + * task_xid_vnr() : virtual id, i.e. the id seen from the pid namespace of + * current. * task_xid_nr_ns() : id seen from the ns specified; * * set_task_vxid() : assigns a virtual id to a task; @@ -1541,8 +1541,6 @@ extern unsigned int sysctl_sched_child_runs_first; extern unsigned int sysctl_sched_features; extern unsigned int sysctl_sched_migration_cost; extern unsigned int sysctl_sched_nr_migrate; -extern unsigned int sysctl_sched_rt_period; -extern unsigned int sysctl_sched_rt_ratio; #if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP) extern unsigned int sysctl_sched_min_bal_int_shares; extern unsigned int sysctl_sched_max_bal_int_shares; @@ -1552,6 +1550,8 @@ int sched_nr_latency_handler(struct ctl_table *table, int write, struct file *file, void __user *buffer, size_t *length, loff_t *ppos); #endif +extern unsigned int sysctl_sched_rt_period; +extern int sysctl_sched_rt_runtime; extern unsigned int sysctl_sched_compat_yield; @@ -1631,7 +1631,7 @@ extern struct task_struct *find_task_by_vpid(pid_t nr); extern struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns); -extern void __set_special_pids(pid_t session, pid_t pgrp); +extern void __set_special_pids(struct pid *pid); /* per-UID process charging. */ extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); @@ -1648,10 +1648,10 @@ extern void release_uids(struct user_namespace *ns); extern void do_timer(unsigned long ticks); -extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); -extern int FASTCALL(wake_up_process(struct task_struct * tsk)); -extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, - unsigned long clone_flags)); +extern int wake_up_state(struct task_struct *tsk, unsigned int state); +extern int wake_up_process(struct task_struct *tsk); +extern void wake_up_new_task(struct task_struct *tsk, + unsigned long clone_flags); #ifdef CONFIG_SMP extern void kick_process(struct task_struct *tsk); #else @@ -1686,11 +1686,9 @@ extern void block_all_signals(int (*notifier)(void *priv), void *priv, extern void unblock_all_signals(void); extern void release_task(struct task_struct * p); extern int send_sig_info(int, struct siginfo *, struct task_struct *); -extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); extern int force_sigsegv(int, struct task_struct *); extern int force_sig_info(int, struct siginfo *, struct task_struct *); extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); -extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); extern int kill_pgrp(struct pid *pid, int sig, int priv); @@ -1743,7 +1741,7 @@ static inline int sas_ss_flags(unsigned long sp) extern struct mm_struct * mm_alloc(void); /* mmdrop drops the mm and the page tables */ -extern void FASTCALL(__mmdrop(struct mm_struct *)); +extern void __mmdrop(struct mm_struct *); static inline void mmdrop(struct mm_struct * mm) { if (unlikely(atomic_dec_and_test(&mm->mm_count))) @@ -1927,7 +1925,7 @@ static inline int signal_pending(struct task_struct *p) return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); } -extern int FASTCALL(__fatal_signal_pending(struct task_struct *p)); +extern int __fatal_signal_pending(struct task_struct *p); static inline int fatal_signal_pending(struct task_struct *p) { @@ -2029,16 +2027,22 @@ extern int sched_mc_power_savings, sched_smt_power_savings; extern void normalize_rt_tasks(void); -#ifdef CONFIG_FAIR_GROUP_SCHED +#ifdef CONFIG_GROUP_SCHED extern struct task_group init_task_group; extern struct task_group *sched_create_group(void); extern void sched_destroy_group(struct task_group *tg); extern void sched_move_task(struct task_struct *tsk); +#ifdef CONFIG_FAIR_GROUP_SCHED extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); extern unsigned long sched_group_shares(struct task_group *tg); - +#endif +#ifdef CONFIG_RT_GROUP_SCHED +extern int sched_group_set_rt_runtime(struct task_group *tg, + long rt_runtime_us); +extern long sched_group_rt_runtime(struct task_group *tg); +#endif #endif #ifdef CONFIG_TASK_XACCT diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 5eb38cc..8ba1c32 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -10,13 +10,13 @@ * * Various protocol defined structures. * - * The SCTP reference implementation is free software; + * This SCTP implementation is free software; * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * - * The SCTP reference implementation is distributed in the hope that it + * This SCTP implementation 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. diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 648dfeb..67c25639 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -8,8 +8,7 @@ struct seq_operations; struct file; -struct vfsmount; -struct dentry; +struct path; struct inode; struct seq_file { @@ -42,7 +41,7 @@ int seq_puts(struct seq_file *m, const char *s); int seq_printf(struct seq_file *, const char *, ...) __attribute__ ((format (printf,2,3))); -int seq_path(struct seq_file *, struct vfsmount *, struct dentry *, char *); +int seq_path(struct seq_file *, struct path *, char *); int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_release(struct inode *, struct file *); diff --git a/include/linux/serial167.h b/include/linux/serial167.h index 71b6df2..59c81b7 100644 --- a/include/linux/serial167.h +++ b/include/linux/serial167.h @@ -37,7 +37,6 @@ struct cyclades_port { int ignore_status_mask; int close_delay; int IER; /* Interrupt Enable Register */ - unsigned long event; unsigned long last_active; int count; /* # of fd on device */ int x_char; /* to be pushed out ASAP */ @@ -49,7 +48,6 @@ struct cyclades_port { int xmit_cnt; int default_threshold; int default_timeout; - struct work_struct tqueue; wait_queue_head_t open_wait; wait_queue_head_t close_wait; struct cyclades_monitor mon; @@ -67,18 +65,6 @@ struct cyclades_port { #define CYGETDEFTIMEOUT 0x435908 #define CYSETDEFTIMEOUT 0x435909 -/* - * Events are used to schedule things to happen at timer-interrupt - * time, instead of at cy interrupt time. - */ -#define Cy_EVENT_READ_PROCESS 0 -#define Cy_EVENT_WRITE_WAKEUP 1 -#define Cy_EVENT_HANGUP 2 -#define Cy_EVENT_BREAK 3 -#define Cy_EVENT_OPEN_WAKEUP 4 - - - #define CyMaxChipsPerCard 1 /**** cd2401 registers ****/ diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9963f81..289942f 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -149,6 +149,12 @@ /* Freescale ColdFire */ #define PORT_MCF 78 +#define PORT_SC26XX 79 + + +/* MN10300 on-chip UART numbers */ +#define PORT_MN10300 80 +#define PORT_MN10300_CTS 81 #ifdef __KERNEL__ diff --git a/include/linux/shm.h b/include/linux/shm.h index eeaed92..eca6235 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h @@ -3,7 +3,11 @@ #include <linux/ipc.h> #include <linux/errno.h> +#ifdef __KERNEL__ #include <asm/page.h> +#else +#include <unistd.h> +#endif /* * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can @@ -13,7 +17,11 @@ #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ #define SHMMIN 1 /* min shared seg size (bytes) */ #define SHMMNI 4096 /* max num of segs system wide */ +#ifdef __KERNEL__ #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ +#else +#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) +#endif #define SHMSEG SHMMNI /* max shared segs per process */ #ifdef __KERNEL__ diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index f3c5189..8d5fb36 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -30,9 +30,12 @@ struct shmem_sb_info { unsigned long free_blocks; /* How many are left for allocation */ unsigned long max_inodes; /* How many inodes are allowed */ unsigned long free_inodes; /* How many are left for allocation */ + spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ + uid_t uid; /* Mount uid for root directory */ + gid_t gid; /* Mount gid for root directory */ + mode_t mode; /* Mount mode for root directory */ int policy; /* Default NUMA memory alloc policy */ nodemask_t policy_nodes; /* nodemask for preferred and bind */ - spinlock_t stat_lock; }; static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) diff --git a/include/linux/signal.h b/include/linux/signal.h index 0ae3388..42d2e0a 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -241,6 +241,7 @@ extern int show_unhandled_signals; struct pt_regs; extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); +extern void exit_signals(struct task_struct *tsk); extern struct kmem_cache *sighand_cachep; @@ -371,6 +372,8 @@ int unhandled_signal(struct task_struct *tsk, int sig); (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) +void signals_init(void); + #endif /* __KERNEL__ */ #endif /* _LINUX_SIGNAL_H */ diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index ddb1a70..57deecc 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 { @@ -48,6 +71,7 @@ struct kmem_cache { /* Allocation and freeing of slabs */ int objects; /* Number of objects in slab */ + gfp_t allocflags; /* gfp flags to use on each alloc */ int refcount; /* Refcount for slab cache destroy */ void (*ctor)(struct kmem_cache *, void *); int inuse; /* Offset to metadata */ @@ -87,7 +111,7 @@ struct kmem_cache { * We keep the general caches in an array of slab caches that are used for * 2^x bytes of allocations. */ -extern struct kmem_cache kmalloc_caches[PAGE_SHIFT]; +extern struct kmem_cache kmalloc_caches[PAGE_SHIFT + 1]; /* * Sorry that the following has to be that ugly but some versions of GCC @@ -165,12 +189,16 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) void *kmem_cache_alloc(struct kmem_cache *, gfp_t); void *__kmalloc(size_t size, gfp_t flags); +static __always_inline void *kmalloc_large(size_t size, gfp_t flags) +{ + return (void *)__get_free_pages(flags | __GFP_COMP, get_order(size)); +} + static __always_inline void *kmalloc(size_t size, gfp_t flags) { if (__builtin_constant_p(size)) { - if (size > PAGE_SIZE / 2) - return (void *)__get_free_pages(flags | __GFP_COMP, - get_order(size)); + if (size > PAGE_SIZE) + return kmalloc_large(size, flags); if (!(flags & SLUB_DMA)) { struct kmem_cache *s = kmalloc_slab(size); @@ -191,7 +219,7 @@ void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) { if (__builtin_constant_p(size) && - size <= PAGE_SIZE / 2 && !(flags & SLUB_DMA)) { + size <= PAGE_SIZE && !(flags & SLUB_DMA)) { struct kmem_cache *s = kmalloc_slab(size); if (!s) diff --git a/include/linux/sm501.h b/include/linux/sm501.h index 9e3aaad..932a9ef 100644 --- a/include/linux/sm501.h +++ b/include/linux/sm501.h @@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) #define SM501FB_FLAG_USE_HWCURSOR (1<<2) #define SM501FB_FLAG_USE_HWACCEL (1<<3) +#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4) +#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5) struct sm501_platdata_fbsub { struct fb_videomode *def_mode; diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 40c7b5d..f41ffd7 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h @@ -101,6 +101,8 @@ #define SONYPI_EVENT_FNKEY_RELEASED 59 #define SONYPI_EVENT_WIRELESS_ON 60 #define SONYPI_EVENT_WIRELESS_OFF 61 +#define SONYPI_EVENT_ZOOM_IN_PRESSED 62 +#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63 /* get/set brightness */ #define SONYPI_IOCGBRT _IOR('v', 0, __u8) diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 1244497..576a5f7 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -71,7 +71,7 @@ #define LOCK_SECTION_END \ ".previous\n\t" -#define __lockfunc fastcall __attribute__((section(".spinlock.text"))) +#define __lockfunc __attribute__((section(".spinlock.text"))) /* * Pull the raw_spinlock_t and raw_rwlock_t definitions: diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index e18f5c2..9d5da8b 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h @@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) if (sdev->bus->bustype == SSB_BUSTYPE_PCI) pci_set_power_state(sdev->bus->host_pci, state); } +#else +static inline void ssb_pcihost_unregister(struct pci_driver *driver) +{ +} + +static inline +void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) +{ +} #endif /* CONFIG_SSB_PCIHOST */ diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 94b4a10..0424d75 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h @@ -95,7 +95,6 @@ struct stlport { struct tty_struct *tty; wait_queue_head_t open_wait; wait_queue_head_t close_wait; - struct work_struct tqueue; comstats_t stats; struct stlrq tx; }; diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 64c7710..64c9755 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -409,16 +409,13 @@ char * svc_print_addr(struct svc_rqst *, char *, size_t); * for all cases without actually generating the checksum, so we just use a * static value. */ -static inline void -svc_reserve_auth(struct svc_rqst *rqstp, int space) +static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space) { - int added_space = 0; + int added_space = 0; - switch(rqstp->rq_authop->flavour) { - case RPC_AUTH_GSS: - added_space = RPC_MAX_AUTH_SIZE; - } - return svc_reserve(rqstp, space + added_space); + if (rqstp->rq_authop->flavour) + added_space = RPC_MAX_AUTH_SIZE; + svc_reserve(rqstp, space + added_space); } #endif /* SUNRPC_SVC_H */ diff --git a/include/linux/swap.h b/include/linux/swap.h index 353153e..878459a 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -5,6 +5,7 @@ #include <linux/linkage.h> #include <linux/mmzone.h> #include <linux/list.h> +#include <linux/memcontrol.h> #include <linux/sched.h> #include <asm/atomic.h> @@ -170,10 +171,10 @@ extern unsigned int nr_free_pagecache_pages(void); /* linux/mm/swap.c */ -extern void FASTCALL(lru_cache_add(struct page *)); -extern void FASTCALL(lru_cache_add_active(struct page *)); -extern void FASTCALL(activate_page(struct page *)); -extern void FASTCALL(mark_page_accessed(struct page *)); +extern void lru_cache_add(struct page *); +extern void lru_cache_add_active(struct page *); +extern void activate_page(struct page *); +extern void mark_page_accessed(struct page *); extern void lru_add_drain(void); extern int lru_add_drain_all(void); extern int rotate_reclaimable_page(struct page *page); @@ -182,6 +183,9 @@ extern void swap_setup(void); /* linux/mm/vmscan.c */ extern unsigned long try_to_free_pages(struct zone **zones, int order, gfp_t gfp_mask); +extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, + gfp_t gfp_mask); +extern int __isolate_lru_page(struct page *page, int mode); extern unsigned long shrink_all_memory(unsigned long nr_pages); extern int vm_swappiness; extern int remove_mapping(struct address_space *mapping, struct page *page); diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 7bf2d14..6ec39ab 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -42,11 +42,13 @@ static inline pgoff_t swp_offset(swp_entry_t entry) return entry.val & SWP_OFFSET_MASK(entry); } +#ifdef CONFIG_MMU /* check whether a pte points to a swap entry */ static inline int is_swap_pte(pte_t pte) { return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); } +#endif /* * Convert the arch-dependent pte representation of a swp_entry_t into an diff --git a/include/linux/thermal.h b/include/linux/thermal.h new file mode 100644 index 0000000..818ca1c --- /dev/null +++ b/include/linux/thermal.h @@ -0,0 +1,111 @@ +/* + * thermal.h ($Revision: 0 $) + * + * Copyright (C) 2008 Intel Corp + * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> + * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifndef __THERMAL_H__ +#define __THERMAL_H__ + +#include <linux/idr.h> +#include <linux/device.h> + +struct thermal_zone_device; +struct thermal_cooling_device; + +struct thermal_zone_device_ops { + int (*bind) (struct thermal_zone_device *, + struct thermal_cooling_device *); + int (*unbind) (struct thermal_zone_device *, + struct thermal_cooling_device *); + int (*get_temp) (struct thermal_zone_device *, char *); + int (*get_mode) (struct thermal_zone_device *, char *); + int (*set_mode) (struct thermal_zone_device *, const char *); + int (*get_trip_type) (struct thermal_zone_device *, int, char *); + int (*get_trip_temp) (struct thermal_zone_device *, int, char *); +}; + +struct thermal_cooling_device_ops { + int (*get_max_state) (struct thermal_cooling_device *, char *); + int (*get_cur_state) (struct thermal_cooling_device *, char *); + int (*set_cur_state) (struct thermal_cooling_device *, unsigned int); +}; + +#define THERMAL_TRIPS_NONE -1 +#define THERMAL_MAX_TRIPS 10 +#define THERMAL_NAME_LENGTH 20 +struct thermal_cooling_device { + int id; + char type[THERMAL_NAME_LENGTH]; + struct device device; + void *devdata; + struct thermal_cooling_device_ops *ops; + struct list_head node; +}; + +#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ + ((long)t-2732+5)/10 : ((long)t-2732-5)/10) +#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) + +struct thermal_zone_device { + int id; + char type[THERMAL_NAME_LENGTH]; + struct device device; + void *devdata; + int trips; + struct thermal_zone_device_ops *ops; + struct list_head cooling_devices; + struct idr idr; + struct mutex lock; /* protect cooling devices list */ + struct list_head node; +}; + +struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, + struct + thermal_zone_device_ops + *); +void thermal_zone_device_unregister(struct thermal_zone_device *); + +int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, + struct thermal_cooling_device *); +int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, + struct thermal_cooling_device *); + +#ifdef CONFIG_THERMAL +struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, + struct + thermal_cooling_device_ops + *); +void thermal_cooling_device_unregister(struct thermal_cooling_device *); +#else +static inline struct thermal_cooling_device +*thermal_cooling_device_register(char *c, void *v, + struct thermal_cooling_device_ops *t) +{ + return NULL; +} +static inline + void thermal_cooling_device_unregister(struct thermal_cooling_device *t) +{ +}; +#endif + +#endif /* __THERMAL_H__ */ diff --git a/include/linux/tifm.h b/include/linux/tifm.h index 2096b76..da76ed8 100644 --- a/include/linux/tifm.h +++ b/include/linux/tifm.h @@ -72,6 +72,7 @@ enum { #define TIFM_FIFO_READY 0x00000001 #define TIFM_FIFO_INT_SETALL 0x0000ffff #define TIFM_FIFO_INTMASK 0x00000005 +#define TIFM_FIFO_SIZE 0x00000200 #define TIFM_DMA_RESET 0x00000002 #define TIFM_DMA_TX 0x00008000 @@ -124,6 +125,8 @@ struct tifm_adapter { void (*eject)(struct tifm_adapter *fm, struct tifm_dev *sock); + int (*has_ms_pif)(struct tifm_adapter *fm, + struct tifm_dev *sock); struct tifm_dev *sockets[0]; }; @@ -141,6 +144,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, int tifm_register_driver(struct tifm_driver *drv); void tifm_unregister_driver(struct tifm_driver *drv); void tifm_eject(struct tifm_dev *sock); +int tifm_has_ms_pif(struct tifm_dev *sock); int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, int direction); void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, diff --git a/include/linux/time.h b/include/linux/time.h index ceaab9f..2091a19 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -120,7 +120,7 @@ extern void getboottime(struct timespec *ts); extern void monotonic_to_bootbased(struct timespec *ts); extern struct timespec timespec_trunc(struct timespec t, unsigned gran); -extern int timekeeping_is_continuous(void); +extern int timekeeping_valid_for_hres(void); extern void update_wall_time(void); extern void update_xtime_cache(u64 nsec); diff --git a/include/linux/timer.h b/include/linux/timer.h index de0e713..979fefd 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -35,8 +35,8 @@ extern struct tvec_base boot_tvec_bases; struct timer_list _name = \ TIMER_INITIALIZER(_function, _expires, _data) -void fastcall init_timer(struct timer_list * timer); -void fastcall init_timer_deferrable(struct timer_list *timer); +void init_timer(struct timer_list *timer); +void init_timer_deferrable(struct timer_list *timer); static inline void setup_timer(struct timer_list * timer, void (*function)(unsigned long), @@ -124,8 +124,6 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) } #endif -extern void delayed_work_timer_fn(unsigned long __data); - /** * add_timer - start a timer * @timer: the timer to be added diff --git a/include/linux/timex.h b/include/linux/timex.h index 24c6a2b..c3f3747 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -232,7 +232,14 @@ static inline int ntp_synced(void) #else #define NTP_INTERVAL_FREQ (HZ) #endif -#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) + +#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE) +#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \ + (s64)CLOCK_TICK_RATE) + +/* Because using NSEC_PER_SEC would be too easy */ +#define NTP_INTERVAL_LENGTH ((((s64)TICK_USEC * NSEC_PER_USEC * USER_HZ) + \ + CLOCK_TICK_ADJUST) / NTP_INTERVAL_FREQ) /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ extern u64 current_tick_length(void); @@ -244,6 +251,8 @@ extern int do_adjtimex(struct timex *); /* Don't use! Compatibility define for existing users. */ #define tickadj (500/HZ ? : 1) +int read_current_timer(unsigned long *timer_val); + #endif /* KERNEL */ #endif /* LINUX_TIMEX_H */ diff --git a/include/linux/tty.h b/include/linux/tty.h index 402de89..dd8e08f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -53,13 +53,6 @@ */ #define __DISABLED_CHAR '\0' -/* - * This is the flip buffer used for the tty driver. The buffer is - * located in the tty structure, and is used as a high speed interface - * between the tty driver and the tty line discipline. - */ -#define TTY_FLIPBUF_SIZE 512 - struct tty_buffer { struct tty_buffer *next; char *char_buf_ptr; @@ -74,7 +67,6 @@ struct tty_buffer { struct tty_bufhead { struct delayed_work work; - struct semaphore pty_sem; spinlock_t lock; struct tty_buffer *head; /* Queue head */ struct tty_buffer *tail; /* Active buffer */ diff --git a/include/linux/types.h b/include/linux/types.h index b94c0e4..9dc2346 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -53,7 +53,7 @@ typedef __kernel_uid_t uid_t; typedef __kernel_gid_t gid_t; #endif /* __KERNEL__ */ -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(__GNUC__) typedef __kernel_loff_t loff_t; #endif @@ -119,7 +119,7 @@ typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(__GNUC__) typedef __u64 uint64_t; typedef __u64 u_int64_t; typedef __s64 int64_t; @@ -181,7 +181,7 @@ typedef __u16 __bitwise __le16; typedef __u16 __bitwise __be16; typedef __u32 __bitwise __le32; typedef __u32 __bitwise __be32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(__GNUC__) typedef __u64 __bitwise __le64; typedef __u64 __bitwise __be64; #endif diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h index 36c684e..aa88654 100644 --- a/include/linux/udf_fs.h +++ b/include/linux/udf_fs.h @@ -32,18 +32,15 @@ #define UDF_PREALLOCATE #define UDF_DEFAULT_PREALLOC_BLOCKS 8 -#define UDFFS_DATE "2004/29/09" -#define UDFFS_VERSION "0.9.8.1" - #undef UDFFS_DEBUG #ifdef UDFFS_DEBUG #define udf_debug(f, a...) \ - { \ + do { \ printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \ __FILE__, __LINE__, __FUNCTION__); \ printk (f, ##a); \ - } + } while (0) #else #define udf_debug(f, a...) /**/ #endif diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h index 80ae9ef..9bc4735 100644 --- a/include/linux/udf_fs_sb.h +++ b/include/linux/udf_fs_sb.h @@ -75,7 +75,7 @@ struct udf_part_map struct udf_sb_info { struct udf_part_map *s_partmaps; - __u8 s_volident[32]; + __u8 s_volume_ident[32]; /* Overall info */ __u16 s_partitions; @@ -84,9 +84,9 @@ struct udf_sb_info /* Sector headers */ __s32 s_session; __u32 s_anchor[4]; - __u32 s_lastblock; + __u32 s_last_block; - struct buffer_head *s_lvidbh; + struct buffer_head *s_lvid_bh; /* Default permissions */ mode_t s_umask; @@ -94,10 +94,10 @@ struct udf_sb_info uid_t s_uid; /* Root Info */ - struct timespec s_recordtime; + struct timespec s_record_time; /* Fileset Info */ - __u16 s_serialnum; + __u16 s_serial_number; /* highest UDF revision we have recorded to this media */ __u16 s_udfrev; @@ -109,7 +109,7 @@ struct udf_sb_info struct nls_table *s_nls_map; /* VAT inode */ - struct inode *s_vat; + struct inode *s_vat_inode; struct mutex s_alloc_mutex; }; diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h deleted file mode 100644 index 10b854d..0000000 --- a/include/linux/ufs_fs.h +++ /dev/null @@ -1,953 +0,0 @@ -/* - * linux/include/linux/ufs_fs.h - * - * Copyright (C) 1996 - * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu) - * Laboratory for Computer Science Research Computing Facility - * Rutgers, The State University of New Jersey - * - * Clean swab support by Fare <fare@tunes.org> - * just hope no one is using NNUUXXI on __?64 structure elements - * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl> - * - * 4.4BSD (FreeBSD) support added on February 1st 1998 by - * Niels Kristian Bech Jensen <nkbj@image.dk> partially based - * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>. - * - * NeXTstep support added on February 5th 1998 by - * Niels Kristian Bech Jensen <nkbj@image.dk>. - * - * Write support by Daniel Pirkl <daniel.pirkl@email.cz> - * - * HP/UX hfs filesystem support added by - * Martin K. Petersen <mkp@mkp.net>, August 1999 - * - * UFS2 (of FreeBSD 5.x) support added by - * Niraj Kumar <niraj17@iitbombay.org> , Jan 2004 - * - */ - -#ifndef __LINUX_UFS_FS_H -#define __LINUX_UFS_FS_H - -#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/stat.h> -#include <linux/fs.h> - -#ifndef __KERNEL__ -typedef __u64 __fs64; -typedef __u32 __fs32; -typedef __u16 __fs16; -#else -#include <asm/div64.h> -typedef __u64 __bitwise __fs64; -typedef __u32 __bitwise __fs32; -typedef __u16 __bitwise __fs16; -#endif - -#define UFS_BBLOCK 0 -#define UFS_BBSIZE 8192 -#define UFS_SBLOCK 8192 -#define UFS_SBSIZE 8192 - -#define UFS_SECTOR_SIZE 512 -#define UFS_SECTOR_BITS 9 -#define UFS_MAGIC 0x00011954 -#define UFS2_MAGIC 0x19540119 -#define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */ - -/* Copied from FreeBSD */ -/* - * Each disk drive contains some number of filesystems. - * A filesystem consists of a number of cylinder groups. - * Each cylinder group has inodes and data. - * - * A filesystem is described by its super-block, which in turn - * describes the cylinder groups. The super-block is critical - * data and is replicated in each cylinder group to protect against - * catastrophic loss. This is done at `newfs' time and the critical - * super-block data does not change, so the copies need not be - * referenced further unless disaster strikes. - * - * For filesystem fs, the offsets of the various blocks of interest - * are given in the super block as: - * [fs->fs_sblkno] Super-block - * [fs->fs_cblkno] Cylinder group block - * [fs->fs_iblkno] Inode blocks - * [fs->fs_dblkno] Data blocks - * The beginning of cylinder group cg in fs, is given by - * the ``cgbase(fs, cg)'' macro. - * - * Depending on the architecture and the media, the superblock may - * reside in any one of four places. For tiny media where every block - * counts, it is placed at the very front of the partition. Historically, - * UFS1 placed it 8K from the front to leave room for the disk label and - * a small bootstrap. For UFS2 it got moved to 64K from the front to leave - * room for the disk label and a bigger bootstrap, and for really piggy - * systems we check at 256K from the front if the first three fail. In - * all cases the size of the superblock will be SBLOCKSIZE. All values are - * given in byte-offset form, so they do not imply a sector size. The - * SBLOCKSEARCH specifies the order in which the locations should be searched. - */ -#define SBLOCK_FLOPPY 0 -#define SBLOCK_UFS1 8192 -#define SBLOCK_UFS2 65536 -#define SBLOCK_PIGGY 262144 -#define SBLOCKSIZE 8192 -#define SBLOCKSEARCH \ - { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } - - -/* HP specific MAGIC values */ - -#define UFS_MAGIC_LFN 0x00095014 /* fs supports filenames > 14 chars */ -#define UFS_CIGAM_LFN 0x14500900 /* srahc 41 < semanelif stroppus sf */ - -#define UFS_MAGIC_SEC 0x00612195 /* B1 security fs */ -#define UFS_CIGAM_SEC 0x95216100 - -#define UFS_MAGIC_FEA 0x00195612 /* fs_featurebits supported */ -#define UFS_CIGAM_FEA 0x12561900 - -#define UFS_MAGIC_4GB 0x05231994 /* fs > 4 GB && fs_featurebits */ -#define UFS_CIGAM_4GB 0x94192305 - -/* Seems somebody at HP goofed here. B1 and lfs are both 0x2 !?! */ -#define UFS_FSF_LFN 0x00000001 /* long file names */ -#define UFS_FSF_B1 0x00000002 /* B1 security */ -#define UFS_FSF_LFS 0x00000002 /* large files */ -#define UFS_FSF_LUID 0x00000004 /* large UIDs */ - -/* End of HP stuff */ - - -#define UFS_BSIZE 8192 -#define UFS_MINBSIZE 4096 -#define UFS_FSIZE 1024 -#define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE) - -#define UFS_NDADDR 12 -#define UFS_NINDIR 3 - -#define UFS_IND_BLOCK (UFS_NDADDR + 0) -#define UFS_DIND_BLOCK (UFS_NDADDR + 1) -#define UFS_TIND_BLOCK (UFS_NDADDR + 2) - -#define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift) -#define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift) -#define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift) -#define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift) - -#define UFS_ROOTINO 2 -#define UFS_FIRST_INO (UFS_ROOTINO + 1) - -#define UFS_USEEFT ((__u16)65535) - -#define UFS_FSOK 0x7c269d38 -#define UFS_FSACTIVE ((__s8)0x00) -#define UFS_FSCLEAN ((__s8)0x01) -#define UFS_FSSTABLE ((__s8)0x02) -#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */ -#define UFS_FSBAD ((__s8)0xff) - -/* From here to next blank line, s_flags for ufs_sb_info */ -/* directory entry encoding */ -#define UFS_DE_MASK 0x00000010 /* mask for the following */ -#define UFS_DE_OLD 0x00000000 -#define UFS_DE_44BSD 0x00000010 -/* uid encoding */ -#define UFS_UID_MASK 0x00000060 /* mask for the following */ -#define UFS_UID_OLD 0x00000000 -#define UFS_UID_44BSD 0x00000020 -#define UFS_UID_EFT 0x00000040 -/* superblock state encoding */ -#define UFS_ST_MASK 0x00000700 /* mask for the following */ -#define UFS_ST_OLD 0x00000000 -#define UFS_ST_44BSD 0x00000100 -#define UFS_ST_SUN 0x00000200 /* Solaris */ -#define UFS_ST_SUNOS 0x00000300 -#define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */ -/*cylinder group encoding */ -#define UFS_CG_MASK 0x00003000 /* mask for the following */ -#define UFS_CG_OLD 0x00000000 -#define UFS_CG_44BSD 0x00002000 -#define UFS_CG_SUN 0x00001000 -/* filesystem type encoding */ -#define UFS_TYPE_MASK 0x00010000 /* mask for the following */ -#define UFS_TYPE_UFS1 0x00000000 -#define UFS_TYPE_UFS2 0x00010000 - - -/* fs_inodefmt options */ -#define UFS_42INODEFMT -1 -#define UFS_44INODEFMT 2 - -/* - * MINFREE gives the minimum acceptable percentage of file system - * blocks which may be free. If the freelist drops below this level - * only the superuser may continue to allocate blocks. This may - * be set to 0 if no reserve of free blocks is deemed necessary, - * however throughput drops by fifty percent if the file system - * is run at between 95% and 100% full; thus the minimum default - * value of fs_minfree is 5%. However, to get good clustering - * performance, 10% is a better choice. hence we use 10% as our - * default value. With 10% free space, fragmentation is not a - * problem, so we choose to optimize for time. - */ -#define UFS_MINFREE 5 -#define UFS_DEFAULTOPT UFS_OPTTIME - -/* - * Turn file system block numbers into disk block addresses. - * This maps file system blocks to device size blocks. - */ -#define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb) -#define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb) - -/* - * Cylinder group macros to locate things in cylinder groups. - * They calc file system addresses of cylinder group data structures. - */ -#define ufs_cgbase(c) (uspi->s_fpg * (c)) -#define ufs_cgstart(c) ((uspi)->fs_magic == UFS2_MAGIC ? ufs_cgbase(c) : \ - (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask))) -#define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno) /* super blk */ -#define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */ -#define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno) /* inode blk */ -#define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno) /* 1st data */ - -/* - * Macros for handling inode numbers: - * inode number to file system block offset. - * inode number to cylinder group number. - * inode number to file system block address. - */ -#define ufs_inotocg(x) ((x) / uspi->s_ipg) -#define ufs_inotocgoff(x) ((x) % uspi->s_ipg) -#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf) -#define ufs_inotofsbo(x) ((x) % uspi->s_inopf) - -/* - * Compute the cylinder and rotational position of a cyl block addr. - */ -#define ufs_cbtocylno(bno) \ - ((bno) * uspi->s_nspf / uspi->s_spc) -#define ufs_cbtorpos(bno) \ - ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \ - * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \ - % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \ - * uspi->s_nrpos) / uspi->s_npsect) - -/* - * The following macros optimize certain frequently calculated - * quantities by using shifts and masks in place of divisions - * modulos and multiplications. - */ -#define ufs_blkoff(loc) ((loc) & uspi->s_qbmask) -#define ufs_fragoff(loc) ((loc) & uspi->s_qfmask) -#define ufs_lblktosize(blk) ((blk) << uspi->s_bshift) -#define ufs_lblkno(loc) ((loc) >> uspi->s_bshift) -#define ufs_numfrags(loc) ((loc) >> uspi->s_fshift) -#define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask) -#define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask) -#define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift) -#define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift) -#define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask) -#define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask) - -#define UFS_MAXNAMLEN 255 -#define UFS_MAXMNTLEN 512 -#define UFS2_MAXMNTLEN 468 -#define UFS2_MAXVOLLEN 32 -#define UFS_MAXCSBUFS 31 -#define UFS_LINK_MAX 32000 -/* -#define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4) -*/ -#define UFS2_NOCSPTRS 28 - -/* - * UFS_DIR_PAD defines the directory entries boundaries - * (must be a multiple of 4) - */ -#define UFS_DIR_PAD 4 -#define UFS_DIR_ROUND (UFS_DIR_PAD - 1) -#define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND) - -struct ufs_timeval { - __fs32 tv_sec; - __fs32 tv_usec; -}; - -struct ufs_dir_entry { - __fs32 d_ino; /* inode number of this entry */ - __fs16 d_reclen; /* length of this entry */ - union { - __fs16 d_namlen; /* actual length of d_name */ - struct { - __u8 d_type; /* file type */ - __u8 d_namlen; /* length of string in d_name */ - } d_44; - } d_u; - __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */ -}; - -struct ufs_csum { - __fs32 cs_ndir; /* number of directories */ - __fs32 cs_nbfree; /* number of free blocks */ - __fs32 cs_nifree; /* number of free inodes */ - __fs32 cs_nffree; /* number of free frags */ -}; -struct ufs2_csum_total { - __fs64 cs_ndir; /* number of directories */ - __fs64 cs_nbfree; /* number of free blocks */ - __fs64 cs_nifree; /* number of free inodes */ - __fs64 cs_nffree; /* number of free frags */ - __fs64 cs_numclusters; /* number of free clusters */ - __fs64 cs_spare[3]; /* future expansion */ -}; - -struct ufs_csum_core { - __u64 cs_ndir; /* number of directories */ - __u64 cs_nbfree; /* number of free blocks */ - __u64 cs_nifree; /* number of free inodes */ - __u64 cs_nffree; /* number of free frags */ - __u64 cs_numclusters; /* number of free clusters */ -}; - -/* - * File system flags - */ -#define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */ -#define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */ -#define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */ -#define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */ -#define UFS_ACLS 0x10 /* file system has ACLs enabled */ -#define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */ -#define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ - -#if 0 -/* - * This is the actual superblock, as it is laid out on the disk. - * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and - * it may occupy several blocks, use - * struct ufs_super_block_(first,second,third) instead. - */ -struct ufs_super_block { - union { - struct { - __fs32 fs_link; /* UNUSED */ - } fs_42; - struct { - __fs32 fs_state; /* file system state flag */ - } fs_sun; - } fs_u0; - __fs32 fs_rlink; /* UNUSED */ - __fs32 fs_sblkno; /* addr of super-block in filesys */ - __fs32 fs_cblkno; /* offset of cyl-block in filesys */ - __fs32 fs_iblkno; /* offset of inode-blocks in filesys */ - __fs32 fs_dblkno; /* offset of first data after cg */ - __fs32 fs_cgoffset; /* cylinder group offset in cylinder */ - __fs32 fs_cgmask; /* used to calc mod fs_ntrak */ - __fs32 fs_time; /* last time written -- time_t */ - __fs32 fs_size; /* number of blocks in fs */ - __fs32 fs_dsize; /* number of data blocks in fs */ - __fs32 fs_ncg; /* number of cylinder groups */ - __fs32 fs_bsize; /* size of basic blocks in fs */ - __fs32 fs_fsize; /* size of frag blocks in fs */ - __fs32 fs_frag; /* number of frags in a block in fs */ -/* these are configuration parameters */ - __fs32 fs_minfree; /* minimum percentage of free blocks */ - __fs32 fs_rotdelay; /* num of ms for optimal next block */ - __fs32 fs_rps; /* disk revolutions per second */ -/* these fields can be computed from the others */ - __fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */ - __fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */ - __fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */ - __fs32 fs_fshift; /* ``numfrags'' calc number of frags */ -/* these are configuration parameters */ - __fs32 fs_maxcontig; /* max number of contiguous blks */ - __fs32 fs_maxbpg; /* max number of blks per cyl group */ -/* these fields can be computed from the others */ - __fs32 fs_fragshift; /* block to frag shift */ - __fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ - __fs32 fs_sbsize; /* actual size of super block */ - __fs32 fs_csmask; /* csum block offset */ - __fs32 fs_csshift; /* csum block number */ - __fs32 fs_nindir; /* value of NINDIR */ - __fs32 fs_inopb; /* value of INOPB */ - __fs32 fs_nspf; /* value of NSPF */ -/* yet another configuration parameter */ - __fs32 fs_optim; /* optimization preference, see below */ -/* these fields are derived from the hardware */ - union { - struct { - __fs32 fs_npsect; /* # sectors/track including spares */ - } fs_sun; - struct { - __fs32 fs_state; /* file system state time stamp */ - } fs_sunx86; - } fs_u1; - __fs32 fs_interleave; /* hardware sector interleave */ - __fs32 fs_trackskew; /* sector 0 skew, per track */ -/* a unique id for this filesystem (currently unused and unmaintained) */ -/* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */ -/* Neither of those fields is used in the Tahoe code right now but */ -/* there could be problems if they are. */ - __fs32 fs_id[2]; /* file system id */ -/* sizes determined by number of cylinder groups and their sizes */ - __fs32 fs_csaddr; /* blk addr of cyl grp summary area */ - __fs32 fs_cssize; /* size of cyl grp summary area */ - __fs32 fs_cgsize; /* cylinder group size */ -/* these fields are derived from the hardware */ - __fs32 fs_ntrak; /* tracks per cylinder */ - __fs32 fs_nsect; /* sectors per track */ - __fs32 fs_spc; /* sectors per cylinder */ -/* this comes from the disk driver partitioning */ - __fs32 fs_ncyl; /* cylinders in file system */ -/* these fields can be computed from the others */ - __fs32 fs_cpg; /* cylinders per group */ - __fs32 fs_ipg; /* inodes per cylinder group */ - __fs32 fs_fpg; /* blocks per group * fs_frag */ -/* this data must be re-computed after crashes */ - struct ufs_csum fs_cstotal; /* cylinder summary information */ -/* these fields are cleared at mount time */ - __s8 fs_fmod; /* super block modified flag */ - __s8 fs_clean; /* file system is clean flag */ - __s8 fs_ronly; /* mounted read-only flag */ - __s8 fs_flags; - union { - struct { - __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ - __fs32 fs_cgrotor; /* last cg searched */ - __fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */ - __fs32 fs_maxcluster; - __fs32 fs_cpc; /* cyl per cycle in postbl */ - __fs16 fs_opostbl[16][8]; /* old rotation block list head */ - } fs_u1; - struct { - __s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */ - __u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */ - __fs64 fs_swuid; /* system-wide uid */ - __fs32 fs_pad; /* due to alignment of fs_swuid */ - __fs32 fs_cgrotor; /* last cg searched */ - __fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */ - __fs32 fs_contigdirs;/*# of contiguously allocated dirs */ - __fs32 fs_csp; /* cg summary info buffer for fs_cs */ - __fs32 fs_maxcluster; - __fs32 fs_active;/* used by snapshots to track fs */ - __fs32 fs_old_cpc; /* cyl per cycle in postbl */ - __fs32 fs_maxbsize;/*maximum blocking factor permitted */ - __fs64 fs_sparecon64[17];/*old rotation block list head */ - __fs64 fs_sblockloc; /* byte offset of standard superblock */ - struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/ - struct ufs_timeval fs_time; /* last time written */ - __fs64 fs_size; /* number of blocks in fs */ - __fs64 fs_dsize; /* number of data blocks in fs */ - __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ - __fs64 fs_pendingblocks;/* blocks in process of being freed */ - __fs32 fs_pendinginodes;/*inodes in process of being freed */ - } fs_u2; - } fs_u11; - union { - struct { - __fs32 fs_sparecon[53];/* reserved for future constants */ - __fs32 fs_reclaim; - __fs32 fs_sparecon2[1]; - __fs32 fs_state; /* file system state time stamp */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - } fs_sun; - struct { - __fs32 fs_sparecon[53];/* reserved for future constants */ - __fs32 fs_reclaim; - __fs32 fs_sparecon2[1]; - __fs32 fs_npsect; /* # sectors/track including spares */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - } fs_sunx86; - struct { - __fs32 fs_sparecon[50];/* reserved for future constants */ - __fs32 fs_contigsumsize;/* size of cluster summary array */ - __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ - __fs32 fs_inodefmt; /* format of on-disk inodes */ - __fs32 fs_maxfilesize[2]; /* max representable file size */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - __fs32 fs_state; /* file system state time stamp */ - } fs_44; - } fs_u2; - __fs32 fs_postblformat; /* format of positional layout tables */ - __fs32 fs_nrpos; /* number of rotational positions */ - __fs32 fs_postbloff; /* (__s16) rotation block list head */ - __fs32 fs_rotbloff; /* (__u8) blocks for each rotation */ - __fs32 fs_magic; /* magic number */ - __u8 fs_space[1]; /* list of blocks for each rotation */ -}; -#endif/*struct ufs_super_block*/ - -/* - * Preference for optimization. - */ -#define UFS_OPTTIME 0 /* minimize allocation time */ -#define UFS_OPTSPACE 1 /* minimize disk fragmentation */ - -/* - * Rotational layout table format types - */ -#define UFS_42POSTBLFMT -1 /* 4.2BSD rotational table format */ -#define UFS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */ - -/* - * Convert cylinder group to base address of its global summary info. - */ -#define fs_cs(indx) s_csp[(indx)] - -/* - * Cylinder group block for a file system. - * - * Writable fields in the cylinder group are protected by the associated - * super block lock fs->fs_lock. - */ -#define CG_MAGIC 0x090255 -#define ufs_cg_chkmagic(sb, ucg) \ - (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) -/* - * Macros for access to old cylinder group array structures - */ -#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot) -#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno]) -#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused) -#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free) -#define ufs_ocg_chkmagic(sb, ucg) \ - (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC) - -/* - * size of this structure is 172 B - */ -struct ufs_cylinder_group { - __fs32 cg_link; /* linked list of cyl groups */ - __fs32 cg_magic; /* magic number */ - __fs32 cg_time; /* time last written */ - __fs32 cg_cgx; /* we are the cgx'th cylinder group */ - __fs16 cg_ncyl; /* number of cyl's this cg */ - __fs16 cg_niblk; /* number of inode blocks this cg */ - __fs32 cg_ndblk; /* number of data blocks this cg */ - struct ufs_csum cg_cs; /* cylinder summary information */ - __fs32 cg_rotor; /* position of last used block */ - __fs32 cg_frotor; /* position of last used frag */ - __fs32 cg_irotor; /* position of last used inode */ - __fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */ - __fs32 cg_btotoff; /* (__u32) block totals per cylinder */ - __fs32 cg_boff; /* (short) free block positions */ - __fs32 cg_iusedoff; /* (char) used inode map */ - __fs32 cg_freeoff; /* (u_char) free block map */ - __fs32 cg_nextfreeoff; /* (u_char) next available space */ - union { - struct { - __fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */ - __fs32 cg_clusteroff; /* (u_int8) free cluster map */ - __fs32 cg_nclusterblks; /* number of clusters this cg */ - __fs32 cg_sparecon[13]; /* reserved for future use */ - } cg_44; - struct { - __fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */ - __fs32 cg_clusteroff; /* (u_int8) free cluster map */ - __fs32 cg_nclusterblks;/* number of clusters this cg */ - __fs32 cg_niblk; /* number of inode blocks this cg */ - __fs32 cg_initediblk; /* last initialized inode */ - __fs32 cg_sparecon32[3];/* reserved for future use */ - __fs64 cg_time; /* time last written */ - __fs64 cg_sparecon[3]; /* reserved for future use */ - } cg_u2; - __fs32 cg_sparecon[16]; /* reserved for future use */ - } cg_u; - __u8 cg_space[1]; /* space for cylinder group maps */ -/* actually longer */ -}; - -/* Historic Cylinder group info */ -struct ufs_old_cylinder_group { - __fs32 cg_link; /* linked list of cyl groups */ - __fs32 cg_rlink; /* for incore cyl groups */ - __fs32 cg_time; /* time last written */ - __fs32 cg_cgx; /* we are the cgx'th cylinder group */ - __fs16 cg_ncyl; /* number of cyl's this cg */ - __fs16 cg_niblk; /* number of inode blocks this cg */ - __fs32 cg_ndblk; /* number of data blocks this cg */ - struct ufs_csum cg_cs; /* cylinder summary information */ - __fs32 cg_rotor; /* position of last used block */ - __fs32 cg_frotor; /* position of last used frag */ - __fs32 cg_irotor; /* position of last used inode */ - __fs32 cg_frsum[8]; /* counts of available frags */ - __fs32 cg_btot[32]; /* block totals per cylinder */ - __fs16 cg_b[32][8]; /* positions of free blocks */ - __u8 cg_iused[256]; /* used inode map */ - __fs32 cg_magic; /* magic number */ - __u8 cg_free[1]; /* free block map */ -/* actually longer */ -}; - -/* - * structure of an on-disk inode - */ -struct ufs_inode { - __fs16 ui_mode; /* 0x0 */ - __fs16 ui_nlink; /* 0x2 */ - union { - struct { - __fs16 ui_suid; /* 0x4 */ - __fs16 ui_sgid; /* 0x6 */ - } oldids; - __fs32 ui_inumber; /* 0x4 lsf: inode number */ - __fs32 ui_author; /* 0x4 GNU HURD: author */ - } ui_u1; - __fs64 ui_size; /* 0x8 */ - struct ufs_timeval ui_atime; /* 0x10 access */ - struct ufs_timeval ui_mtime; /* 0x18 modification */ - struct ufs_timeval ui_ctime; /* 0x20 creation */ - union { - struct { - __fs32 ui_db[UFS_NDADDR];/* 0x28 data blocks */ - __fs32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */ - } ui_addr; - __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ - } ui_u2; - __fs32 ui_flags; /* 0x64 immutable, append-only... */ - __fs32 ui_blocks; /* 0x68 blocks in use */ - __fs32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */ - union { - struct { - __fs32 ui_shadow; /* 0x70 shadow inode with security data */ - __fs32 ui_uid; /* 0x74 long EFT version of uid */ - __fs32 ui_gid; /* 0x78 long EFT version of gid */ - __fs32 ui_oeftflag; /* 0x7c reserved */ - } ui_sun; - struct { - __fs32 ui_uid; /* 0x70 File owner */ - __fs32 ui_gid; /* 0x74 File group */ - __fs32 ui_spare[2]; /* 0x78 reserved */ - } ui_44; - struct { - __fs32 ui_uid; /* 0x70 */ - __fs32 ui_gid; /* 0x74 */ - __fs16 ui_modeh; /* 0x78 mode high bits */ - __fs16 ui_spare; /* 0x7A unused */ - __fs32 ui_trans; /* 0x7c filesystem translator */ - } ui_hurd; - } ui_u3; -}; - -#define UFS_NXADDR 2 /* External addresses in inode. */ -struct ufs2_inode { - __fs16 ui_mode; /* 0: IFMT, permissions; see below. */ - __fs16 ui_nlink; /* 2: File link count. */ - __fs32 ui_uid; /* 4: File owner. */ - __fs32 ui_gid; /* 8: File group. */ - __fs32 ui_blksize; /* 12: Inode blocksize. */ - __fs64 ui_size; /* 16: File byte count. */ - __fs64 ui_blocks; /* 24: Bytes actually held. */ - __fs64 ui_atime; /* 32: Last access time. */ - __fs64 ui_mtime; /* 40: Last modified time. */ - __fs64 ui_ctime; /* 48: Last inode change time. */ - __fs64 ui_birthtime; /* 56: Inode creation time. */ - __fs32 ui_mtimensec; /* 64: Last modified time. */ - __fs32 ui_atimensec; /* 68: Last access time. */ - __fs32 ui_ctimensec; /* 72: Last inode change time. */ - __fs32 ui_birthnsec; /* 76: Inode creation time. */ - __fs32 ui_gen; /* 80: Generation number. */ - __fs32 ui_kernflags; /* 84: Kernel flags. */ - __fs32 ui_flags; /* 88: Status flags (chflags). */ - __fs32 ui_extsize; /* 92: External attributes block. */ - __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */ - union { - struct { - __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ - __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ - } ui_addr; - __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ - } ui_u2; - __fs64 ui_spare[3]; /* 232: Reserved; currently unused */ -}; - - -/* FreeBSD has these in sys/stat.h */ -/* ui_flags that can be set by a file owner */ -#define UFS_UF_SETTABLE 0x0000ffff -#define UFS_UF_NODUMP 0x00000001 /* do not dump */ -#define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */ -#define UFS_UF_APPEND 0x00000004 /* append-only */ -#define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */ -#define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */ -/* ui_flags that only root can set */ -#define UFS_SF_SETTABLE 0xffff0000 -#define UFS_SF_ARCHIVED 0x00010000 /* archived */ -#define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */ -#define UFS_SF_APPEND 0x00040000 /* append-only */ -#define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */ - -/* - * This structure is used for reading disk structures larger - * than the size of fragment. - */ -struct ufs_buffer_head { - __u64 fragment; /* first fragment */ - __u64 count; /* number of fragments */ - struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */ -}; - -struct ufs_cg_private_info { - struct ufs_buffer_head c_ubh; - __u32 c_cgx; /* number of cylidner group */ - __u16 c_ncyl; /* number of cyl's this cg */ - __u16 c_niblk; /* number of inode blocks this cg */ - __u32 c_ndblk; /* number of data blocks this cg */ - __u32 c_rotor; /* position of last used block */ - __u32 c_frotor; /* position of last used frag */ - __u32 c_irotor; /* position of last used inode */ - __u32 c_btotoff; /* (__u32) block totals per cylinder */ - __u32 c_boff; /* (short) free block positions */ - __u32 c_iusedoff; /* (char) used inode map */ - __u32 c_freeoff; /* (u_char) free block map */ - __u32 c_nextfreeoff; /* (u_char) next available space */ - __u32 c_clustersumoff;/* (u_int32) counts of avail clusters */ - __u32 c_clusteroff; /* (u_int8) free cluster map */ - __u32 c_nclusterblks; /* number of clusters this cg */ -}; - - -struct ufs_sb_private_info { - struct ufs_buffer_head s_ubh; /* buffer containing super block */ - struct ufs_csum_core cs_total; - __u32 s_sblkno; /* offset of super-blocks in filesys */ - __u32 s_cblkno; /* offset of cg-block in filesys */ - __u32 s_iblkno; /* offset of inode-blocks in filesys */ - __u32 s_dblkno; /* offset of first data after cg */ - __u32 s_cgoffset; /* cylinder group offset in cylinder */ - __u32 s_cgmask; /* used to calc mod fs_ntrak */ - __u32 s_size; /* number of blocks (fragments) in fs */ - __u32 s_dsize; /* number of data blocks in fs */ - __u64 s_u2_size; /* ufs2: number of blocks (fragments) in fs */ - __u64 s_u2_dsize; /*ufs2: number of data blocks in fs */ - __u32 s_ncg; /* number of cylinder groups */ - __u32 s_bsize; /* size of basic blocks */ - __u32 s_fsize; /* size of fragments */ - __u32 s_fpb; /* fragments per block */ - __u32 s_minfree; /* minimum percentage of free blocks */ - __u32 s_bmask; /* `blkoff'' calc of blk offsets */ - __u32 s_fmask; /* s_fsize mask */ - __u32 s_bshift; /* `lblkno'' calc of logical blkno */ - __u32 s_fshift; /* s_fsize shift */ - __u32 s_fpbshift; /* fragments per block shift */ - __u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */ - __u32 s_sbsize; /* actual size of super block */ - __u32 s_csmask; /* csum block offset */ - __u32 s_csshift; /* csum block number */ - __u32 s_nindir; /* value of NINDIR */ - __u32 s_inopb; /* value of INOPB */ - __u32 s_nspf; /* value of NSPF */ - __u32 s_npsect; /* # sectors/track including spares */ - __u32 s_interleave; /* hardware sector interleave */ - __u32 s_trackskew; /* sector 0 skew, per track */ - __u64 s_csaddr; /* blk addr of cyl grp summary area */ - __u32 s_cssize; /* size of cyl grp summary area */ - __u32 s_cgsize; /* cylinder group size */ - __u32 s_ntrak; /* tracks per cylinder */ - __u32 s_nsect; /* sectors per track */ - __u32 s_spc; /* sectors per cylinder */ - __u32 s_ipg; /* inodes per cylinder group */ - __u32 s_fpg; /* fragments per group */ - __u32 s_cpc; /* cyl per cycle in postbl */ - __s32 s_contigsumsize;/* size of cluster summary array, 44bsd */ - __s64 s_qbmask; /* ~usb_bmask */ - __s64 s_qfmask; /* ~usb_fmask */ - __s32 s_postblformat; /* format of positional layout tables */ - __s32 s_nrpos; /* number of rotational positions */ - __s32 s_postbloff; /* (__s16) rotation block list head */ - __s32 s_rotbloff; /* (__u8) blocks for each rotation */ - - __u32 s_fpbmask; /* fragments per block mask */ - __u32 s_apb; /* address per block */ - __u32 s_2apb; /* address per block^2 */ - __u32 s_3apb; /* address per block^3 */ - __u32 s_apbmask; /* address per block mask */ - __u32 s_apbshift; /* address per block shift */ - __u32 s_2apbshift; /* address per block shift * 2 */ - __u32 s_3apbshift; /* address per block shift * 3 */ - __u32 s_nspfshift; /* number of sector per fragment shift */ - __u32 s_nspb; /* number of sector per block */ - __u32 s_inopf; /* inodes per fragment */ - __u32 s_sbbase; /* offset of NeXTstep superblock */ - __u32 s_bpf; /* bits per fragment */ - __u32 s_bpfshift; /* bits per fragment shift*/ - __u32 s_bpfmask; /* bits per fragment mask */ - - __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ - __s32 fs_magic; /* filesystem magic */ - unsigned int s_dirblksize; -}; - -/* - * Sizes of this structures are: - * ufs_super_block_first 512 - * ufs_super_block_second 512 - * ufs_super_block_third 356 - */ -struct ufs_super_block_first { - union { - struct { - __fs32 fs_link; /* UNUSED */ - } fs_42; - struct { - __fs32 fs_state; /* file system state flag */ - } fs_sun; - } fs_u0; - __fs32 fs_rlink; - __fs32 fs_sblkno; - __fs32 fs_cblkno; - __fs32 fs_iblkno; - __fs32 fs_dblkno; - __fs32 fs_cgoffset; - __fs32 fs_cgmask; - __fs32 fs_time; - __fs32 fs_size; - __fs32 fs_dsize; - __fs32 fs_ncg; - __fs32 fs_bsize; - __fs32 fs_fsize; - __fs32 fs_frag; - __fs32 fs_minfree; - __fs32 fs_rotdelay; - __fs32 fs_rps; - __fs32 fs_bmask; - __fs32 fs_fmask; - __fs32 fs_bshift; - __fs32 fs_fshift; - __fs32 fs_maxcontig; - __fs32 fs_maxbpg; - __fs32 fs_fragshift; - __fs32 fs_fsbtodb; - __fs32 fs_sbsize; - __fs32 fs_csmask; - __fs32 fs_csshift; - __fs32 fs_nindir; - __fs32 fs_inopb; - __fs32 fs_nspf; - __fs32 fs_optim; - union { - struct { - __fs32 fs_npsect; - } fs_sun; - struct { - __fs32 fs_state; - } fs_sunx86; - } fs_u1; - __fs32 fs_interleave; - __fs32 fs_trackskew; - __fs32 fs_id[2]; - __fs32 fs_csaddr; - __fs32 fs_cssize; - __fs32 fs_cgsize; - __fs32 fs_ntrak; - __fs32 fs_nsect; - __fs32 fs_spc; - __fs32 fs_ncyl; - __fs32 fs_cpg; - __fs32 fs_ipg; - __fs32 fs_fpg; - struct ufs_csum fs_cstotal; - __s8 fs_fmod; - __s8 fs_clean; - __s8 fs_ronly; - __s8 fs_flags; - __s8 fs_fsmnt[UFS_MAXMNTLEN - 212]; - -}; - -struct ufs_super_block_second { - union { - struct { - __s8 fs_fsmnt[212]; - __fs32 fs_cgrotor; - __fs32 fs_csp[UFS_MAXCSBUFS]; - __fs32 fs_maxcluster; - __fs32 fs_cpc; - __fs16 fs_opostbl[82]; - } fs_u1; - struct { - __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212]; - __u8 fs_volname[UFS2_MAXVOLLEN]; - __fs64 fs_swuid; - __fs32 fs_pad; - __fs32 fs_cgrotor; - __fs32 fs_ocsp[UFS2_NOCSPTRS]; - __fs32 fs_contigdirs; - __fs32 fs_csp; - __fs32 fs_maxcluster; - __fs32 fs_active; - __fs32 fs_old_cpc; - __fs32 fs_maxbsize; - __fs64 fs_sparecon64[17]; - __fs64 fs_sblockloc; - __fs64 cs_ndir; - __fs64 cs_nbfree; - } fs_u2; - } fs_un; -}; - -struct ufs_super_block_third { - union { - struct { - __fs16 fs_opostbl[46]; - } fs_u1; - struct { - __fs64 cs_nifree; /* number of free inodes */ - __fs64 cs_nffree; /* number of free frags */ - __fs64 cs_numclusters; /* number of free clusters */ - __fs64 cs_spare[3]; /* future expansion */ - struct ufs_timeval fs_time; /* last time written */ - __fs64 fs_size; /* number of blocks in fs */ - __fs64 fs_dsize; /* number of data blocks in fs */ - __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ - __fs64 fs_pendingblocks;/* blocks in process of being freed */ - __fs32 fs_pendinginodes;/*inodes in process of being freed */ - } __attribute__ ((packed)) fs_u2; - } fs_un1; - union { - struct { - __fs32 fs_sparecon[53];/* reserved for future constants */ - __fs32 fs_reclaim; - __fs32 fs_sparecon2[1]; - __fs32 fs_state; /* file system state time stamp */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - } fs_sun; - struct { - __fs32 fs_sparecon[53];/* reserved for future constants */ - __fs32 fs_reclaim; - __fs32 fs_sparecon2[1]; - __fs32 fs_npsect; /* # sectors/track including spares */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - } fs_sunx86; - struct { - __fs32 fs_sparecon[50];/* reserved for future constants */ - __fs32 fs_contigsumsize;/* size of cluster summary array */ - __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ - __fs32 fs_inodefmt; /* format of on-disk inodes */ - __fs32 fs_maxfilesize[2]; /* max representable file size */ - __fs32 fs_qbmask[2]; /* ~usb_bmask */ - __fs32 fs_qfmask[2]; /* ~usb_fmask */ - __fs32 fs_state; /* file system state time stamp */ - } fs_44; - } fs_un2; - __fs32 fs_postblformat; - __fs32 fs_nrpos; - __fs32 fs_postbloff; - __fs32 fs_rotbloff; - __fs32 fs_magic; - __u8 fs_space[1]; -}; - -#endif /* __LINUX_UFS_FS_H */ diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 923db99..1123267 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h @@ -35,6 +35,7 @@ struct new_utsname { #include <linux/sched.h> #include <linux/kref.h> #include <linux/nsproxy.h> +#include <linux/err.h> #include <asm/atomic.h> struct uts_namespace { @@ -43,6 +44,7 @@ struct uts_namespace { }; extern struct uts_namespace init_uts_ns; +#ifdef CONFIG_UTS_NS static inline void get_uts_ns(struct uts_namespace *ns) { kref_get(&ns->kref); @@ -56,6 +58,25 @@ static inline void put_uts_ns(struct uts_namespace *ns) { kref_put(&ns->kref, free_uts_ns); } +#else +static inline void get_uts_ns(struct uts_namespace *ns) +{ +} + +static inline void put_uts_ns(struct uts_namespace *ns) +{ +} + +static inline struct uts_namespace *copy_utsname(unsigned long flags, + struct uts_namespace *ns) +{ + if (flags & CLONE_NEWUTS) + return ERR_PTR(-EINVAL); + + return ns; +} +#endif + static inline struct new_utsname *utsname(void) { return ¤t->nsproxy->uts_ns->name; diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index feb5e99..9448ffb 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc); void reset_vc(struct vc_data *vc); extern int unbind_con_driver(const struct consw *csw, int first, int last, int deflt); +int vty_init(void); /* * vc_screen.c shares this temporary buffer with the console write code so that diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h new file mode 100644 index 0000000..9797fec --- /dev/null +++ b/include/linux/w1-gpio.h @@ -0,0 +1,23 @@ +/* + * w1-gpio interface to platform code + * + * Copyright (C) 2007 Ville Syrjala <syrjala@sci.fi> + * + * 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. + */ +#ifndef _LINUX_W1_GPIO_H +#define _LINUX_W1_GPIO_H + +/** + * struct w1_gpio_platform_data - Platform-dependent data for w1-gpio + * @pin: GPIO pin to use + * @is_open_drain: GPIO pin is configured as open drain + */ +struct w1_gpio_platform_data { + unsigned int pin; + unsigned int is_open_drain:1; +}; + +#endif /* _LINUX_W1_GPIO_H */ diff --git a/include/linux/wait.h b/include/linux/wait.h index 33a2aa9..0081147 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -117,9 +117,9 @@ static inline int waitqueue_active(wait_queue_head_t *q) */ #define is_sync_wait(wait) (!(wait) || ((wait)->private)) -extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); -extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); -extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); +extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); +extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); +extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) { @@ -141,16 +141,16 @@ static inline void __remove_wait_queue(wait_queue_head_t *head, list_del(&old->task_list); } -void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key)); -extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode)); -extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)); -void FASTCALL(__wake_up_bit(wait_queue_head_t *, void *, int)); -int FASTCALL(__wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned)); -int FASTCALL(__wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned)); -void FASTCALL(wake_up_bit(void *, int)); -int FASTCALL(out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned)); -int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned)); -wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int)); +void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); +extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode); +extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); +void __wake_up_bit(wait_queue_head_t *, void *, int); +int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); +int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); +void wake_up_bit(void *, int); +int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); +int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); +wait_queue_head_t *bit_waitqueue(void *, int); #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) #define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL) @@ -437,11 +437,9 @@ extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, /* * Waitqueues which are removed from the waitqueue_head at wakeup time */ -void FASTCALL(prepare_to_wait(wait_queue_head_t *q, - wait_queue_t *wait, int state)); -void FASTCALL(prepare_to_wait_exclusive(wait_queue_head_t *q, - wait_queue_t *wait, int state)); -void FASTCALL(finish_wait(wait_queue_head_t *q, wait_queue_t *wait)); +void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); +void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); +void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 7f28c32..542526c 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -178,18 +178,17 @@ __create_workqueue_key(const char *name, int singlethread, extern void destroy_workqueue(struct workqueue_struct *wq); -extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); -extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, - struct delayed_work *work, unsigned long delay)); +extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); +extern int queue_delayed_work(struct workqueue_struct *wq, + struct delayed_work *work, unsigned long delay); extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, struct delayed_work *work, unsigned long delay); -extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); +extern void flush_workqueue(struct workqueue_struct *wq); extern void flush_scheduled_work(void); -extern int FASTCALL(schedule_work(struct work_struct *work)); -extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, - unsigned long delay)); +extern int schedule_work(struct work_struct *work); +extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay); extern int schedule_on_each_cpu(work_func_t func); |