Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/power/wm97xx_battery.c
This commit is contained in:
@@ -268,6 +268,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm.h),)
|
||||
unifdef-y += kvm.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
|
||||
unifdef-y += kvm_para.h
|
||||
endif
|
||||
unifdef-y += llc.h
|
||||
unifdef-y += loop.h
|
||||
unifdef-y += lp.h
|
||||
|
@@ -79,9 +79,12 @@ struct agp_memory {
|
||||
u32 physical;
|
||||
bool is_bound;
|
||||
bool is_flushed;
|
||||
bool vmalloc_flag;
|
||||
bool vmalloc_flag;
|
||||
/* list of agp_memory mapped to the aperture */
|
||||
struct list_head mapped_list;
|
||||
/* DMA-mapped addresses */
|
||||
struct scatterlist *sg_list;
|
||||
int num_sg;
|
||||
};
|
||||
|
||||
#define AGP_NORMAL_MEMORY 0
|
||||
|
@@ -121,9 +121,9 @@ struct kiocb {
|
||||
|
||||
/*
|
||||
* If the aio_resfd field of the userspace iocb is not zero,
|
||||
* this is the underlying file* to deliver event to.
|
||||
* this is the underlying eventfd context to deliver events to.
|
||||
*/
|
||||
struct file *ki_eventfd;
|
||||
struct eventfd_ctx *ki_eventfd;
|
||||
};
|
||||
|
||||
#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY)
|
||||
@@ -225,8 +225,6 @@ static inline void exit_aio(struct mm_struct *mm) { }
|
||||
|
||||
#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
|
||||
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
static inline struct kiocb *list_kiocb(struct list_head *h)
|
||||
{
|
||||
return list_entry(h, struct kiocb, ki_list);
|
||||
|
@@ -36,6 +36,11 @@ struct amba_driver {
|
||||
struct amba_id *id_table;
|
||||
};
|
||||
|
||||
enum amba_vendor {
|
||||
AMBA_VENDOR_ARM = 0x41,
|
||||
AMBA_VENDOR_ST = 0x80,
|
||||
};
|
||||
|
||||
#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
|
||||
#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
|
||||
|
||||
|
80
include/linux/amba/pl093.h
Normal file
80
include/linux/amba/pl093.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* linux/amba/pl093.h
|
||||
*
|
||||
* Copyright (c) 2008 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* AMBA PL093 SSMC (synchronous static memory controller)
|
||||
* See DDI0236.pdf (r0p4) for more details
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */
|
||||
|
||||
/* Offsets for SMBxxxxRy registers */
|
||||
|
||||
#define SMBIDCYR (0x00)
|
||||
#define SMBWSTRDR (0x04)
|
||||
#define SMBWSTWRR (0x08)
|
||||
#define SMBWSTOENR (0x0C)
|
||||
#define SMBWSTWENR (0x10)
|
||||
#define SMBCR (0x14)
|
||||
#define SMBSR (0x18)
|
||||
#define SMBWSTBRDR (0x1C)
|
||||
|
||||
/* Masks for SMB registers */
|
||||
#define IDCY_MASK (0xf)
|
||||
#define WSTRD_MASK (0xf)
|
||||
#define WSTWR_MASK (0xf)
|
||||
#define WSTOEN_MASK (0xf)
|
||||
#define WSTWEN_MASK (0xf)
|
||||
|
||||
/* Notes from datasheet:
|
||||
* WSTOEN <= WSTRD
|
||||
* WSTWEN <= WSTWR
|
||||
*
|
||||
* WSTOEN is not used with nWAIT
|
||||
*/
|
||||
|
||||
/* SMBCR bit definitions */
|
||||
#define SMBCR_BIWRITEEN (1 << 21)
|
||||
#define SMBCR_ADDRVALIDWRITEEN (1 << 20)
|
||||
#define SMBCR_SYNCWRITE (1 << 17)
|
||||
#define SMBCR_BMWRITE (1 << 16)
|
||||
#define SMBCR_WRAPREAD (1 << 14)
|
||||
#define SMBCR_BIREADEN (1 << 13)
|
||||
#define SMBCR_ADDRVALIDREADEN (1 << 12)
|
||||
#define SMBCR_SYNCREAD (1 << 9)
|
||||
#define SMBCR_BMREAD (1 << 8)
|
||||
#define SMBCR_SMBLSPOL (1 << 6)
|
||||
#define SMBCR_WP (1 << 3)
|
||||
#define SMBCR_WAITEN (1 << 2)
|
||||
#define SMBCR_WAITPOL (1 << 1)
|
||||
#define SMBCR_RBLE (1 << 0)
|
||||
|
||||
#define SMBCR_BURSTLENWRITE_MASK (3 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_4 (0 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_8 (1 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_RESERVED (2 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18)
|
||||
|
||||
#define SMBCR_BURSTLENREAD_MASK (3 << 10)
|
||||
#define SMBCR_BURSTLENREAD_4 (0 << 10)
|
||||
#define SMBCR_BURSTLENREAD_8 (1 << 10)
|
||||
#define SMBCR_BURSTLENREAD_16 (2 << 10)
|
||||
#define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10)
|
||||
|
||||
#define SMBCR_MW_MASK (3 << 4)
|
||||
#define SMBCR_MW_8BIT (0 << 4)
|
||||
#define SMBCR_MW_16BIT (1 << 4)
|
||||
#define SMBCR_MW_M32BIT (2 << 4)
|
||||
|
||||
/* SSMC status registers */
|
||||
#define SSMCCSR (0x200)
|
||||
#define SSMCCR (0x204)
|
||||
#define SSMCITCR (0x208)
|
||||
#define SSMCITIP (0x20C)
|
||||
#define SSMCITIOP (0x210)
|
@@ -337,7 +337,8 @@ struct net_device *alloc_arcdev(const char *name);
|
||||
|
||||
int arcnet_open(struct net_device *dev);
|
||||
int arcnet_close(struct net_device *dev);
|
||||
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
void arcnet_timeout(struct net_device *dev);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
@@ -210,15 +210,25 @@ enum {
|
||||
ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */
|
||||
ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
|
||||
ATA_CMD_EDD = 0x90, /* execute device diagnostic */
|
||||
ATA_CMD_DOWNLOAD_MICRO = 0x92,
|
||||
ATA_CMD_NOP = 0x00,
|
||||
ATA_CMD_FLUSH = 0xE7,
|
||||
ATA_CMD_FLUSH_EXT = 0xEA,
|
||||
ATA_CMD_ID_ATA = 0xEC,
|
||||
ATA_CMD_ID_ATAPI = 0xA1,
|
||||
ATA_CMD_SERVICE = 0xA2,
|
||||
ATA_CMD_READ = 0xC8,
|
||||
ATA_CMD_READ_EXT = 0x25,
|
||||
ATA_CMD_READ_QUEUED = 0x26,
|
||||
ATA_CMD_READ_STREAM_EXT = 0x2B,
|
||||
ATA_CMD_READ_STREAM_DMA_EXT = 0x2A,
|
||||
ATA_CMD_WRITE = 0xCA,
|
||||
ATA_CMD_WRITE_EXT = 0x35,
|
||||
ATA_CMD_WRITE_QUEUED = 0x36,
|
||||
ATA_CMD_WRITE_STREAM_EXT = 0x3B,
|
||||
ATA_CMD_WRITE_STREAM_DMA_EXT = 0x3A,
|
||||
ATA_CMD_WRITE_FUA_EXT = 0x3D,
|
||||
ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E,
|
||||
ATA_CMD_FPDMA_READ = 0x60,
|
||||
ATA_CMD_FPDMA_WRITE = 0x61,
|
||||
ATA_CMD_PIO_READ = 0x20,
|
||||
@@ -235,6 +245,7 @@ enum {
|
||||
ATA_CMD_PACKET = 0xA0,
|
||||
ATA_CMD_VERIFY = 0x40,
|
||||
ATA_CMD_VERIFY_EXT = 0x42,
|
||||
ATA_CMD_WRITE_UNCORR_EXT = 0x45,
|
||||
ATA_CMD_STANDBYNOW1 = 0xE0,
|
||||
ATA_CMD_IDLEIMMEDIATE = 0xE1,
|
||||
ATA_CMD_SLEEP = 0xE6,
|
||||
@@ -243,15 +254,34 @@ enum {
|
||||
ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
|
||||
ATA_CMD_SET_MAX = 0xF9,
|
||||
ATA_CMD_SET_MAX_EXT = 0x37,
|
||||
ATA_CMD_READ_LOG_EXT = 0x2f,
|
||||
ATA_CMD_READ_LOG_EXT = 0x2F,
|
||||
ATA_CMD_WRITE_LOG_EXT = 0x3F,
|
||||
ATA_CMD_READ_LOG_DMA_EXT = 0x47,
|
||||
ATA_CMD_WRITE_LOG_DMA_EXT = 0x57,
|
||||
ATA_CMD_TRUSTED_RCV = 0x5C,
|
||||
ATA_CMD_TRUSTED_RCV_DMA = 0x5D,
|
||||
ATA_CMD_TRUSTED_SND = 0x5E,
|
||||
ATA_CMD_TRUSTED_SND_DMA = 0x5F,
|
||||
ATA_CMD_PMP_READ = 0xE4,
|
||||
ATA_CMD_PMP_WRITE = 0xE8,
|
||||
ATA_CMD_CONF_OVERLAY = 0xB1,
|
||||
ATA_CMD_SEC_SET_PASS = 0xF1,
|
||||
ATA_CMD_SEC_UNLOCK = 0xF2,
|
||||
ATA_CMD_SEC_ERASE_PREP = 0xF3,
|
||||
ATA_CMD_SEC_ERASE_UNIT = 0xF4,
|
||||
ATA_CMD_SEC_FREEZE_LOCK = 0xF5,
|
||||
ATA_CMD_SEC_DISABLE_PASS = 0xF6,
|
||||
ATA_CMD_CONFIG_STREAM = 0x51,
|
||||
ATA_CMD_SMART = 0xB0,
|
||||
ATA_CMD_MEDIA_LOCK = 0xDE,
|
||||
ATA_CMD_MEDIA_UNLOCK = 0xDF,
|
||||
ATA_CMD_DSM = 0x06,
|
||||
ATA_CMD_CHK_MED_CRD_TYP = 0xD1,
|
||||
ATA_CMD_CFA_REQ_EXT_ERR = 0x03,
|
||||
ATA_CMD_CFA_WRITE_NE = 0x38,
|
||||
ATA_CMD_CFA_TRANS_SECT = 0x87,
|
||||
ATA_CMD_CFA_ERASE = 0xC0,
|
||||
ATA_CMD_CFA_WRITE_MULT_NE = 0xCD,
|
||||
/* marked obsolete in the ATA/ATAPI-7 spec */
|
||||
ATA_CMD_RESTORE = 0x10,
|
||||
|
||||
@@ -306,6 +336,7 @@ enum {
|
||||
/* SETFEATURE Sector counts for SATA features */
|
||||
SATA_AN = 0x05, /* Asynchronous Notification */
|
||||
SATA_DIPM = 0x03, /* Device Initiated Power Management */
|
||||
SATA_FPDMA_AA = 0x02, /* DMA Setup FIS Auto-Activate */
|
||||
|
||||
/* feature values for SET_MAX */
|
||||
ATA_SET_MAX_ADDR = 0x00,
|
||||
@@ -525,6 +556,9 @@ static inline int ata_is_data(u8 prot)
|
||||
#define ata_id_has_atapi_AN(id) \
|
||||
( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
|
||||
((id)[78] & (1 << 5)) )
|
||||
#define ata_id_has_fpdma_aa(id) \
|
||||
( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
|
||||
((id)[78] & (1 << 2)) )
|
||||
#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
|
||||
#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
|
||||
#define ata_id_u32(id,n) \
|
||||
|
@@ -17,7 +17,7 @@ struct attribute_container {
|
||||
struct list_head node;
|
||||
struct klist containers;
|
||||
struct class *class;
|
||||
struct attribute_group *grp;
|
||||
const struct attribute_group *grp;
|
||||
struct device_attribute **attrs;
|
||||
int (*match)(struct attribute_container *, struct device *);
|
||||
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#include <linux/proportions.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct page;
|
||||
@@ -23,9 +25,11 @@ struct dentry;
|
||||
* Bits in backing_dev_info.state
|
||||
*/
|
||||
enum bdi_state {
|
||||
BDI_pdflush, /* A pdflush thread is working this device */
|
||||
BDI_pending, /* On its way to being activated */
|
||||
BDI_wb_alloc, /* Default embedded wb allocated */
|
||||
BDI_async_congested, /* The async (write) queue is getting full */
|
||||
BDI_sync_congested, /* The sync queue is getting full */
|
||||
BDI_registered, /* bdi_register() was done */
|
||||
BDI_unused, /* Available bits start here */
|
||||
};
|
||||
|
||||
@@ -39,7 +43,23 @@ enum bdi_stat_item {
|
||||
|
||||
#define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))
|
||||
|
||||
struct bdi_writeback {
|
||||
struct list_head list; /* hangs off the bdi */
|
||||
|
||||
struct backing_dev_info *bdi; /* our parent bdi */
|
||||
unsigned int nr;
|
||||
|
||||
unsigned long last_old_flush; /* last old data flush */
|
||||
|
||||
struct task_struct *task; /* writeback task */
|
||||
struct list_head b_dirty; /* dirty inodes */
|
||||
struct list_head b_io; /* parked for writeback */
|
||||
struct list_head b_more_io; /* parked for more writeback */
|
||||
};
|
||||
|
||||
struct backing_dev_info {
|
||||
struct list_head bdi_list;
|
||||
struct rcu_head rcu_head;
|
||||
unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
|
||||
unsigned long state; /* Always use atomic bitops on this */
|
||||
unsigned int capabilities; /* Device capabilities */
|
||||
@@ -48,6 +68,8 @@ struct backing_dev_info {
|
||||
void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
|
||||
void *unplug_io_data;
|
||||
|
||||
char *name;
|
||||
|
||||
struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
|
||||
|
||||
struct prop_local_percpu completions;
|
||||
@@ -56,6 +78,14 @@ struct backing_dev_info {
|
||||
unsigned int min_ratio;
|
||||
unsigned int max_ratio, max_prop_frac;
|
||||
|
||||
struct bdi_writeback wb; /* default writeback info for this bdi */
|
||||
spinlock_t wb_lock; /* protects update side of wb_list */
|
||||
struct list_head wb_list; /* the flusher threads hanging off this bdi */
|
||||
unsigned long wb_mask; /* bitmask of registered tasks */
|
||||
unsigned int wb_cnt; /* number of registered tasks */
|
||||
|
||||
struct list_head work_list;
|
||||
|
||||
struct device *dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
@@ -71,6 +101,19 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
|
||||
const char *fmt, ...);
|
||||
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
|
||||
void bdi_unregister(struct backing_dev_info *bdi);
|
||||
void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages);
|
||||
int bdi_writeback_task(struct bdi_writeback *wb);
|
||||
int bdi_has_dirty_io(struct backing_dev_info *bdi);
|
||||
|
||||
extern spinlock_t bdi_lock;
|
||||
extern struct list_head bdi_list;
|
||||
|
||||
static inline int wb_has_dirty_io(struct bdi_writeback *wb)
|
||||
{
|
||||
return !list_empty(&wb->b_dirty) ||
|
||||
!list_empty(&wb->b_io) ||
|
||||
!list_empty(&wb->b_more_io);
|
||||
}
|
||||
|
||||
static inline void __add_bdi_stat(struct backing_dev_info *bdi,
|
||||
enum bdi_stat_item item, s64 amount)
|
||||
@@ -229,9 +272,14 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
|
||||
(1 << BDI_async_congested));
|
||||
}
|
||||
|
||||
void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
|
||||
void set_bdi_congested(struct backing_dev_info *bdi, int rw);
|
||||
long congestion_wait(int rw, long timeout);
|
||||
enum {
|
||||
BLK_RW_ASYNC = 0,
|
||||
BLK_RW_SYNC = 1,
|
||||
};
|
||||
|
||||
void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
|
||||
void set_bdi_congested(struct backing_dev_info *bdi, int sync);
|
||||
long congestion_wait(int sync, long timeout);
|
||||
|
||||
|
||||
static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
|
||||
@@ -256,6 +304,11 @@ static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi)
|
||||
return bdi->capabilities & BDI_CAP_SWAP_BACKED;
|
||||
}
|
||||
|
||||
static inline bool bdi_cap_flush_forker(struct backing_dev_info *bdi)
|
||||
{
|
||||
return bdi == &default_backing_dev_info;
|
||||
}
|
||||
|
||||
static inline bool mapping_cap_writeback_dirty(struct address_space *mapping)
|
||||
{
|
||||
return bdi_cap_writeback_dirty(mapping->backing_dev_info);
|
||||
@@ -271,4 +324,10 @@ static inline bool mapping_cap_swap_backed(struct address_space *mapping)
|
||||
return bdi_cap_swap_backed(mapping->backing_dev_info);
|
||||
}
|
||||
|
||||
static inline int bdi_sched_wait(void *word)
|
||||
{
|
||||
schedule();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_BACKING_DEV_H */
|
||||
|
@@ -117,6 +117,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm,
|
||||
int executable_stack);
|
||||
extern int bprm_mm_init(struct linux_binprm *bprm);
|
||||
extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
|
||||
extern int prepare_bprm_creds(struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern int set_binfmt(struct linux_binfmt *new);
|
||||
|
@@ -142,56 +142,51 @@ struct bio {
|
||||
*
|
||||
* bit 0 -- data direction
|
||||
* If not set, bio is a read from device. If set, it's a write to device.
|
||||
* bit 1 -- rw-ahead when set
|
||||
* bit 2 -- barrier
|
||||
* bit 1 -- fail fast device errors
|
||||
* bit 2 -- fail fast transport errors
|
||||
* bit 3 -- fail fast driver errors
|
||||
* bit 4 -- rw-ahead when set
|
||||
* bit 5 -- barrier
|
||||
* Insert a serialization point in the IO queue, forcing previously
|
||||
* submitted IO to be completed before this one is issued.
|
||||
* bit 3 -- synchronous I/O hint.
|
||||
* bit 4 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 5 -- metadata request
|
||||
* bit 6 -- synchronous I/O hint.
|
||||
* bit 7 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 8 -- metadata request
|
||||
* Used for tracing to differentiate metadata and data IO. May also
|
||||
* get some preferential treatment in the IO scheduler
|
||||
* bit 6 -- discard sectors
|
||||
* bit 9 -- discard sectors
|
||||
* Informs the lower level device that this range of sectors is no longer
|
||||
* used by the file system and may thus be freed by the device. Used
|
||||
* for flash based storage.
|
||||
* bit 7 -- fail fast device errors
|
||||
* bit 8 -- fail fast transport errors
|
||||
* bit 9 -- fail fast driver errors
|
||||
* Don't want driver retries for any fast fail whatever the reason.
|
||||
* bit 10 -- Tell the IO scheduler not to wait for more requests after this
|
||||
one has been submitted, even if it is a SYNC request.
|
||||
*/
|
||||
#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
|
||||
#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
|
||||
#define BIO_RW_BARRIER 2
|
||||
#define BIO_RW_SYNCIO 3
|
||||
#define BIO_RW_UNPLUG 4
|
||||
#define BIO_RW_META 5
|
||||
#define BIO_RW_DISCARD 6
|
||||
#define BIO_RW_FAILFAST_DEV 7
|
||||
#define BIO_RW_FAILFAST_TRANSPORT 8
|
||||
#define BIO_RW_FAILFAST_DRIVER 9
|
||||
#define BIO_RW_NOIDLE 10
|
||||
|
||||
#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
|
||||
enum bio_rw_flags {
|
||||
BIO_RW,
|
||||
BIO_RW_FAILFAST_DEV,
|
||||
BIO_RW_FAILFAST_TRANSPORT,
|
||||
BIO_RW_FAILFAST_DRIVER,
|
||||
/* above flags must match REQ_* */
|
||||
BIO_RW_AHEAD,
|
||||
BIO_RW_BARRIER,
|
||||
BIO_RW_SYNCIO,
|
||||
BIO_RW_UNPLUG,
|
||||
BIO_RW_META,
|
||||
BIO_RW_DISCARD,
|
||||
BIO_RW_NOIDLE,
|
||||
};
|
||||
|
||||
/*
|
||||
* Old defines, these should eventually be replaced by direct usage of
|
||||
* bio_rw_flagged()
|
||||
* First four bits must match between bio->bi_rw and rq->cmd_flags, make
|
||||
* that explicit here.
|
||||
*/
|
||||
#define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER)
|
||||
#define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO)
|
||||
#define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG)
|
||||
#define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV)
|
||||
#define bio_failfast_transport(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT)
|
||||
#define bio_failfast_driver(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER)
|
||||
#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
|
||||
#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
|
||||
#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
|
||||
#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
|
||||
#define BIO_RW_RQ_MASK 0xf
|
||||
|
||||
static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag)
|
||||
{
|
||||
return (bio->bi_rw & (1 << flag)) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* upper 16 bits of bi_rw define the io priority of this bio
|
||||
@@ -216,7 +211,7 @@ struct bio {
|
||||
#define bio_offset(bio) bio_iovec((bio))->bv_offset
|
||||
#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
|
||||
#define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD))
|
||||
|
||||
static inline unsigned int bio_cur_bytes(struct bio *bio)
|
||||
{
|
||||
@@ -319,7 +314,6 @@ static inline int bio_has_allocated_vec(struct bio *bio)
|
||||
*/
|
||||
struct bio_integrity_payload {
|
||||
struct bio *bip_bio; /* parent bio */
|
||||
struct bio_vec *bip_vec; /* integrity data vector */
|
||||
|
||||
sector_t bip_sector; /* virtual start sector */
|
||||
|
||||
@@ -328,11 +322,12 @@ struct bio_integrity_payload {
|
||||
|
||||
unsigned int bip_size;
|
||||
|
||||
unsigned short bip_pool; /* pool the ivec came from */
|
||||
unsigned short bip_slab; /* slab the bip came from */
|
||||
unsigned short bip_vcnt; /* # of integrity bio_vecs */
|
||||
unsigned short bip_idx; /* current bip_vec index */
|
||||
|
||||
struct work_struct bip_work; /* I/O completion */
|
||||
struct bio_vec bip_vec[0]; /* embedded bvec array */
|
||||
};
|
||||
#endif /* CONFIG_BLK_DEV_INTEGRITY */
|
||||
|
||||
@@ -430,6 +425,9 @@ struct bio_set {
|
||||
unsigned int front_pad;
|
||||
|
||||
mempool_t *bio_pool;
|
||||
#if defined(CONFIG_BLK_DEV_INTEGRITY)
|
||||
mempool_t *bio_integrity_pool;
|
||||
#endif
|
||||
mempool_t *bvec_pool;
|
||||
};
|
||||
|
||||
@@ -634,8 +632,9 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
|
||||
|
||||
#define bio_integrity(bio) (bio->bi_integrity != NULL)
|
||||
|
||||
extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
|
||||
extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
|
||||
extern void bio_integrity_free(struct bio *);
|
||||
extern void bio_integrity_free(struct bio *, struct bio_set *);
|
||||
extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
|
||||
extern int bio_integrity_enabled(struct bio *bio);
|
||||
extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
|
||||
@@ -645,21 +644,27 @@ extern void bio_integrity_endio(struct bio *, int);
|
||||
extern void bio_integrity_advance(struct bio *, unsigned int);
|
||||
extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
|
||||
extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
|
||||
extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
|
||||
extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *);
|
||||
extern int bioset_integrity_create(struct bio_set *, int);
|
||||
extern void bioset_integrity_free(struct bio_set *);
|
||||
extern void bio_integrity_init(void);
|
||||
|
||||
#else /* CONFIG_BLK_DEV_INTEGRITY */
|
||||
|
||||
#define bio_integrity(a) (0)
|
||||
#define bioset_integrity_create(a, b) (0)
|
||||
#define bio_integrity_prep(a) (0)
|
||||
#define bio_integrity_enabled(a) (0)
|
||||
#define bio_integrity_clone(a, b, c) (0)
|
||||
#define bio_integrity_free(a) do { } while (0)
|
||||
#define bio_integrity_clone(a, b, c, d) (0)
|
||||
#define bioset_integrity_free(a) do { } while (0)
|
||||
#define bio_integrity_free(a, b) do { } while (0)
|
||||
#define bio_integrity_endio(a, b) do { } while (0)
|
||||
#define bio_integrity_advance(a, b) do { } while (0)
|
||||
#define bio_integrity_trim(a, b, c) do { } while (0)
|
||||
#define bio_integrity_split(a, b, c) do { } while (0)
|
||||
#define bio_integrity_set_tag(a, b, c) do { } while (0)
|
||||
#define bio_integrity_get_tag(a, b, c) do { } while (0)
|
||||
#define bio_integrity_init(a) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_BLK_DEV_INTEGRITY */
|
||||
|
||||
|
@@ -94,13 +94,13 @@ extern void __bitmap_shift_right(unsigned long *dst,
|
||||
const unsigned long *src, int shift, int bits);
|
||||
extern void __bitmap_shift_left(unsigned long *dst,
|
||||
const unsigned long *src, int shift, int bits);
|
||||
extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
|
||||
extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
|
||||
const unsigned long *bitmap2, int bits);
|
||||
extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
|
||||
const unsigned long *bitmap2, int bits);
|
||||
extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
|
||||
const unsigned long *bitmap2, int bits);
|
||||
extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
|
||||
extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
|
||||
const unsigned long *bitmap2, int bits);
|
||||
extern int __bitmap_intersects(const unsigned long *bitmap1,
|
||||
const unsigned long *bitmap2, int bits);
|
||||
@@ -171,13 +171,12 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
|
||||
static inline int bitmap_and(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 & *src2;
|
||||
else
|
||||
__bitmap_and(dst, src1, src2, nbits);
|
||||
return (*dst = *src1 & *src2) != 0;
|
||||
return __bitmap_and(dst, src1, src2, nbits);
|
||||
}
|
||||
|
||||
static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
|
||||
@@ -198,13 +197,12 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
|
||||
__bitmap_xor(dst, src1, src2, nbits);
|
||||
}
|
||||
|
||||
static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
|
||||
static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 & ~(*src2);
|
||||
else
|
||||
__bitmap_andnot(dst, src1, src2, nbits);
|
||||
return (*dst = *src1 & ~(*src2)) != 0;
|
||||
return __bitmap_andnot(dst, src1, src2, nbits);
|
||||
}
|
||||
|
||||
static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
|
||||
|
48
include/linux/blk-iopoll.h
Normal file
48
include/linux/blk-iopoll.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef BLK_IOPOLL_H
|
||||
#define BLK_IOPOLL_H
|
||||
|
||||
struct blk_iopoll;
|
||||
typedef int (blk_iopoll_fn)(struct blk_iopoll *, int);
|
||||
|
||||
struct blk_iopoll {
|
||||
struct list_head list;
|
||||
unsigned long state;
|
||||
unsigned long data;
|
||||
int weight;
|
||||
int max;
|
||||
blk_iopoll_fn *poll;
|
||||
};
|
||||
|
||||
enum {
|
||||
IOPOLL_F_SCHED = 0,
|
||||
IOPOLL_F_DISABLE = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating
|
||||
* that we were the first to acquire this iop for scheduling. If this iop
|
||||
* is currently disabled, return "failure".
|
||||
*/
|
||||
static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop)
|
||||
{
|
||||
if (!test_bit(IOPOLL_F_DISABLE, &iop->state))
|
||||
return test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop)
|
||||
{
|
||||
return test_bit(IOPOLL_F_DISABLE, &iop->state);
|
||||
}
|
||||
|
||||
extern void blk_iopoll_sched(struct blk_iopoll *);
|
||||
extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *);
|
||||
extern void blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void __blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void blk_iopoll_enable(struct blk_iopoll *);
|
||||
extern void blk_iopoll_disable(struct blk_iopoll *);
|
||||
|
||||
extern int blk_iopoll_enabled;
|
||||
|
||||
#endif
|
@@ -70,11 +70,6 @@ enum rq_cmd_type_bits {
|
||||
REQ_TYPE_ATA_PC,
|
||||
};
|
||||
|
||||
enum {
|
||||
BLK_RW_ASYNC = 0,
|
||||
BLK_RW_SYNC = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
|
||||
* sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
|
||||
@@ -91,13 +86,14 @@ enum {
|
||||
};
|
||||
|
||||
/*
|
||||
* request type modified bits. first two bits match BIO_RW* bits, important
|
||||
* request type modified bits. first four bits match BIO_RW* bits, important
|
||||
*/
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW, /* not set, read. set, write */
|
||||
__REQ_FAILFAST_DEV, /* no driver retries of device errors */
|
||||
__REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
|
||||
__REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
|
||||
/* above flags must match BIO_RW_* */
|
||||
__REQ_DISCARD, /* request to discard sectors */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
@@ -119,6 +115,7 @@ enum rq_flag_bits {
|
||||
__REQ_INTEGRITY, /* integrity metadata has been remapped */
|
||||
__REQ_NOIDLE, /* Don't anticipate more IO after this one */
|
||||
__REQ_IO_STAT, /* account I/O stat */
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
@@ -147,6 +144,10 @@ enum rq_flag_bits {
|
||||
#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
|
||||
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
|
||||
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
|
||||
|
||||
#define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \
|
||||
REQ_FAILFAST_DRIVER)
|
||||
|
||||
#define BLK_MAX_CDB 16
|
||||
|
||||
@@ -301,12 +302,6 @@ struct blk_queue_tag {
|
||||
#define BLK_SCSI_MAX_CMDS (256)
|
||||
#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
|
||||
|
||||
struct blk_cmd_filter {
|
||||
unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
|
||||
unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
struct queue_limits {
|
||||
unsigned long bounce_pfn;
|
||||
unsigned long seg_boundary_mask;
|
||||
@@ -445,7 +440,6 @@ struct request_queue
|
||||
#if defined(CONFIG_BLK_DEV_BSG)
|
||||
struct bsg_class_device bsg_dev;
|
||||
#endif
|
||||
struct blk_cmd_filter cmd_filter;
|
||||
};
|
||||
|
||||
#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
|
||||
@@ -465,10 +459,12 @@ struct request_queue
|
||||
#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
|
||||
#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
|
||||
#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
|
||||
#define QUEUE_FLAG_CQ 16 /* hardware does queuing */
|
||||
|
||||
#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_CLUSTER) | \
|
||||
(1 << QUEUE_FLAG_STACKABLE))
|
||||
(1 << QUEUE_FLAG_STACKABLE) | \
|
||||
(1 << QUEUE_FLAG_SAME_COMP))
|
||||
|
||||
static inline int queue_is_locked(struct request_queue *q)
|
||||
{
|
||||
@@ -587,6 +583,7 @@ enum {
|
||||
|
||||
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
|
||||
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
|
||||
#define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags)
|
||||
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
|
||||
#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
|
||||
#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
|
||||
@@ -730,6 +727,7 @@ struct rq_map_data {
|
||||
int nr_entries;
|
||||
unsigned long offset;
|
||||
int null_mapped;
|
||||
int from_user;
|
||||
};
|
||||
|
||||
struct req_iterator {
|
||||
@@ -786,18 +784,18 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
|
||||
* congested queues, and wake up anyone who was waiting for requests to be
|
||||
* put back.
|
||||
*/
|
||||
static inline void blk_clear_queue_congested(struct request_queue *q, int rw)
|
||||
static inline void blk_clear_queue_congested(struct request_queue *q, int sync)
|
||||
{
|
||||
clear_bdi_congested(&q->backing_dev_info, rw);
|
||||
clear_bdi_congested(&q->backing_dev_info, sync);
|
||||
}
|
||||
|
||||
/*
|
||||
* A queue has just entered congestion. Flag that in the queue's VM-visible
|
||||
* state flags and increment the global gounter of congested queues.
|
||||
*/
|
||||
static inline void blk_set_queue_congested(struct request_queue *q, int rw)
|
||||
static inline void blk_set_queue_congested(struct request_queue *q, int sync)
|
||||
{
|
||||
set_bdi_congested(&q->backing_dev_info, rw);
|
||||
set_bdi_congested(&q->backing_dev_info, sync);
|
||||
}
|
||||
|
||||
extern void blk_start_queue(struct request_queue *q);
|
||||
@@ -839,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping)
|
||||
}
|
||||
|
||||
/*
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_err_bytes() : bytes left till the next error boundary
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_err_sectors() : sectors left till the next error boundary
|
||||
*/
|
||||
static inline sector_t blk_rq_pos(const struct request *rq)
|
||||
{
|
||||
@@ -860,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq)
|
||||
return rq->bio ? bio_cur_bytes(rq->bio) : 0;
|
||||
}
|
||||
|
||||
extern unsigned int blk_rq_err_bytes(const struct request *rq);
|
||||
|
||||
static inline unsigned int blk_rq_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_bytes(rq) >> 9;
|
||||
@@ -870,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
||||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_err_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_err_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* Request issue related functions.
|
||||
*/
|
||||
@@ -896,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void blk_end_request_all(struct request *rq, int error);
|
||||
extern bool blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool blk_end_request_err(struct request *rq, int error);
|
||||
extern bool __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void __blk_end_request_all(struct request *rq, int error);
|
||||
extern bool __blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool __blk_end_request_err(struct request *rq, int error);
|
||||
|
||||
extern void blk_complete_request(struct request *);
|
||||
extern void __blk_complete_request(struct request *);
|
||||
@@ -924,7 +933,9 @@ extern void blk_queue_logical_block_size(struct request_queue *, unsigned short)
|
||||
extern void blk_queue_physical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
unsigned int alignment);
|
||||
extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
|
||||
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
|
||||
extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);
|
||||
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
|
||||
extern void blk_set_default_limits(struct queue_limits *lim);
|
||||
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
@@ -987,24 +998,21 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
|
||||
}
|
||||
|
||||
extern int blkdev_issue_flush(struct block_device *, sector_t *);
|
||||
extern int blkdev_issue_discard(struct block_device *,
|
||||
sector_t sector, sector_t nr_sects, gfp_t);
|
||||
#define DISCARD_FL_WAIT 0x01 /* wait for completion */
|
||||
#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */
|
||||
extern int blkdev_issue_discard(struct block_device *, sector_t sector,
|
||||
sector_t nr_sects, gfp_t, int flags);
|
||||
|
||||
static inline int sb_issue_discard(struct super_block *sb,
|
||||
sector_t block, sector_t nr_blocks)
|
||||
{
|
||||
block <<= (sb->s_blocksize_bits - 9);
|
||||
nr_blocks <<= (sb->s_blocksize_bits - 9);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
|
||||
DISCARD_FL_BARRIER);
|
||||
}
|
||||
|
||||
/*
|
||||
* command filter functions
|
||||
*/
|
||||
extern int blk_verify_command(struct blk_cmd_filter *filter,
|
||||
unsigned char *cmd, fmode_t has_write_perm);
|
||||
extern void blk_unregister_filter(struct gendisk *disk);
|
||||
extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
|
||||
extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
|
||||
|
||||
#define MAX_PHYS_SEGMENTS 128
|
||||
#define MAX_HW_SEGMENTS 128
|
||||
|
@@ -132,9 +132,6 @@ static inline void *alloc_remap(int nid, unsigned long size)
|
||||
}
|
||||
#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
|
||||
|
||||
extern unsigned long __meminitdata nr_kernel_pages;
|
||||
extern unsigned long __meminitdata nr_all_pages;
|
||||
|
||||
extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
unsigned long numentries,
|
||||
@@ -145,6 +142,8 @@ extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long limit);
|
||||
|
||||
#define HASH_EARLY 0x00000001 /* Allocating during early boot? */
|
||||
#define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min
|
||||
* shift passed via *_hash_shift */
|
||||
|
||||
/* Only NUMA needs hash distribution. 64bit NUMA architectures have
|
||||
* sufficient vmalloc space.
|
||||
|
@@ -66,5 +66,6 @@ void can_bus_off(struct net_device *dev);
|
||||
|
||||
void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx);
|
||||
void can_get_echo_skb(struct net_device *dev, int idx);
|
||||
void can_free_echo_skb(struct net_device *dev, int idx);
|
||||
|
||||
#endif /* CAN_DEV_H */
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* See here for the libcap library ("POSIX draft" compliance):
|
||||
*
|
||||
* ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
* ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
|
@@ -140,29 +140,6 @@ void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
/**
|
||||
* cb710_sg_miter_stop_writing - stop mapping iteration after writing
|
||||
* @miter: sg mapping iter to be stopped
|
||||
*
|
||||
* Description:
|
||||
* Stops mapping iterator @miter. @miter should have been started
|
||||
* started using sg_miter_start(). A stopped iteration can be
|
||||
* resumed by calling sg_miter_next() on it. This is useful when
|
||||
* resources (kmap) need to be released during iteration.
|
||||
*
|
||||
* This is a convenience wrapper that will be optimized out for arches
|
||||
* that don't need flush_kernel_dcache_page().
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
|
||||
{
|
||||
if (miter->page)
|
||||
flush_kernel_dcache_page(miter->page);
|
||||
sg_miter_stop(miter);
|
||||
}
|
||||
|
||||
/*
|
||||
* 32-bit PIO mapping sg iterator
|
||||
*
|
||||
@@ -171,12 +148,12 @@ static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
|
||||
* without DMA support).
|
||||
*
|
||||
* Best-case reading (transfer from device):
|
||||
* sg_miter_start();
|
||||
* sg_miter_start(, SG_MITER_TO_SG);
|
||||
* cb710_sg_dwiter_write_from_io();
|
||||
* cb710_sg_miter_stop_writing();
|
||||
* sg_miter_stop();
|
||||
*
|
||||
* Best-case writing (transfer to device):
|
||||
* sg_miter_start();
|
||||
* sg_miter_start(, SG_MITER_FROM_SG);
|
||||
* cb710_sg_dwiter_read_to_io();
|
||||
* sg_miter_stop();
|
||||
*/
|
||||
|
@@ -179,14 +179,11 @@ struct cgroup {
|
||||
*/
|
||||
struct list_head release_list;
|
||||
|
||||
/* pids_mutex protects the fields below */
|
||||
/* pids_mutex protects pids_list and cached pid arrays. */
|
||||
struct rw_semaphore pids_mutex;
|
||||
/* Array of process ids in the cgroup */
|
||||
pid_t *tasks_pids;
|
||||
/* How many files are using the current tasks_pids array */
|
||||
int pids_use_count;
|
||||
/* Length of the current tasks_pids array */
|
||||
int pids_length;
|
||||
|
||||
/* Linked list of struct cgroup_pids */
|
||||
struct list_head pids_list;
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
@@ -365,6 +362,23 @@ int cgroup_task_count(const struct cgroup *cgrp);
|
||||
/* Return true if cgrp is a descendant of the task's cgroup */
|
||||
int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
|
||||
|
||||
/*
|
||||
* When the subsys has to access css and may add permanent refcnt to css,
|
||||
* it should take care of racy conditions with rmdir(). Following set of
|
||||
* functions, is for stop/restart rmdir if necessary.
|
||||
* Because these will call css_get/put, "css" should be alive css.
|
||||
*
|
||||
* cgroup_exclude_rmdir();
|
||||
* ...do some jobs which may access arbitrary empty cgroup
|
||||
* cgroup_release_and_wakeup_rmdir();
|
||||
*
|
||||
* When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
|
||||
* it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
|
||||
*/
|
||||
|
||||
void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
|
||||
void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
|
||||
|
||||
/*
|
||||
* Control Group subsystem type.
|
||||
* See Documentation/cgroups/cgroups.txt for details
|
||||
|
@@ -143,12 +143,3 @@ extern void clockevents_notify(unsigned long reason, void *arg);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GENERIC_CLOCKEVENTS
|
||||
extern ktime_t clockevents_get_next_event(int cpu);
|
||||
#else
|
||||
static inline ktime_t clockevents_get_next_event(int cpu)
|
||||
{
|
||||
return (ktime_t) { .tv64 = KTIME_MAX };
|
||||
}
|
||||
#endif
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@@ -148,14 +149,11 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
|
||||
* @disable: optional function to disable the clocksource
|
||||
* @mask: bitmask for two's complement
|
||||
* subtraction of non 64 bit counters
|
||||
* @mult: cycle to nanosecond multiplier (adjusted by NTP)
|
||||
* @mult_orig: cycle to nanosecond multiplier (unadjusted by NTP)
|
||||
* @mult: cycle to nanosecond multiplier
|
||||
* @shift: cycle to nanosecond divisor (power of two)
|
||||
* @flags: flags describing special properties
|
||||
* @vread: vsyscall based read
|
||||
* @resume: resume function for the clocksource, if necessary
|
||||
* @cycle_interval: Used internally by timekeeping core, please ignore.
|
||||
* @xtime_interval: Used internally by timekeeping core, please ignore.
|
||||
*/
|
||||
struct clocksource {
|
||||
/*
|
||||
@@ -169,7 +167,6 @@ struct clocksource {
|
||||
void (*disable)(struct clocksource *cs);
|
||||
cycle_t mask;
|
||||
u32 mult;
|
||||
u32 mult_orig;
|
||||
u32 shift;
|
||||
unsigned long flags;
|
||||
cycle_t (*vread)(void);
|
||||
@@ -181,19 +178,12 @@ struct clocksource {
|
||||
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
|
||||
#endif
|
||||
|
||||
/* timekeeping specific data, ignore */
|
||||
cycle_t cycle_interval;
|
||||
u64 xtime_interval;
|
||||
u32 raw_interval;
|
||||
/*
|
||||
* Second part is written at each timer interrupt
|
||||
* Keep it in a different cache line to dirty no
|
||||
* more than one cache line.
|
||||
*/
|
||||
cycle_t cycle_last ____cacheline_aligned_in_smp;
|
||||
u64 xtime_nsec;
|
||||
s64 error;
|
||||
struct timespec raw_time;
|
||||
|
||||
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
|
||||
/* Watchdog related data, used by the framework */
|
||||
@@ -202,8 +192,6 @@ struct clocksource {
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
/*
|
||||
* Clock source flags bits::
|
||||
*/
|
||||
@@ -212,6 +200,7 @@ extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
#define CLOCK_SOURCE_WATCHDOG 0x10
|
||||
#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
|
||||
#define CLOCK_SOURCE_UNSTABLE 0x40
|
||||
|
||||
/* simplify initialization of mask field */
|
||||
#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
|
||||
@@ -268,96 +257,15 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant)
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_read: - Access the clocksource's current cycle value
|
||||
* @cs: pointer to clocksource being read
|
||||
* clocksource_cyc2ns - converts clocksource cycles to nanoseconds
|
||||
*
|
||||
* Uses the clocksource to return the current cycle_t value
|
||||
*/
|
||||
static inline cycle_t clocksource_read(struct clocksource *cs)
|
||||
{
|
||||
return cs->read(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_enable: - enable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Enables the specified clocksource. The clocksource callback
|
||||
* function should start up the hardware and setup mult and field
|
||||
* members of struct clocksource to reflect hardware capabilities.
|
||||
*/
|
||||
static inline int clocksource_enable(struct clocksource *cs)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (cs->enable)
|
||||
ret = cs->enable(cs);
|
||||
|
||||
/* save mult_orig on enable */
|
||||
cs->mult_orig = cs->mult;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_disable: - disable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Disables the specified clocksource. The clocksource callback
|
||||
* function should power down the now unused hardware block to
|
||||
* save power.
|
||||
*/
|
||||
static inline void clocksource_disable(struct clocksource *cs)
|
||||
{
|
||||
if (cs->disable)
|
||||
cs->disable(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* cyc2ns - converts clocksource cycles to nanoseconds
|
||||
* @cs: Pointer to clocksource
|
||||
* @cycles: Cycles
|
||||
*
|
||||
* Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds.
|
||||
* Converts cycles to nanoseconds, using the given mult and shift.
|
||||
*
|
||||
* XXX - This could use some mult_lxl_ll() asm optimization
|
||||
*/
|
||||
static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
|
||||
static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
|
||||
{
|
||||
u64 ret = (u64)cycles;
|
||||
ret = (ret * cs->mult) >> cs->shift;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_calculate_interval - Calculates a clocksource interval struct
|
||||
*
|
||||
* @c: Pointer to clocksource.
|
||||
* @length_nsec: Desired interval length in nanoseconds.
|
||||
*
|
||||
* Calculates a fixed cycle/nsec interval for a given clocksource/adjustment
|
||||
* pair and interval request.
|
||||
*
|
||||
* Unless you're the timekeeping code, you should not be using this!
|
||||
*/
|
||||
static inline void clocksource_calculate_interval(struct clocksource *c,
|
||||
unsigned long length_nsec)
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
/* Do the ns -> cycle conversion first, using original mult */
|
||||
tmp = length_nsec;
|
||||
tmp <<= c->shift;
|
||||
tmp += c->mult_orig/2;
|
||||
do_div(tmp, c->mult_orig);
|
||||
|
||||
c->cycle_interval = (cycle_t)tmp;
|
||||
if (c->cycle_interval == 0)
|
||||
c->cycle_interval = 1;
|
||||
|
||||
/* Go back from cycles -> shifted ns, this time use ntp adjused mult */
|
||||
c->xtime_interval = (u64)c->cycle_interval * c->mult;
|
||||
c->raw_interval = ((u64)c->cycle_interval * c->mult_orig) >> c->shift;
|
||||
return ((u64) cycles * mult) >> shift;
|
||||
}
|
||||
|
||||
|
||||
@@ -368,6 +276,8 @@ extern void clocksource_touch_watchdog(void);
|
||||
extern struct clocksource* clocksource_get_next(void);
|
||||
extern void clocksource_change_rating(struct clocksource *cs, int rating);
|
||||
extern void clocksource_resume(void);
|
||||
extern struct clocksource * __init __weak clocksource_default_clock(void);
|
||||
extern void clocksource_mark_unstable(struct clocksource *cs);
|
||||
|
||||
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
||||
extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
|
||||
@@ -382,4 +292,6 @@ static inline void update_vsyscall_tz(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void timekeeping_notify(struct clocksource *clock);
|
||||
|
||||
#endif /* _LINUX_CLOCKSOURCE_H */
|
||||
|
@@ -136,7 +136,7 @@ struct cn_callback_data {
|
||||
void *ddata;
|
||||
|
||||
void *callback_priv;
|
||||
void (*callback) (void *);
|
||||
void (*callback) (struct cn_msg *);
|
||||
|
||||
void *free;
|
||||
};
|
||||
@@ -167,11 +167,11 @@ struct cn_dev {
|
||||
struct cn_queue_dev *cbdev;
|
||||
};
|
||||
|
||||
int cn_add_callback(struct cb_id *, char *, void (*callback) (void *));
|
||||
int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *));
|
||||
void cn_del_callback(struct cb_id *);
|
||||
int cn_netlink_send(struct cn_msg *, u32, gfp_t);
|
||||
|
||||
int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *));
|
||||
int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *));
|
||||
void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
|
||||
|
||||
int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work);
|
||||
|
@@ -89,7 +89,6 @@ struct vc_data {
|
||||
unsigned int vc_need_wrap : 1;
|
||||
unsigned int vc_can_do_color : 1;
|
||||
unsigned int vc_report_mouse : 2;
|
||||
unsigned int vc_kmalloced : 1;
|
||||
unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
|
||||
unsigned char vc_utf_count;
|
||||
int vc_utf_char;
|
||||
|
@@ -48,6 +48,15 @@ struct notifier_block;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Need to know about CPUs going up/down? */
|
||||
#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE)
|
||||
#define cpu_notifier(fn, pri) { \
|
||||
static struct notifier_block fn##_nb __cpuinitdata = \
|
||||
{ .notifier_call = fn, .priority = pri }; \
|
||||
register_cpu_notifier(&fn##_nb); \
|
||||
}
|
||||
#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
|
||||
#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
|
||||
#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
extern int register_cpu_notifier(struct notifier_block *nb);
|
||||
extern void unregister_cpu_notifier(struct notifier_block *nb);
|
||||
@@ -74,6 +83,8 @@ extern void cpu_maps_update_done(void);
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
|
||||
#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
|
||||
|
||||
static inline int register_cpu_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
@@ -99,11 +110,7 @@ extern struct sysdev_class cpu_sysdev_class;
|
||||
|
||||
extern void get_online_cpus(void);
|
||||
extern void put_online_cpus(void);
|
||||
#define hotcpu_notifier(fn, pri) { \
|
||||
static struct notifier_block fn##_nb __cpuinitdata = \
|
||||
{ .notifier_call = fn, .priority = pri }; \
|
||||
register_cpu_notifier(&fn##_nb); \
|
||||
}
|
||||
#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
|
||||
#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
|
||||
#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
|
||||
int cpu_down(unsigned int cpu);
|
||||
|
@@ -65,6 +65,9 @@ static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
|
||||
|
||||
struct cpufreq_governor;
|
||||
|
||||
/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
|
||||
extern struct kobject *cpufreq_global_kobject;
|
||||
|
||||
#define CPUFREQ_ETERNAL (-1)
|
||||
struct cpufreq_cpuinfo {
|
||||
unsigned int max_freq;
|
||||
@@ -274,6 +277,13 @@ struct freq_attr {
|
||||
ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
|
||||
};
|
||||
|
||||
struct global_attr {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct kobject *kobj,
|
||||
struct attribute *attr, char *buf);
|
||||
ssize_t (*store)(struct kobject *a, struct attribute *b,
|
||||
const char *c, size_t count);
|
||||
};
|
||||
|
||||
/*********************************************************************
|
||||
* CPUFREQ 2.6. INTERFACE *
|
||||
|
@@ -43,10 +43,10 @@
|
||||
* int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask
|
||||
* int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask
|
||||
*
|
||||
* void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]
|
||||
* int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]
|
||||
* void cpus_or(dst, src1, src2) dst = src1 | src2 [union]
|
||||
* void cpus_xor(dst, src1, src2) dst = src1 ^ src2
|
||||
* void cpus_andnot(dst, src1, src2) dst = src1 & ~src2
|
||||
* int cpus_andnot(dst, src1, src2) dst = src1 & ~src2
|
||||
* void cpus_complement(dst, src) dst = ~src
|
||||
*
|
||||
* int cpus_equal(mask1, mask2) Does mask1 == mask2?
|
||||
@@ -179,10 +179,10 @@ static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
|
||||
}
|
||||
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
@@ -201,10 +201,10 @@ static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
|
||||
#define cpus_andnot(dst, src1, src2) \
|
||||
__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
|
||||
@@ -738,11 +738,11 @@ static inline void cpumask_clear(struct cpumask *dstp)
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*/
|
||||
static inline void cpumask_and(struct cpumask *dstp,
|
||||
static inline int cpumask_and(struct cpumask *dstp,
|
||||
const struct cpumask *src1p,
|
||||
const struct cpumask *src2p)
|
||||
{
|
||||
bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),
|
||||
return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),
|
||||
cpumask_bits(src2p), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
@@ -779,11 +779,11 @@ static inline void cpumask_xor(struct cpumask *dstp,
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*/
|
||||
static inline void cpumask_andnot(struct cpumask *dstp,
|
||||
static inline int cpumask_andnot(struct cpumask *dstp,
|
||||
const struct cpumask *src1p,
|
||||
const struct cpumask *src2p)
|
||||
{
|
||||
bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),
|
||||
return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),
|
||||
cpumask_bits(src2p), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
|
||||
#ifdef CONFIG_CRASH_DUMP
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/proc_fs.h>
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include <linux/capability.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/key.h>
|
||||
#include <linux/selinux.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct user_struct;
|
||||
@@ -114,6 +115,13 @@ struct thread_group_cred {
|
||||
*/
|
||||
struct cred {
|
||||
atomic_t usage;
|
||||
#ifdef CONFIG_DEBUG_CREDENTIALS
|
||||
atomic_t subscribers; /* number of processes subscribed */
|
||||
void *put_addr;
|
||||
unsigned magic;
|
||||
#define CRED_MAGIC 0x43736564
|
||||
#define CRED_MAGIC_DEAD 0x44656144
|
||||
#endif
|
||||
uid_t uid; /* real UID of the task */
|
||||
gid_t gid; /* real GID of the task */
|
||||
uid_t suid; /* saved UID of the task */
|
||||
@@ -143,7 +151,9 @@ struct cred {
|
||||
};
|
||||
|
||||
extern void __put_cred(struct cred *);
|
||||
extern void exit_creds(struct task_struct *);
|
||||
extern int copy_creds(struct task_struct *, unsigned long);
|
||||
extern struct cred *cred_alloc_blank(void);
|
||||
extern struct cred *prepare_creds(void);
|
||||
extern struct cred *prepare_exec_creds(void);
|
||||
extern struct cred *prepare_usermodehelper_creds(void);
|
||||
@@ -158,6 +168,62 @@ extern int set_security_override_from_ctx(struct cred *, const char *);
|
||||
extern int set_create_files_as(struct cred *, struct inode *);
|
||||
extern void __init cred_init(void);
|
||||
|
||||
/*
|
||||
* check for validity of credentials
|
||||
*/
|
||||
#ifdef CONFIG_DEBUG_CREDENTIALS
|
||||
extern void __invalid_creds(const struct cred *, const char *, unsigned);
|
||||
extern void __validate_process_creds(struct task_struct *,
|
||||
const char *, unsigned);
|
||||
|
||||
static inline bool creds_are_invalid(const struct cred *cred)
|
||||
{
|
||||
if (cred->magic != CRED_MAGIC)
|
||||
return true;
|
||||
if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
|
||||
return true;
|
||||
#ifdef CONFIG_SECURITY_SELINUX
|
||||
if (selinux_is_enabled()) {
|
||||
if ((unsigned long) cred->security < PAGE_SIZE)
|
||||
return true;
|
||||
if ((*(u32 *)cred->security & 0xffffff00) ==
|
||||
(POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline void __validate_creds(const struct cred *cred,
|
||||
const char *file, unsigned line)
|
||||
{
|
||||
if (unlikely(creds_are_invalid(cred)))
|
||||
__invalid_creds(cred, file, line);
|
||||
}
|
||||
|
||||
#define validate_creds(cred) \
|
||||
do { \
|
||||
__validate_creds((cred), __FILE__, __LINE__); \
|
||||
} while(0)
|
||||
|
||||
#define validate_process_creds() \
|
||||
do { \
|
||||
__validate_process_creds(current, __FILE__, __LINE__); \
|
||||
} while(0)
|
||||
|
||||
extern void validate_creds_for_do_exit(struct task_struct *);
|
||||
#else
|
||||
static inline void validate_creds(const struct cred *cred)
|
||||
{
|
||||
}
|
||||
static inline void validate_creds_for_do_exit(struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
static inline void validate_process_creds(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* get_new_cred - Get a reference on a new set of credentials
|
||||
* @cred: The new credentials to reference
|
||||
@@ -186,7 +252,9 @@ static inline struct cred *get_new_cred(struct cred *cred)
|
||||
*/
|
||||
static inline const struct cred *get_cred(const struct cred *cred)
|
||||
{
|
||||
return get_new_cred((struct cred *) cred);
|
||||
struct cred *nonconst_cred = (struct cred *) cred;
|
||||
validate_creds(cred);
|
||||
return get_new_cred(nonconst_cred);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,7 +272,7 @@ static inline void put_cred(const struct cred *_cred)
|
||||
{
|
||||
struct cred *cred = (struct cred *) _cred;
|
||||
|
||||
BUG_ON(atomic_read(&(cred)->usage) <= 0);
|
||||
validate_creds(cred);
|
||||
if (atomic_dec_and_test(&(cred)->usage))
|
||||
__put_cred(cred);
|
||||
}
|
||||
|
@@ -115,7 +115,6 @@ struct crypto_async_request;
|
||||
struct crypto_aead;
|
||||
struct crypto_blkcipher;
|
||||
struct crypto_hash;
|
||||
struct crypto_ahash;
|
||||
struct crypto_rng;
|
||||
struct crypto_tfm;
|
||||
struct crypto_type;
|
||||
@@ -146,16 +145,6 @@ struct ablkcipher_request {
|
||||
void *__ctx[] CRYPTO_MINALIGN_ATTR;
|
||||
};
|
||||
|
||||
struct ahash_request {
|
||||
struct crypto_async_request base;
|
||||
|
||||
unsigned int nbytes;
|
||||
struct scatterlist *src;
|
||||
u8 *result;
|
||||
|
||||
void *__ctx[] CRYPTO_MINALIGN_ATTR;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct aead_request - AEAD request
|
||||
* @base: Common attributes for async crypto requests
|
||||
@@ -220,18 +209,6 @@ struct ablkcipher_alg {
|
||||
unsigned int ivsize;
|
||||
};
|
||||
|
||||
struct ahash_alg {
|
||||
int (*init)(struct ahash_request *req);
|
||||
int (*reinit)(struct ahash_request *req);
|
||||
int (*update)(struct ahash_request *req);
|
||||
int (*final)(struct ahash_request *req);
|
||||
int (*digest)(struct ahash_request *req);
|
||||
int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
|
||||
unsigned int digestsize;
|
||||
};
|
||||
|
||||
struct aead_alg {
|
||||
int (*setkey)(struct crypto_aead *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
@@ -318,7 +295,6 @@ struct rng_alg {
|
||||
#define cra_cipher cra_u.cipher
|
||||
#define cra_digest cra_u.digest
|
||||
#define cra_hash cra_u.hash
|
||||
#define cra_ahash cra_u.ahash
|
||||
#define cra_compress cra_u.compress
|
||||
#define cra_rng cra_u.rng
|
||||
|
||||
@@ -346,7 +322,6 @@ struct crypto_alg {
|
||||
struct cipher_alg cipher;
|
||||
struct digest_alg digest;
|
||||
struct hash_alg hash;
|
||||
struct ahash_alg ahash;
|
||||
struct compress_alg compress;
|
||||
struct rng_alg rng;
|
||||
} cra_u;
|
||||
@@ -433,18 +408,6 @@ struct hash_tfm {
|
||||
unsigned int digestsize;
|
||||
};
|
||||
|
||||
struct ahash_tfm {
|
||||
int (*init)(struct ahash_request *req);
|
||||
int (*update)(struct ahash_request *req);
|
||||
int (*final)(struct ahash_request *req);
|
||||
int (*digest)(struct ahash_request *req);
|
||||
int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
|
||||
unsigned int digestsize;
|
||||
unsigned int reqsize;
|
||||
};
|
||||
|
||||
struct compress_tfm {
|
||||
int (*cot_compress)(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
@@ -465,7 +428,6 @@ struct rng_tfm {
|
||||
#define crt_blkcipher crt_u.blkcipher
|
||||
#define crt_cipher crt_u.cipher
|
||||
#define crt_hash crt_u.hash
|
||||
#define crt_ahash crt_u.ahash
|
||||
#define crt_compress crt_u.compress
|
||||
#define crt_rng crt_u.rng
|
||||
|
||||
@@ -479,7 +441,6 @@ struct crypto_tfm {
|
||||
struct blkcipher_tfm blkcipher;
|
||||
struct cipher_tfm cipher;
|
||||
struct hash_tfm hash;
|
||||
struct ahash_tfm ahash;
|
||||
struct compress_tfm compress;
|
||||
struct rng_tfm rng;
|
||||
} crt_u;
|
||||
@@ -770,7 +731,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc(
|
||||
|
||||
static inline void ablkcipher_request_free(struct ablkcipher_request *req)
|
||||
{
|
||||
kfree(req);
|
||||
kzfree(req);
|
||||
}
|
||||
|
||||
static inline void ablkcipher_request_set_callback(
|
||||
@@ -901,7 +862,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm,
|
||||
|
||||
static inline void aead_request_free(struct aead_request *req)
|
||||
{
|
||||
kfree(req);
|
||||
kzfree(req);
|
||||
}
|
||||
|
||||
static inline void aead_request_set_callback(struct aead_request *req,
|
||||
|
@@ -499,6 +499,7 @@ struct cyclades_card {
|
||||
void __iomem *p9050;
|
||||
struct RUNTIME_9060 __iomem *p9060;
|
||||
} ctl_addr;
|
||||
struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
@@ -541,6 +542,15 @@ struct cyclades_port {
|
||||
int magic;
|
||||
struct tty_port port;
|
||||
struct cyclades_card *card;
|
||||
union {
|
||||
struct {
|
||||
void __iomem *base_addr;
|
||||
} cyy;
|
||||
struct {
|
||||
struct CH_CTRL __iomem *ch_ctrl;
|
||||
struct BUF_CTRL __iomem *buf_ctrl;
|
||||
} cyz;
|
||||
} u;
|
||||
int line;
|
||||
int flags; /* defined in tty.h */
|
||||
int type; /* UART type */
|
||||
@@ -568,7 +578,6 @@ struct cyclades_port {
|
||||
struct cyclades_idle_stats idle_stats;
|
||||
struct cyclades_icount icount;
|
||||
struct completion shutdown_wait;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
int throttle;
|
||||
};
|
||||
|
||||
|
@@ -50,6 +50,8 @@ struct dcbmsg {
|
||||
* @DCB_CMD_SNUMTCS: set the number of traffic classes
|
||||
* @DCB_CMD_GBCN: set backward congestion notification configuration
|
||||
* @DCB_CMD_SBCN: get backward congestion notification configration.
|
||||
* @DCB_CMD_GAPP: get application protocol configuration
|
||||
* @DCB_CMD_SAPP: set application protocol configuration
|
||||
*/
|
||||
enum dcbnl_commands {
|
||||
DCB_CMD_UNDEFINED,
|
||||
@@ -80,6 +82,9 @@ enum dcbnl_commands {
|
||||
DCB_CMD_BCN_GCFG,
|
||||
DCB_CMD_BCN_SCFG,
|
||||
|
||||
DCB_CMD_GAPP,
|
||||
DCB_CMD_SAPP,
|
||||
|
||||
__DCB_CMD_ENUM_MAX,
|
||||
DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
|
||||
};
|
||||
@@ -114,6 +119,7 @@ enum dcbnl_attrs {
|
||||
DCB_ATTR_CAP,
|
||||
DCB_ATTR_NUMTCS,
|
||||
DCB_ATTR_BCN,
|
||||
DCB_ATTR_APP,
|
||||
|
||||
__DCB_ATTR_ENUM_MAX,
|
||||
DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
|
||||
@@ -338,5 +344,17 @@ enum dcb_general_attr_values {
|
||||
DCB_ATTR_VALUE_UNDEFINED = 0xff
|
||||
};
|
||||
|
||||
#define DCB_APP_IDTYPE_ETHTYPE 0x00
|
||||
#define DCB_APP_IDTYPE_PORTNUM 0x01
|
||||
enum dcbnl_app_attrs {
|
||||
DCB_APP_ATTR_UNDEFINED,
|
||||
|
||||
DCB_APP_ATTR_IDTYPE,
|
||||
DCB_APP_ATTR_ID,
|
||||
DCB_APP_ATTR_PRIORITY,
|
||||
|
||||
__DCB_APP_ATTR_ENUM_MAX,
|
||||
DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
#endif /* __LINUX_DCBNL_H__ */
|
||||
|
@@ -1,31 +1,37 @@
|
||||
#ifndef DECOMPRESS_GENERIC_H
|
||||
#define DECOMPRESS_GENERIC_H
|
||||
|
||||
/* Minimal chunksize to be read.
|
||||
*Bzip2 prefers at least 4096
|
||||
*Lzma prefers 0x10000 */
|
||||
#define COMPR_IOBUF_SIZE 4096
|
||||
|
||||
typedef int (*decompress_fn) (unsigned char *inbuf, int len,
|
||||
int(*fill)(void*, unsigned int),
|
||||
int(*writebb)(void*, unsigned int),
|
||||
unsigned char *output,
|
||||
int(*flush)(void*, unsigned int),
|
||||
unsigned char *outbuf,
|
||||
int *posp,
|
||||
void(*error)(char *x));
|
||||
|
||||
/* inbuf - input buffer
|
||||
*len - len of pre-read data in inbuf
|
||||
*fill - function to fill inbuf if empty
|
||||
*writebb - function to write out outbug
|
||||
*fill - function to fill inbuf when empty
|
||||
*flush - function to write out outbuf
|
||||
*outbuf - output buffer
|
||||
*posp - if non-null, input position (number of bytes read) will be
|
||||
* returned here
|
||||
*
|
||||
*If len != 0, the inbuf is initialized (with as much data), and fill
|
||||
*should not be called
|
||||
*If len = 0, the inbuf is allocated, but empty. Its size is IOBUF_SIZE
|
||||
*fill should be called (repeatedly...) to read data, at most IOBUF_SIZE
|
||||
*If len != 0, inbuf should contain all the necessary input data, and fill
|
||||
*should be NULL
|
||||
*If len = 0, inbuf can be NULL, in which case the decompressor will allocate
|
||||
*the input buffer. If inbuf != NULL it must be at least XXX_IOBUF_SIZE bytes.
|
||||
*fill will be called (repeatedly...) to read data, at most XXX_IOBUF_SIZE
|
||||
*bytes should be read per call. Replace XXX with the appropriate decompressor
|
||||
*name, i.e. LZMA_IOBUF_SIZE.
|
||||
*
|
||||
*If flush = NULL, outbuf must be large enough to buffer all the expected
|
||||
*output. If flush != NULL, the output buffer will be allocated by the
|
||||
*decompressor (outbuf = NULL), and the flush function will be called to
|
||||
*flush the output buffer at the appropriate time (decompressor and stream
|
||||
*dependent).
|
||||
*/
|
||||
|
||||
|
||||
/* Utility routine to detect the decompression method */
|
||||
decompress_fn decompress_method(const unsigned char *inbuf, int len,
|
||||
const char **name);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
#define _LINUX_DELAYACCT_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/taskstats_kern.h>
|
||||
|
||||
/*
|
||||
* Per-task flags relevant to delay accounting
|
||||
|
@@ -84,13 +84,16 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
|
||||
|
||||
typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
|
||||
struct dm_dev *dev,
|
||||
sector_t physical_start,
|
||||
sector_t start, sector_t len,
|
||||
void *data);
|
||||
|
||||
typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
|
||||
iterate_devices_callout_fn fn,
|
||||
void *data);
|
||||
|
||||
typedef void (*dm_io_hints_fn) (struct dm_target *ti,
|
||||
struct queue_limits *limits);
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0: The target can handle the next I/O immediately.
|
||||
@@ -104,7 +107,7 @@ void dm_error(const char *message);
|
||||
* Combine device limits.
|
||||
*/
|
||||
int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
|
||||
sector_t start, void *data);
|
||||
sector_t start, sector_t len, void *data);
|
||||
|
||||
struct dm_dev {
|
||||
struct block_device *bdev;
|
||||
@@ -151,6 +154,7 @@ struct target_type {
|
||||
dm_merge_fn merge;
|
||||
dm_busy_fn busy;
|
||||
dm_iterate_devices_fn iterate_devices;
|
||||
dm_io_hints_fn io_hints;
|
||||
|
||||
/* For internal device-mapper use. */
|
||||
struct list_head list;
|
||||
|
@@ -2,7 +2,8 @@
|
||||
* device.h - generic, centralized driver model
|
||||
*
|
||||
* Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
|
||||
* Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2008-2009 Novell Inc.
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*
|
||||
@@ -25,8 +26,6 @@
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/device.h>
|
||||
|
||||
#define BUS_ID_SIZE 20
|
||||
|
||||
struct device;
|
||||
struct device_private;
|
||||
struct device_driver;
|
||||
@@ -64,7 +63,7 @@ struct bus_type {
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct bus_type_private *p;
|
||||
};
|
||||
@@ -132,9 +131,9 @@ struct device_driver {
|
||||
void (*shutdown) (struct device *dev);
|
||||
int (*suspend) (struct device *dev, pm_message_t state);
|
||||
int (*resume) (struct device *dev);
|
||||
struct attribute_group **groups;
|
||||
const struct attribute_group **groups;
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct driver_private *p;
|
||||
};
|
||||
@@ -194,7 +193,7 @@ struct class {
|
||||
struct kobject *dev_kobj;
|
||||
|
||||
int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
|
||||
void (*class_release)(struct class *class);
|
||||
void (*dev_release)(struct device *dev);
|
||||
@@ -202,7 +201,8 @@ struct class {
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct class_private *p;
|
||||
};
|
||||
|
||||
@@ -225,6 +225,14 @@ extern void class_unregister(struct class *class);
|
||||
__class_register(class, &__key); \
|
||||
})
|
||||
|
||||
struct class_compat;
|
||||
struct class_compat *class_compat_register(const char *name);
|
||||
void class_compat_unregister(struct class_compat *cls);
|
||||
int class_compat_create_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
|
||||
extern void class_dev_iter_init(struct class_dev_iter *iter,
|
||||
struct class *class,
|
||||
struct device *start,
|
||||
@@ -288,12 +296,12 @@ extern void class_destroy(struct class *cls);
|
||||
*/
|
||||
struct device_type {
|
||||
const char *name;
|
||||
struct attribute_group **groups;
|
||||
const struct attribute_group **groups;
|
||||
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
void (*release)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
};
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
@@ -382,7 +390,6 @@ struct device {
|
||||
struct bus_type *bus; /* type of bus device is on */
|
||||
struct device_driver *driver; /* which driver has allocated this
|
||||
device */
|
||||
void *driver_data; /* data private to the driver */
|
||||
void *platform_data; /* Platform specific data, device
|
||||
core doesn't touch it */
|
||||
struct dev_pm_info power;
|
||||
@@ -413,7 +420,7 @@ struct device {
|
||||
|
||||
struct klist_node knode_class;
|
||||
struct class *class;
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
const struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device *dev);
|
||||
};
|
||||
@@ -448,16 +455,6 @@ static inline void set_dev_node(struct device *dev, int node)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void *dev_get_drvdata(const struct device *dev)
|
||||
{
|
||||
return dev->driver_data;
|
||||
}
|
||||
|
||||
static inline void dev_set_drvdata(struct device *dev, void *data)
|
||||
{
|
||||
dev->driver_data = data;
|
||||
}
|
||||
|
||||
static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
|
||||
{
|
||||
return dev->kobj.uevent_suppress;
|
||||
@@ -490,7 +487,10 @@ extern struct device *device_find_child(struct device *dev, void *data,
|
||||
extern int device_rename(struct device *dev, char *new_name);
|
||||
extern int device_move(struct device *dev, struct device *new_parent,
|
||||
enum dpm_order dpm_order);
|
||||
extern const char *device_get_nodename(struct device *dev, const char **tmp);
|
||||
extern const char *device_get_devnode(struct device *dev,
|
||||
mode_t *mode, const char **tmp);
|
||||
extern void *dev_get_drvdata(const struct device *dev);
|
||||
extern void dev_set_drvdata(struct device *dev, void *data);
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
@@ -503,6 +503,11 @@ static inline struct device *root_device_register(const char *name)
|
||||
}
|
||||
extern void root_device_unregister(struct device *root);
|
||||
|
||||
static inline void *dev_get_platdata(const struct device *dev)
|
||||
{
|
||||
return dev->platform_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
@@ -548,6 +553,16 @@ extern void put_device(struct device *dev);
|
||||
|
||||
extern void wait_for_device_probe(void);
|
||||
|
||||
#ifdef CONFIG_DEVTMPFS
|
||||
extern int devtmpfs_create_node(struct device *dev);
|
||||
extern int devtmpfs_delete_node(struct device *dev);
|
||||
extern int devtmpfs_mount(const char *mountpoint);
|
||||
#else
|
||||
static inline int devtmpfs_create_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
|
||||
#endif
|
||||
|
||||
/* drivers/base/power/shutdown.c */
|
||||
extern void device_shutdown(void);
|
||||
|
||||
|
@@ -371,7 +371,18 @@
|
||||
(DM_ULOG_REQUEST_MASK & (request_type))
|
||||
|
||||
struct dm_ulog_request {
|
||||
char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */
|
||||
/*
|
||||
* The local unique identifier (luid) and the universally unique
|
||||
* identifier (uuid) are used to tie a request to a specific
|
||||
* mirror log. A single machine log could probably make due with
|
||||
* just the 'luid', but a cluster-aware log must use the 'uuid' and
|
||||
* the 'luid'. The uuid is what is required for node to node
|
||||
* communication concerning a particular log, but the 'luid' helps
|
||||
* differentiate between logs that are being swapped and have the
|
||||
* same 'uuid'. (Think "live" and "inactive" device-mapper tables.)
|
||||
*/
|
||||
uint64_t luid;
|
||||
char uuid[DM_UUID_LEN];
|
||||
char padding[7]; /* Padding because DM_UUID_LEN = 129 */
|
||||
|
||||
int32_t error; /* Used to report back processing errors */
|
||||
|
@@ -58,6 +58,7 @@ struct dma_map_ops {
|
||||
enum dma_data_direction dir);
|
||||
int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
|
||||
int (*dma_supported)(struct device *dev, u64 mask);
|
||||
int (*set_dma_mask)(struct device *dev, u64 mask);
|
||||
int is_phys;
|
||||
};
|
||||
|
||||
@@ -98,11 +99,6 @@ static inline int is_device_dma_capable(struct device *dev)
|
||||
return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
|
||||
}
|
||||
|
||||
static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
|
||||
{
|
||||
return addr + size <= mask;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HAS_DMA
|
||||
#include <asm/dma-mapping.h>
|
||||
#else
|
||||
|
@@ -43,7 +43,7 @@ extern const char * dmi_get_system_info(int field);
|
||||
extern const struct dmi_device * dmi_find_device(int type, const char *name,
|
||||
const struct dmi_device *from);
|
||||
extern void dmi_scan_machine(void);
|
||||
extern int dmi_get_year(int field);
|
||||
extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
|
||||
extern int dmi_name_in_vendors(const char *str);
|
||||
extern int dmi_name_in_serial(const char *str);
|
||||
extern int dmi_available;
|
||||
@@ -58,7 +58,16 @@ static inline const char * dmi_get_system_info(int field) { return NULL; }
|
||||
static inline const struct dmi_device * dmi_find_device(int type, const char *name,
|
||||
const struct dmi_device *from) { return NULL; }
|
||||
static inline void dmi_scan_machine(void) { return; }
|
||||
static inline int dmi_get_year(int year) { return 0; }
|
||||
static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
|
||||
{
|
||||
if (yearp)
|
||||
*yearp = 0;
|
||||
if (monthp)
|
||||
*monthp = 0;
|
||||
if (dayp)
|
||||
*dayp = 0;
|
||||
return false;
|
||||
}
|
||||
static inline int dmi_name_in_vendors(const char *s) { return 0; }
|
||||
static inline int dmi_name_in_serial(const char *s) { return 0; }
|
||||
#define dmi_available 0
|
||||
|
@@ -1,22 +1,3 @@
|
||||
#if 0
|
||||
|
||||
#define TRACE_TXT(text) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
{ \
|
||||
console_print(text); \
|
||||
console_print("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define TRACE_CHR(chr) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
console_print(chr); \
|
||||
} \
|
||||
|
||||
#endif
|
||||
|
||||
#define DTLK_MINOR 0
|
||||
#define DTLK_IO_EXTENT 0x02
|
||||
|
||||
|
@@ -151,5 +151,7 @@ struct dmx_stc {
|
||||
#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
|
||||
#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
|
||||
#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
|
||||
#define DMX_ADD_PID _IOW('o', 51, __u16)
|
||||
#define DMX_REMOVE_PID _IOW('o', 52, __u16)
|
||||
|
||||
#endif /*_DVBDMX_H_*/
|
||||
|
@@ -173,7 +173,8 @@ typedef enum fe_modulation {
|
||||
typedef enum fe_transmit_mode {
|
||||
TRANSMISSION_MODE_2K,
|
||||
TRANSMISSION_MODE_8K,
|
||||
TRANSMISSION_MODE_AUTO
|
||||
TRANSMISSION_MODE_AUTO,
|
||||
TRANSMISSION_MODE_4K
|
||||
} fe_transmit_mode_t;
|
||||
|
||||
typedef enum fe_bandwidth {
|
||||
@@ -268,15 +269,42 @@ struct dvb_frontend_event {
|
||||
#define DTV_FE_CAPABILITY 16
|
||||
#define DTV_DELIVERY_SYSTEM 17
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
/* ISDB-T and ISDB-Tsb */
|
||||
#define DTV_ISDBT_PARTIAL_RECEPTION 18
|
||||
#define DTV_ISDBT_SOUND_BROADCASTING 19
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_HIERARCHY
|
||||
#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
|
||||
#define DTV_ISDBT_SB_SEGMENT_IDX 21
|
||||
#define DTV_ISDBT_SB_SEGMENT_COUNT 22
|
||||
|
||||
#define DTV_ISDBT_LAYERA_FEC 23
|
||||
#define DTV_ISDBT_LAYERA_MODULATION 24
|
||||
#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
|
||||
#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
|
||||
|
||||
#define DTV_ISDBT_LAYERB_FEC 27
|
||||
#define DTV_ISDBT_LAYERB_MODULATION 28
|
||||
#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
|
||||
#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
|
||||
|
||||
#define DTV_ISDBT_LAYERC_FEC 31
|
||||
#define DTV_ISDBT_LAYERC_MODULATION 32
|
||||
#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
|
||||
#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
|
||||
#define DTV_ISDBT_LAYER_ENABLED 41
|
||||
|
||||
#define DTV_ISDBS_TS_ID 42
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID
|
||||
|
||||
typedef enum fe_pilot {
|
||||
PILOT_ON,
|
||||
|
@@ -24,6 +24,6 @@
|
||||
#define _DVBVERSION_H_
|
||||
|
||||
#define DVB_API_VERSION 5
|
||||
#define DVB_API_VERSION_MINOR 0
|
||||
#define DVB_API_VERSION_MINOR 1
|
||||
|
||||
#endif /*_DVBVERSION_H_*/
|
||||
|
@@ -122,9 +122,10 @@ static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_r
|
||||
|
||||
static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
|
||||
{
|
||||
#ifdef ELF_CORE_COPY_TASK_REGS
|
||||
|
||||
#if defined (ELF_CORE_COPY_TASK_REGS)
|
||||
return ELF_CORE_COPY_TASK_REGS(t, elfregs);
|
||||
#elif defined (task_pt_regs)
|
||||
elf_core_copy_regs(elfregs, task_pt_regs(t));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@@ -122,8 +122,9 @@ 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_remove_device(struct enclosure_device *, struct device *);
|
||||
struct enclosure_device *enclosure_find(struct device *dev,
|
||||
struct enclosure_device *start);
|
||||
int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
|
||||
void *data);
|
||||
|
||||
|
@@ -362,12 +362,25 @@ struct ethtool_rxnfc {
|
||||
__u32 rule_locs[0];
|
||||
};
|
||||
|
||||
#define ETHTOOL_FLASH_MAX_FILENAME 128
|
||||
enum ethtool_flash_op_type {
|
||||
ETHTOOL_FLASH_ALL_REGIONS = 0,
|
||||
};
|
||||
|
||||
/* for passing firmware flashing related parameters */
|
||||
struct ethtool_flash {
|
||||
__u32 cmd;
|
||||
__u32 region;
|
||||
char data[ETHTOOL_FLASH_MAX_FILENAME];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct net_device;
|
||||
|
||||
/* Some generic methods drivers may use in their ethtool_ops */
|
||||
u32 ethtool_op_get_link(struct net_device *dev);
|
||||
u32 ethtool_op_get_rx_csum(struct net_device *dev);
|
||||
u32 ethtool_op_get_tx_csum(struct net_device *dev);
|
||||
int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
|
||||
int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
|
||||
@@ -488,6 +501,7 @@ struct ethtool_ops {
|
||||
int (*get_stats_count)(struct net_device *);/* use get_sset_count */
|
||||
int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
|
||||
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
|
||||
int (*flash_device)(struct net_device *, struct ethtool_flash *);
|
||||
};
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -544,6 +558,7 @@ struct ethtool_ops {
|
||||
#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
|
||||
#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
|
||||
#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
|
||||
#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
|
||||
|
||||
/* compatibility with older code */
|
||||
#define SPARC_ETH_GSET ETHTOOL_GSET
|
||||
|
@@ -8,10 +8,8 @@
|
||||
#ifndef _LINUX_EVENTFD_H
|
||||
#define _LINUX_EVENTFD_H
|
||||
|
||||
#ifdef CONFIG_EVENTFD
|
||||
|
||||
/* For O_CLOEXEC and O_NONBLOCK */
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/file.h>
|
||||
|
||||
/*
|
||||
* CAREFUL: Check include/asm-generic/fcntl.h when defining
|
||||
@@ -27,16 +25,37 @@
|
||||
#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
|
||||
#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
|
||||
|
||||
#ifdef CONFIG_EVENTFD
|
||||
|
||||
struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx);
|
||||
void eventfd_ctx_put(struct eventfd_ctx *ctx);
|
||||
struct file *eventfd_fget(int fd);
|
||||
int eventfd_signal(struct file *file, int n);
|
||||
struct eventfd_ctx *eventfd_ctx_fdget(int fd);
|
||||
struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
|
||||
int eventfd_signal(struct eventfd_ctx *ctx, int n);
|
||||
|
||||
#else /* CONFIG_EVENTFD */
|
||||
|
||||
#define eventfd_fget(fd) ERR_PTR(-ENOSYS)
|
||||
static inline int eventfd_signal(struct file *file, int n)
|
||||
{ return 0; }
|
||||
/*
|
||||
* Ugly ugly ugly error layer to support modules that uses eventfd but
|
||||
* pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO.
|
||||
*/
|
||||
static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EVENTFD */
|
||||
static inline int eventfd_signal(struct eventfd_ctx *ctx, int n)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline void eventfd_ctx_put(struct eventfd_ctx *ctx)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_EVENTFD_H */
|
||||
|
||||
|
@@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
|
||||
struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
|
||||
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);
|
||||
int create);
|
||||
|
||||
extern struct inode *ext3_iget(struct super_block *, unsigned long);
|
||||
extern int ext3_write_inode (struct inode *, int);
|
||||
|
@@ -819,6 +819,7 @@ struct fb_info {
|
||||
int node;
|
||||
int flags;
|
||||
struct mutex lock; /* Lock for open/release/ioctl funcs */
|
||||
struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields */
|
||||
struct fb_var_screeninfo var; /* Current var */
|
||||
struct fb_fix_screeninfo fix; /* Current fix */
|
||||
struct fb_monspecs monspecs; /* Current Monitor specs */
|
||||
|
10
include/linux/fips.h
Normal file
10
include/linux/fips.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _FIPS_H
|
||||
#define _FIPS_H
|
||||
|
||||
#ifdef CONFIG_CRYPTO_FIPS
|
||||
extern int fips_enabled;
|
||||
#else
|
||||
#define fips_enabled 0
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -127,6 +127,7 @@ struct fw_card {
|
||||
struct delayed_work work;
|
||||
int bm_retries;
|
||||
int bm_generation;
|
||||
__be32 bm_transaction_data[2];
|
||||
|
||||
bool broadcast_channel_allocated;
|
||||
u32 broadcast_channel;
|
||||
|
73
include/linux/flex_array.h
Normal file
73
include/linux/flex_array.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#ifndef _FLEX_ARRAY_H
|
||||
#define _FLEX_ARRAY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
|
||||
#define FLEX_ARRAY_BASE_SIZE PAGE_SIZE
|
||||
|
||||
struct flex_array_part;
|
||||
|
||||
/*
|
||||
* This is meant to replace cases where an array-like
|
||||
* structure has gotten too big to fit into kmalloc()
|
||||
* and the developer is getting tempted to use
|
||||
* vmalloc().
|
||||
*/
|
||||
|
||||
struct flex_array {
|
||||
union {
|
||||
struct {
|
||||
int element_size;
|
||||
int total_nr_elements;
|
||||
struct flex_array_part *parts[];
|
||||
};
|
||||
/*
|
||||
* This little trick makes sure that
|
||||
* sizeof(flex_array) == PAGE_SIZE
|
||||
*/
|
||||
char padding[FLEX_ARRAY_BASE_SIZE];
|
||||
};
|
||||
};
|
||||
|
||||
/* Number of bytes left in base struct flex_array, excluding metadata */
|
||||
#define FLEX_ARRAY_BASE_BYTES_LEFT \
|
||||
(FLEX_ARRAY_BASE_SIZE - offsetof(struct flex_array, parts))
|
||||
|
||||
/* Number of pointers in base to struct flex_array_part pages */
|
||||
#define FLEX_ARRAY_NR_BASE_PTRS \
|
||||
(FLEX_ARRAY_BASE_BYTES_LEFT / sizeof(struct flex_array_part *))
|
||||
|
||||
/* Number of elements of size that fit in struct flex_array_part */
|
||||
#define FLEX_ARRAY_ELEMENTS_PER_PART(size) \
|
||||
(FLEX_ARRAY_PART_SIZE / size)
|
||||
|
||||
/*
|
||||
* Defines a statically allocated flex array and ensures its parameters are
|
||||
* valid.
|
||||
*/
|
||||
#define DEFINE_FLEX_ARRAY(__arrayname, __element_size, __total) \
|
||||
struct flex_array __arrayname = { { { \
|
||||
.element_size = (__element_size), \
|
||||
.total_nr_elements = (__total), \
|
||||
} } }; \
|
||||
static inline void __arrayname##_invalid_parameter(void) \
|
||||
{ \
|
||||
BUILD_BUG_ON((__total) > FLEX_ARRAY_NR_BASE_PTRS * \
|
||||
FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \
|
||||
}
|
||||
|
||||
struct flex_array *flex_array_alloc(int element_size, unsigned int total,
|
||||
gfp_t flags);
|
||||
int flex_array_prealloc(struct flex_array *fa, unsigned int start,
|
||||
unsigned int end, gfp_t flags);
|
||||
void flex_array_free(struct flex_array *fa);
|
||||
void flex_array_free_parts(struct flex_array *fa);
|
||||
int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,
|
||||
gfp_t flags);
|
||||
int flex_array_clear(struct flex_array *fa, unsigned int element_nr);
|
||||
void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
|
||||
int flex_array_shrink(struct flex_array *fa);
|
||||
|
||||
#endif /* _FLEX_ARRAY_H */
|
@@ -161,8 +161,8 @@ struct inodes_stat_t {
|
||||
* These aren't really reads or writes, they pass down information about
|
||||
* parts of device that are now unused by the file system.
|
||||
*/
|
||||
#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
|
||||
#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
|
||||
#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD))
|
||||
#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER))
|
||||
|
||||
#define SEL_IN 1
|
||||
#define SEL_OUT 2
|
||||
@@ -655,7 +655,6 @@ struct block_device {
|
||||
int bd_invalidated;
|
||||
struct gendisk * bd_disk;
|
||||
struct list_head bd_list;
|
||||
struct backing_dev_info *bd_inode_backing_dev_info;
|
||||
/*
|
||||
* Private data. You must have bd_claim'ed the block_device
|
||||
* to use this. NOTE: bd_claim allows an owner to claim
|
||||
@@ -715,7 +714,7 @@ struct posix_acl;
|
||||
|
||||
struct inode {
|
||||
struct hlist_node i_hash;
|
||||
struct list_head i_list;
|
||||
struct list_head i_list; /* backing dev IO list */
|
||||
struct list_head i_sb_list;
|
||||
struct list_head i_dentry;
|
||||
unsigned long i_ino;
|
||||
@@ -1067,8 +1066,8 @@ struct file_lock {
|
||||
struct fasync_struct * fl_fasync; /* for lease break notifications */
|
||||
unsigned long fl_break_time; /* for nonblocking lease breaks */
|
||||
|
||||
struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
union {
|
||||
struct nfs_lock_info nfs_fl;
|
||||
struct nfs4_lock_info nfs4_fl;
|
||||
@@ -1319,8 +1318,8 @@ struct super_block {
|
||||
unsigned long long s_maxbytes; /* Max file size */
|
||||
struct file_system_type *s_type;
|
||||
const struct super_operations *s_op;
|
||||
struct dquot_operations *dq_op;
|
||||
struct quotactl_ops *s_qcop;
|
||||
const struct dquot_operations *dq_op;
|
||||
const struct quotactl_ops *s_qcop;
|
||||
const struct export_operations *s_export_op;
|
||||
unsigned long s_flags;
|
||||
unsigned long s_magic;
|
||||
@@ -1336,9 +1335,6 @@ struct super_block {
|
||||
struct xattr_handler **s_xattr;
|
||||
|
||||
struct list_head s_inodes; /* all inodes */
|
||||
struct list_head s_dirty; /* dirty inodes */
|
||||
struct list_head s_io; /* parked for writeback */
|
||||
struct list_head s_more_io; /* parked for more writeback */
|
||||
struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
|
||||
struct list_head s_files;
|
||||
/* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */
|
||||
@@ -1346,6 +1342,7 @@ struct super_block {
|
||||
int s_nr_dentry_unused; /* # of dentry on lru */
|
||||
|
||||
struct block_device *s_bdev;
|
||||
struct backing_dev_info *s_bdi;
|
||||
struct mtd_info *s_mtd;
|
||||
struct list_head s_instances;
|
||||
struct quota_info s_dquot; /* Diskquota specific options */
|
||||
@@ -1458,11 +1455,6 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
|
||||
#define DT_SOCK 12
|
||||
#define DT_WHT 14
|
||||
|
||||
#define OSYNC_METADATA (1<<0)
|
||||
#define OSYNC_DATA (1<<1)
|
||||
#define OSYNC_INODE (1<<2)
|
||||
int generic_osync_inode(struct inode *, struct address_space *, int);
|
||||
|
||||
/*
|
||||
* This is the "filldir" function type, used by readdir() to let
|
||||
* the kernel specify what kind of dirent layout it wants to have.
|
||||
@@ -1528,6 +1520,7 @@ struct inode_operations {
|
||||
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
||||
void (*truncate) (struct inode *);
|
||||
int (*permission) (struct inode *, int);
|
||||
int (*check_acl)(struct inode *, int);
|
||||
int (*setattr) (struct dentry *, struct iattr *);
|
||||
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
|
||||
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
|
||||
@@ -1788,6 +1781,7 @@ extern int get_sb_pseudo(struct file_system_type *, char *,
|
||||
struct vfsmount *mnt);
|
||||
extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
|
||||
int __put_super_and_need_restart(struct super_block *sb);
|
||||
void put_super(struct super_block *sb);
|
||||
|
||||
/* Alas, no aliases. Too much hassle with bringing module.h everywhere */
|
||||
#define fops_get(fops) \
|
||||
@@ -1946,6 +1940,7 @@ extern void putname(const char *name);
|
||||
extern int register_blkdev(unsigned int, const char *);
|
||||
extern void unregister_blkdev(unsigned int, const char *);
|
||||
extern struct block_device *bdget(dev_t);
|
||||
extern struct block_device *bdgrab(struct block_device *bdev);
|
||||
extern void bd_set_size(struct block_device *, loff_t size);
|
||||
extern void bd_forget(struct inode *inode);
|
||||
extern void bdput(struct block_device *);
|
||||
@@ -1997,12 +1992,25 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
|
||||
#define CHRDEV_MAJOR_HASH_SIZE 255
|
||||
extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
|
||||
extern int register_chrdev_region(dev_t, unsigned, const char *);
|
||||
extern int register_chrdev(unsigned int, const char *,
|
||||
const struct file_operations *);
|
||||
extern void unregister_chrdev(unsigned int, const char *);
|
||||
extern int __register_chrdev(unsigned int major, unsigned int baseminor,
|
||||
unsigned int count, const char *name,
|
||||
const struct file_operations *fops);
|
||||
extern void __unregister_chrdev(unsigned int major, unsigned int baseminor,
|
||||
unsigned int count, const char *name);
|
||||
extern void unregister_chrdev_region(dev_t, unsigned);
|
||||
extern void chrdev_show(struct seq_file *,off_t);
|
||||
|
||||
static inline int register_chrdev(unsigned int major, const char *name,
|
||||
const struct file_operations *fops)
|
||||
{
|
||||
return __register_chrdev(major, 0, 256, name, fops);
|
||||
}
|
||||
|
||||
static inline void unregister_chrdev(unsigned int major, const char *name)
|
||||
{
|
||||
__unregister_chrdev(major, 0, 256, name);
|
||||
}
|
||||
|
||||
/* fs/block_dev.c */
|
||||
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
|
||||
#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */
|
||||
@@ -2069,12 +2077,12 @@ static inline void invalidate_remote_inode(struct inode *inode)
|
||||
extern int invalidate_inode_pages2(struct address_space *mapping);
|
||||
extern int invalidate_inode_pages2_range(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end);
|
||||
extern void generic_sync_sb_inodes(struct super_block *sb,
|
||||
struct writeback_control *wbc);
|
||||
extern int write_inode_now(struct inode *, int);
|
||||
extern int filemap_fdatawrite(struct address_space *);
|
||||
extern int filemap_flush(struct address_space *);
|
||||
extern int filemap_fdatawait(struct address_space *);
|
||||
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
|
||||
loff_t lend);
|
||||
extern int filemap_write_and_wait(struct address_space *mapping);
|
||||
extern int filemap_write_and_wait_range(struct address_space *mapping,
|
||||
loff_t lstart, loff_t lend);
|
||||
@@ -2085,7 +2093,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
|
||||
extern int filemap_fdatawrite_range(struct address_space *mapping,
|
||||
loff_t start, loff_t end);
|
||||
|
||||
extern int vfs_fsync_range(struct file *file, struct dentry *dentry,
|
||||
loff_t start, loff_t end, int datasync);
|
||||
extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
|
||||
extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
|
||||
extern void sync_supers(void);
|
||||
extern void emergency_sync(void);
|
||||
extern void emergency_remount(void);
|
||||
@@ -2122,7 +2133,7 @@ extern struct file *do_filp_open(int dfd, const char *pathname,
|
||||
int open_flag, int mode, int acc_mode);
|
||||
extern int may_open(struct path *, int, int);
|
||||
|
||||
extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
|
||||
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
|
||||
extern struct file * open_exec(const char *);
|
||||
|
||||
/* fs/dcache.c -- generic fs support functions */
|
||||
@@ -2136,7 +2147,7 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
|
||||
|
||||
extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
|
||||
|
||||
extern struct inode * inode_init_always(struct super_block *, struct inode *);
|
||||
extern int inode_init_always(struct super_block *, struct inode *);
|
||||
extern void inode_init_once(struct inode *);
|
||||
extern void inode_add_to_lists(struct super_block *, struct inode *);
|
||||
extern void iput(struct inode *);
|
||||
@@ -2163,6 +2174,7 @@ 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 void __destroy_inode(struct inode *);
|
||||
extern struct inode *new_inode(struct super_block *);
|
||||
extern int should_remove_suid(struct dentry *);
|
||||
extern int file_remove_suid(struct file *);
|
||||
@@ -2184,16 +2196,15 @@ extern int bdev_read_only(struct block_device *);
|
||||
extern int set_blocksize(struct block_device *, int);
|
||||
extern int sb_set_blocksize(struct super_block *, int);
|
||||
extern int sb_min_blocksize(struct super_block *, int);
|
||||
extern int sb_has_dirty_inodes(struct super_block *);
|
||||
|
||||
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
|
||||
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
|
||||
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
|
||||
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
|
||||
extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long,
|
||||
loff_t *);
|
||||
extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
|
||||
unsigned long, loff_t);
|
||||
extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
|
||||
unsigned long *, loff_t, loff_t *, size_t, size_t);
|
||||
extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
|
||||
@@ -2203,6 +2214,10 @@ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t l
|
||||
extern int generic_segment_checks(const struct iovec *iov,
|
||||
unsigned long *nr_segs, size_t *count, int access_flags);
|
||||
|
||||
/* fs/block_dev.c */
|
||||
extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t pos);
|
||||
|
||||
/* fs/splice.c */
|
||||
extern ssize_t generic_file_splice_read(struct file *, loff_t *,
|
||||
struct pipe_inode_info *, size_t, unsigned int);
|
||||
|
@@ -352,7 +352,7 @@ extern void fsnotify_unmount_inodes(struct list_head *list);
|
||||
/* put here because inotify does some weird stuff when destroying watches */
|
||||
extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
|
||||
void *data, int data_is, const char *name,
|
||||
u32 cookie);
|
||||
u32 cookie, gfp_t gfp);
|
||||
|
||||
#else
|
||||
|
||||
|
@@ -446,7 +446,6 @@ static inline void unpause_graph_tracing(void) { }
|
||||
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|
||||
|
||||
#ifdef CONFIG_TRACING
|
||||
#include <linux/sched.h>
|
||||
|
||||
/* flags for current->trace */
|
||||
enum {
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#ifndef _LINUX_FTRACE_EVENT_H
|
||||
#define _LINUX_FTRACE_EVENT_H
|
||||
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/ring_buffer.h>
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
struct trace_array;
|
||||
struct tracer;
|
||||
@@ -34,7 +35,7 @@ struct trace_entry {
|
||||
unsigned char flags;
|
||||
unsigned char preempt_count;
|
||||
int pid;
|
||||
int tgid;
|
||||
int lock_depth;
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_EVENT \
|
||||
@@ -89,18 +90,26 @@ enum print_line_t {
|
||||
TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
|
||||
};
|
||||
|
||||
|
||||
void tracing_generic_entry_update(struct trace_entry *entry,
|
||||
unsigned long flags,
|
||||
int pc);
|
||||
struct ring_buffer_event *
|
||||
trace_current_buffer_lock_reserve(int type, unsigned long len,
|
||||
trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
|
||||
int type, unsigned long len,
|
||||
unsigned long flags, int pc);
|
||||
void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
|
||||
void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc);
|
||||
void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
|
||||
void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc);
|
||||
void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
|
||||
void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event);
|
||||
|
||||
void tracing_record_cmdline(struct task_struct *tsk);
|
||||
|
||||
struct event_filter;
|
||||
|
||||
struct ftrace_event_call {
|
||||
struct list_head list;
|
||||
char *name;
|
||||
@@ -108,36 +117,51 @@ struct ftrace_event_call {
|
||||
struct dentry *dir;
|
||||
struct trace_event *event;
|
||||
int enabled;
|
||||
int (*regfunc)(void);
|
||||
void (*unregfunc)(void);
|
||||
int (*regfunc)(void *);
|
||||
void (*unregfunc)(void *);
|
||||
int id;
|
||||
int (*raw_init)(void);
|
||||
int (*show_format)(struct trace_seq *s);
|
||||
int (*define_fields)(void);
|
||||
int (*show_format)(struct ftrace_event_call *call,
|
||||
struct trace_seq *s);
|
||||
int (*define_fields)(struct ftrace_event_call *);
|
||||
struct list_head fields;
|
||||
int filter_active;
|
||||
void *filter;
|
||||
struct event_filter *filter;
|
||||
void *mod;
|
||||
void *data;
|
||||
|
||||
#ifdef CONFIG_EVENT_PROFILE
|
||||
atomic_t profile_count;
|
||||
int (*profile_enable)(struct ftrace_event_call *);
|
||||
void (*profile_disable)(struct ftrace_event_call *);
|
||||
#endif
|
||||
atomic_t profile_count;
|
||||
int (*profile_enable)(void);
|
||||
void (*profile_disable)(void);
|
||||
};
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 128
|
||||
#define FTRACE_MAX_PROFILE_SIZE 2048
|
||||
|
||||
extern char *trace_profile_buf;
|
||||
extern char *trace_profile_buf_nmi;
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
||||
extern int init_preds(struct ftrace_event_call *call);
|
||||
extern void destroy_preds(struct ftrace_event_call *call);
|
||||
extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
|
||||
extern int filter_current_check_discard(struct ftrace_event_call *call,
|
||||
extern int filter_current_check_discard(struct ring_buffer *buffer,
|
||||
struct ftrace_event_call *call,
|
||||
void *rec,
|
||||
struct ring_buffer_event *event);
|
||||
|
||||
extern int trace_define_field(struct ftrace_event_call *call, char *type,
|
||||
char *name, int offset, int size, int is_signed);
|
||||
enum {
|
||||
FILTER_OTHER = 0,
|
||||
FILTER_STATIC_STRING,
|
||||
FILTER_DYN_STRING,
|
||||
FILTER_PTR_STRING,
|
||||
};
|
||||
|
||||
extern int trace_define_field(struct ftrace_event_call *call,
|
||||
const char *type, const char *name,
|
||||
int offset, int size, int is_signed,
|
||||
int filter_type);
|
||||
extern int trace_define_common_fields(struct ftrace_event_call *call);
|
||||
|
||||
#define is_signed_type(type) (((type)(-1)) < 0)
|
||||
|
||||
@@ -162,11 +186,4 @@ do { \
|
||||
__trace_printk(ip, fmt, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define __common_field(type, item, is_signed) \
|
||||
ret = trace_define_field(event_call, #type, "common_" #item, \
|
||||
offsetof(typeof(field.ent), item), \
|
||||
sizeof(field.ent.item), is_signed); \
|
||||
if (ret) \
|
||||
return ret;
|
||||
|
||||
#endif /* _LINUX_FTRACE_EVENT_H */
|
||||
|
@@ -25,6 +25,15 @@
|
||||
* - add IOCTL message
|
||||
* - add unsolicited notification support
|
||||
* - add POLL message and NOTIFY_POLL notification
|
||||
*
|
||||
* 7.12
|
||||
* - add umask flag to input argument of open, mknod and mkdir
|
||||
* - add notification messages for invalidation of inodes and
|
||||
* directory entries
|
||||
*
|
||||
* 7.13
|
||||
* - make max number of background requests and congestion threshold
|
||||
* tunables
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
@@ -32,11 +41,31 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Version negotiation:
|
||||
*
|
||||
* Both the kernel and userspace send the version they support in the
|
||||
* INIT request and reply respectively.
|
||||
*
|
||||
* If the major versions match then both shall use the smallest
|
||||
* of the two minor versions for communication.
|
||||
*
|
||||
* If the kernel supports a larger major version, then userspace shall
|
||||
* reply with the major version it supports, ignore the rest of the
|
||||
* INIT message and expect a new INIT message from the kernel with a
|
||||
* matching major version.
|
||||
*
|
||||
* If the library supports a larger major version, then it shall fall
|
||||
* back to the major protocol version sent by the kernel for
|
||||
* communication and reply with that major version (and an arbitrary
|
||||
* supported minor version).
|
||||
*/
|
||||
|
||||
/** Version number of this interface */
|
||||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 11
|
||||
#define FUSE_KERNEL_MINOR_VERSION 13
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
@@ -112,6 +141,7 @@ struct fuse_file_lock {
|
||||
* INIT request/reply flags
|
||||
*
|
||||
* FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
|
||||
* FUSE_DONT_MASK: don't apply umask to file mode on create operations
|
||||
*/
|
||||
#define FUSE_ASYNC_READ (1 << 0)
|
||||
#define FUSE_POSIX_LOCKS (1 << 1)
|
||||
@@ -119,6 +149,7 @@ struct fuse_file_lock {
|
||||
#define FUSE_ATOMIC_O_TRUNC (1 << 3)
|
||||
#define FUSE_EXPORT_SUPPORT (1 << 4)
|
||||
#define FUSE_BIG_WRITES (1 << 5)
|
||||
#define FUSE_DONT_MASK (1 << 6)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
@@ -224,6 +255,8 @@ enum fuse_opcode {
|
||||
|
||||
enum fuse_notify_code {
|
||||
FUSE_NOTIFY_POLL = 1,
|
||||
FUSE_NOTIFY_INVAL_INODE = 2,
|
||||
FUSE_NOTIFY_INVAL_ENTRY = 3,
|
||||
FUSE_NOTIFY_CODE_MAX,
|
||||
};
|
||||
|
||||
@@ -262,14 +295,18 @@ struct fuse_attr_out {
|
||||
struct fuse_attr attr;
|
||||
};
|
||||
|
||||
#define FUSE_COMPAT_MKNOD_IN_SIZE 8
|
||||
|
||||
struct fuse_mknod_in {
|
||||
__u32 mode;
|
||||
__u32 rdev;
|
||||
__u32 umask;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_mkdir_in {
|
||||
__u32 mode;
|
||||
__u32 padding;
|
||||
__u32 umask;
|
||||
};
|
||||
|
||||
struct fuse_rename_in {
|
||||
@@ -300,8 +337,15 @@ struct fuse_setattr_in {
|
||||
};
|
||||
|
||||
struct fuse_open_in {
|
||||
__u32 flags;
|
||||
__u32 unused;
|
||||
};
|
||||
|
||||
struct fuse_create_in {
|
||||
__u32 flags;
|
||||
__u32 mode;
|
||||
__u32 umask;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_open_out {
|
||||
@@ -407,7 +451,8 @@ struct fuse_init_out {
|
||||
__u32 minor;
|
||||
__u32 max_readahead;
|
||||
__u32 flags;
|
||||
__u32 unused;
|
||||
__u16 max_background;
|
||||
__u16 congestion_threshold;
|
||||
__u32 max_write;
|
||||
};
|
||||
|
||||
@@ -508,4 +553,16 @@ struct fuse_dirent {
|
||||
#define FUSE_DIRENT_SIZE(d) \
|
||||
FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
|
||||
|
||||
struct fuse_notify_inval_inode_out {
|
||||
__u64 ino;
|
||||
__s64 off;
|
||||
__s64 len;
|
||||
};
|
||||
|
||||
struct fuse_notify_inval_entry_out {
|
||||
__u64 parent;
|
||||
__u32 namelen;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_FUSE_H */
|
||||
|
@@ -19,6 +19,11 @@ enum {
|
||||
* @packets: number of seen packets
|
||||
*/
|
||||
struct gnet_stats_basic
|
||||
{
|
||||
__u64 bytes;
|
||||
__u32 packets;
|
||||
};
|
||||
struct gnet_stats_basic_packed
|
||||
{
|
||||
__u64 bytes;
|
||||
__u32 packets;
|
||||
|
@@ -98,7 +98,7 @@ struct hd_struct {
|
||||
int make_it_fail;
|
||||
#endif
|
||||
unsigned long stamp;
|
||||
int in_flight;
|
||||
int in_flight[2];
|
||||
#ifdef CONFIG_SMP
|
||||
struct disk_stats *dkstats;
|
||||
#else
|
||||
@@ -142,7 +142,7 @@ struct gendisk {
|
||||
* disks that can't be partitioned. */
|
||||
|
||||
char disk_name[DISK_NAME_LEN]; /* name of major driver */
|
||||
char *(*nodename)(struct gendisk *gd);
|
||||
char *(*devnode)(struct gendisk *gd, mode_t *mode);
|
||||
/* Array of pointers to partitions indexed by partno.
|
||||
* Protected with matching bdev lock but stat and other
|
||||
* non-critical accesses use RCU. Always access through
|
||||
@@ -151,7 +151,7 @@ struct gendisk {
|
||||
struct disk_part_tbl *part_tbl;
|
||||
struct hd_struct part0;
|
||||
|
||||
struct block_device_operations *fops;
|
||||
const struct block_device_operations *fops;
|
||||
struct request_queue *queue;
|
||||
void *private_data;
|
||||
|
||||
@@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part)
|
||||
#define part_stat_sub(cpu, gendiskp, field, subnd) \
|
||||
part_stat_add(cpu, gendiskp, field, -subnd)
|
||||
|
||||
static inline void part_inc_in_flight(struct hd_struct *part)
|
||||
static inline void part_inc_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight++;
|
||||
part->in_flight[rw]++;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight++;
|
||||
part_to_disk(part)->part0.in_flight[rw]++;
|
||||
}
|
||||
|
||||
static inline void part_dec_in_flight(struct hd_struct *part)
|
||||
static inline void part_dec_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight--;
|
||||
part->in_flight[rw]--;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight--;
|
||||
part_to_disk(part)->part0.in_flight[rw]--;
|
||||
}
|
||||
|
||||
static inline int part_in_flight(struct hd_struct *part)
|
||||
{
|
||||
return part->in_flight[0] + part->in_flight[1];
|
||||
}
|
||||
|
||||
/* block/blk-core.c */
|
||||
@@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_stat_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_inflight_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
#ifdef CONFIG_FAIL_MAKE_REQUEST
|
||||
extern ssize_t part_fail_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
|
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
|
||||
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)
|
||||
@@ -336,18 +335,6 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
||||
void drain_all_pages(void);
|
||||
void drain_local_pages(void *dummy);
|
||||
|
||||
extern bool oom_killer_disabled;
|
||||
|
||||
static inline void oom_killer_disable(void)
|
||||
{
|
||||
oom_killer_disabled = true;
|
||||
}
|
||||
|
||||
static inline void oom_killer_enable(void)
|
||||
{
|
||||
oom_killer_disabled = false;
|
||||
}
|
||||
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
static inline void set_gfp_allowed_mask(gfp_t mask)
|
||||
|
@@ -333,6 +333,28 @@ struct gfs2_leaf {
|
||||
|
||||
/*
|
||||
* Extended attribute header format
|
||||
*
|
||||
* This works in a similar way to dirents. There is a fixed size header
|
||||
* followed by a variable length section made up of the name and the
|
||||
* associated data. In the case of a "stuffed" entry, the value is
|
||||
* inline directly after the name, the ea_num_ptrs entry will be
|
||||
* zero in that case. For non-"stuffed" entries, there will be
|
||||
* a set of pointers (aligned to 8 byte boundary) to the block(s)
|
||||
* containing the value.
|
||||
*
|
||||
* The blocks containing the values and the blocks containing the
|
||||
* extended attribute headers themselves all start with the common
|
||||
* metadata header. Each inode, if it has extended attributes, will
|
||||
* have either a single block containing the extended attribute headers
|
||||
* or a single indirect block pointing to blocks containing the
|
||||
* extended attribure headers.
|
||||
*
|
||||
* The maximim size of the data part of an extended attribute is 64k
|
||||
* so the number of blocks required depends upon block size. Since the
|
||||
* block size also determines the number of pointers in an indirect
|
||||
* block, its a fairly complicated calculation to work out the maximum
|
||||
* number of blocks that an inode may have relating to extended attributes.
|
||||
*
|
||||
*/
|
||||
|
||||
#define GFS2_EA_MAX_NAME_LEN 255
|
||||
|
@@ -2,7 +2,9 @@
|
||||
#define LINUX_HARDIRQ_H
|
||||
|
||||
#include <linux/preempt.h>
|
||||
#ifdef CONFIG_PREEMPT
|
||||
#include <linux/smp_lock.h>
|
||||
#endif
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/ftrace_irq.h>
|
||||
#include <asm/hardirq.h>
|
||||
@@ -62,6 +64,12 @@
|
||||
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
|
||||
#define NMI_OFFSET (1UL << NMI_SHIFT)
|
||||
|
||||
#ifndef PREEMPT_ACTIVE
|
||||
#define PREEMPT_ACTIVE_BITS 1
|
||||
#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
|
||||
#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
|
||||
#endif
|
||||
|
||||
#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
|
||||
#error PREEMPT_ACTIVE is too low!
|
||||
#endif
|
||||
@@ -130,7 +138,7 @@ static inline void account_system_vtime(struct task_struct *tsk)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU)
|
||||
#if defined(CONFIG_NO_HZ)
|
||||
extern void rcu_irq_enter(void);
|
||||
extern void rcu_irq_exit(void);
|
||||
extern void rcu_nmi_enter(void);
|
||||
@@ -140,7 +148,7 @@ extern void rcu_nmi_exit(void);
|
||||
# define rcu_irq_exit() do { } while (0)
|
||||
# define rcu_nmi_enter() do { } while (0)
|
||||
# define rcu_nmi_exit() do { } while (0)
|
||||
#endif /* #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) */
|
||||
#endif /* #if defined(CONFIG_NO_HZ) */
|
||||
|
||||
/*
|
||||
* It is safe to do non-atomic ops on ->hardirq_context,
|
||||
|
@@ -96,7 +96,6 @@ struct esp_struct {
|
||||
int xmit_head;
|
||||
int xmit_tail;
|
||||
int xmit_cnt;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
wait_queue_head_t break_wait;
|
||||
struct async_icount icount; /* kernel counters for the 4 input interrupts */
|
||||
struct hayes_esp_config config; /* port configuration */
|
||||
|
@@ -38,7 +38,7 @@ struct hdlc_proto {
|
||||
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);
|
||||
int (*xmit)(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
|
||||
struct module *module;
|
||||
struct hdlc_proto *next; /* next protocol in the list */
|
||||
};
|
||||
@@ -51,7 +51,7 @@ typedef struct hdlc_device {
|
||||
unsigned short encoding, unsigned short parity);
|
||||
|
||||
/* hardware driver must handle this instead of dev->hard_start_xmit */
|
||||
int (*xmit)(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
|
||||
|
||||
/* Things below are for HDLC layer internal use only */
|
||||
const struct hdlc_proto *proto;
|
||||
@@ -60,7 +60,7 @@ typedef struct hdlc_device {
|
||||
spinlock_t state_lock;
|
||||
void *state;
|
||||
void *priv;
|
||||
}hdlc_device;
|
||||
} hdlc_device;
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void hdlc_close(struct net_device *dev);
|
||||
/* May be used by hardware driver */
|
||||
int hdlc_change_mtu(struct net_device *dev, int new_mtu);
|
||||
/* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */
|
||||
int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
|
||||
int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
|
||||
size_t size);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#define __HID_DEBUG_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Jiri Kosina
|
||||
* Copyright (c) 2007-2009 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,24 +22,44 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define HID_DEBUG_BUFSIZE 512
|
||||
|
||||
void hid_dump_input(struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *);
|
||||
void hid_dump_field(struct hid_field *, int);
|
||||
void hid_resolv_usage(unsigned);
|
||||
void hid_resolv_event(__u8, __u16);
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *, struct seq_file *);
|
||||
void hid_dump_field(struct hid_field *, int, struct seq_file *);
|
||||
char *hid_resolv_usage(unsigned, struct seq_file *);
|
||||
void hid_debug_register(struct hid_device *, const char *);
|
||||
void hid_debug_unregister(struct hid_device *);
|
||||
void hid_debug_init(void);
|
||||
void hid_debug_exit(void);
|
||||
void hid_debug_event(struct hid_device *, char *);
|
||||
|
||||
|
||||
struct hid_debug_list {
|
||||
char *hid_debug_buf;
|
||||
int head;
|
||||
int tail;
|
||||
struct fasync_struct *fasync;
|
||||
struct hid_device *hdev;
|
||||
struct list_head node;
|
||||
struct mutex read_mutex;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#define hid_dump_input(a,b) do { } while (0)
|
||||
#define hid_dump_device(c) do { } while (0)
|
||||
#define hid_dump_field(a,b) do { } while (0)
|
||||
#define hid_resolv_usage(a) do { } while (0)
|
||||
#define hid_resolv_event(a,b) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_HID_DEBUG */
|
||||
|
||||
#define hid_dump_input(a,b,c) do { } while (0)
|
||||
#define hid_dump_device(a,b) do { } while (0)
|
||||
#define hid_dump_field(a,b,c) do { } while (0)
|
||||
#define hid_resolv_usage(a,b) do { } while (0)
|
||||
#define hid_debug_register(a, b) do { } while (0)
|
||||
#define hid_debug_unregister(a) do { } while (0)
|
||||
#define hid_debug_init() do { } while (0)
|
||||
#define hid_debug_exit() do { } while (0)
|
||||
#define hid_debug_event(a,b) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -494,12 +494,21 @@ struct hid_device { /* device report descriptor */
|
||||
|
||||
/* hiddev event handler */
|
||||
int (*hiddev_connect)(struct hid_device *, unsigned int);
|
||||
void (*hiddev_disconnect)(struct hid_device *);
|
||||
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
||||
struct hid_usage *, __s32);
|
||||
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
||||
|
||||
/* handler for raw output data, used by hidraw */
|
||||
int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
|
||||
|
||||
/* debugging support via debugfs */
|
||||
unsigned short debug;
|
||||
struct dentry *debug_dir;
|
||||
struct dentry *debug_rdesc;
|
||||
struct dentry *debug_events;
|
||||
struct list_head debug_list;
|
||||
wait_queue_head_t debug_wait;
|
||||
};
|
||||
|
||||
static inline void *hid_get_drvdata(struct hid_device *hdev)
|
||||
@@ -657,9 +666,7 @@ struct hid_ll_driver {
|
||||
|
||||
/* HID core API */
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
extern int hid_debug;
|
||||
#endif
|
||||
|
||||
extern int hid_add_device(struct hid_device *);
|
||||
extern void hid_destroy_device(struct hid_device *);
|
||||
@@ -685,6 +692,7 @@ struct hid_device *hid_allocate_device(void);
|
||||
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
|
||||
int hid_check_keys_pressed(struct hid_device *hid);
|
||||
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
|
||||
void hid_disconnect(struct hid_device *hid);
|
||||
|
||||
/**
|
||||
* hid_map_usage - map usage input bits
|
||||
@@ -794,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
|
||||
*/
|
||||
static inline void hid_hw_stop(struct hid_device *hdev)
|
||||
{
|
||||
hid_disconnect(hdev);
|
||||
hdev->ll_driver->stop(hdev);
|
||||
}
|
||||
|
||||
@@ -815,21 +824,9 @@ int hid_pidff_init(struct hid_device *hid);
|
||||
#define hid_pidff_init NULL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define dbg_hid(format, arg...) if (hid_debug) \
|
||||
printk(KERN_DEBUG "%s: " format ,\
|
||||
__FILE__ , ## arg)
|
||||
#define dbg_hid_line(format, arg...) if (hid_debug) \
|
||||
printk(format, ## arg)
|
||||
#else
|
||||
static inline int __attribute__((format(printf, 1, 2)))
|
||||
dbg_hid(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#define dbg_hid_line dbg_hid
|
||||
#endif /* HID_DEBUG */
|
||||
|
||||
#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#endif /* HID_FF */
|
||||
|
@@ -91,7 +91,6 @@ enum hrtimer_restart {
|
||||
* @function: timer expiry callback function
|
||||
* @base: pointer to the timer base (per cpu and per clock)
|
||||
* @state: state information (See bit values above)
|
||||
* @cb_entry: list head to enqueue an expired timer into the callback list
|
||||
* @start_site: timer statistics field to store the site where the timer
|
||||
* was started
|
||||
* @start_comm: timer statistics field to store the name of the process which
|
||||
@@ -108,7 +107,6 @@ struct hrtimer {
|
||||
enum hrtimer_restart (*function)(struct hrtimer *);
|
||||
struct hrtimer_clock_base *base;
|
||||
unsigned long state;
|
||||
struct list_head cb_entry;
|
||||
#ifdef CONFIG_TIMER_STATS
|
||||
int start_pid;
|
||||
void *start_site;
|
||||
@@ -448,7 +446,7 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
|
||||
|
||||
static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
|
||||
{
|
||||
if (likely(!timer->start_pid))
|
||||
if (likely(!timer->start_site))
|
||||
return;
|
||||
timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
|
||||
timer->function, timer->start_comm, 0);
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
struct ctl_table;
|
||||
struct user_struct;
|
||||
|
||||
int PageHuge(struct page *page);
|
||||
|
||||
@@ -23,7 +24,9 @@ int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *
|
||||
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);
|
||||
int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
|
||||
struct page **, struct vm_area_struct **,
|
||||
unsigned long *, int *, int, unsigned int flags);
|
||||
void unmap_hugepage_range(struct vm_area_struct *,
|
||||
unsigned long, unsigned long, struct page *);
|
||||
void __unmap_hugepage_range(struct vm_area_struct *,
|
||||
@@ -109,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
||||
|
||||
#endif /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
#define HUGETLB_ANON_FILE "anon_hugepage"
|
||||
|
||||
enum {
|
||||
/*
|
||||
* The file will be used as an shm file so shmfs accounting rules
|
||||
* apply
|
||||
*/
|
||||
HUGETLB_SHMFS_INODE = 1,
|
||||
/*
|
||||
* The file is being created on the internal vfs mount and shmfs
|
||||
* accounting rules do not apply
|
||||
*/
|
||||
HUGETLB_ANONHUGE_INODE = 2,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_HUGETLBFS
|
||||
struct hugetlbfs_config {
|
||||
uid_t uid;
|
||||
@@ -146,7 +164,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
|
||||
|
||||
extern const struct file_operations hugetlbfs_file_operations;
|
||||
extern struct vm_operations_struct hugetlb_vm_ops;
|
||||
struct file *hugetlb_file_setup(const char *name, size_t, int);
|
||||
struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
|
||||
struct user_struct **user, int creat_flags);
|
||||
int hugetlb_get_quota(struct address_space *mapping, long delta);
|
||||
void hugetlb_put_quota(struct address_space *mapping, long delta);
|
||||
|
||||
@@ -168,7 +187,7 @@ static inline void set_file_hugepages(struct file *file)
|
||||
|
||||
#define is_file_hugepages(file) 0
|
||||
#define set_file_hugepages(file) BUG()
|
||||
#define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS)
|
||||
#define hugetlb_file_setup(name,size,acct,user,creat) ERR_PTR(-ENOSYS)
|
||||
|
||||
#endif /* !CONFIG_HUGETLBFS */
|
||||
|
||||
@@ -183,7 +202,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
||||
#define HSTATE_NAME_LEN 32
|
||||
/* Defines one hugetlb page size */
|
||||
struct hstate {
|
||||
int hugetlb_next_nid;
|
||||
int next_nid_to_alloc;
|
||||
int next_nid_to_free;
|
||||
unsigned int order;
|
||||
unsigned long mask;
|
||||
unsigned long max_huge_pages;
|
||||
|
@@ -25,6 +25,9 @@
|
||||
#ifndef __TWL4030_H_
|
||||
#define __TWL4030_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
|
||||
/*
|
||||
* Using the twl4030 core we address registers using a pair
|
||||
* { module id, relative register offset }
|
||||
@@ -220,19 +223,28 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
|
||||
/* Power bus message definitions */
|
||||
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1
|
||||
#define DEV_GRP_P2 0x2
|
||||
#define DEV_GRP_P3 0x4
|
||||
/* The TWL4030/5030 splits its power-management resources (the various
|
||||
* regulators, clock and reset lines) into 3 processor groups - P1, P2 and
|
||||
* P3. These groups can then be configured to transition between sleep, wait-on
|
||||
* and active states by sending messages to the power bus. See Section 5.4.2
|
||||
* Power Resources of TWL4030 TRM
|
||||
*/
|
||||
|
||||
#define RES_GRP_RES 0x0
|
||||
#define RES_GRP_PP 0x1
|
||||
#define RES_GRP_RC 0x2
|
||||
/* Processor groups */
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */
|
||||
#define DEV_GRP_P2 0x2 /* P2: all Modem devices */
|
||||
#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */
|
||||
|
||||
/* Resource groups */
|
||||
#define RES_GRP_RES 0x0 /* Reserved */
|
||||
#define RES_GRP_PP 0x1 /* Power providers */
|
||||
#define RES_GRP_RC 0x2 /* Reset and control */
|
||||
#define RES_GRP_PP_RC 0x3
|
||||
#define RES_GRP_PR 0x4
|
||||
#define RES_GRP_PR 0x4 /* Power references */
|
||||
#define RES_GRP_PP_PR 0x5
|
||||
#define RES_GRP_RC_PR 0x6
|
||||
#define RES_GRP_ALL 0x7
|
||||
#define RES_GRP_ALL 0x7 /* All resource groups */
|
||||
|
||||
#define RES_TYPE2_R0 0x0
|
||||
|
||||
@@ -243,6 +255,41 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
#define RES_STATE_SLEEP 0x8
|
||||
#define RES_STATE_OFF 0x0
|
||||
|
||||
/* Power resources */
|
||||
|
||||
/* Power providers */
|
||||
#define RES_VAUX1 1
|
||||
#define RES_VAUX2 2
|
||||
#define RES_VAUX3 3
|
||||
#define RES_VAUX4 4
|
||||
#define RES_VMMC1 5
|
||||
#define RES_VMMC2 6
|
||||
#define RES_VPLL1 7
|
||||
#define RES_VPLL2 8
|
||||
#define RES_VSIM 9
|
||||
#define RES_VDAC 10
|
||||
#define RES_VINTANA1 11
|
||||
#define RES_VINTANA2 12
|
||||
#define RES_VINTDIG 13
|
||||
#define RES_VIO 14
|
||||
#define RES_VDD1 15
|
||||
#define RES_VDD2 16
|
||||
#define RES_VUSB_1V5 17
|
||||
#define RES_VUSB_1V8 18
|
||||
#define RES_VUSB_3V1 19
|
||||
#define RES_VUSBCP 20
|
||||
#define RES_REGEN 21
|
||||
/* Reset and control */
|
||||
#define RES_NRES_PWRON 22
|
||||
#define RES_CLKEN 23
|
||||
#define RES_SYSEN 24
|
||||
#define RES_HFCLKOUT 25
|
||||
#define RES_32KCLKOUT 26
|
||||
#define RES_RESET 27
|
||||
/* Power Reference */
|
||||
#define RES_Main_Ref 28
|
||||
|
||||
#define TOTAL_RESOURCES 28
|
||||
/*
|
||||
* Power Bus Message Format ... these can be sent individually by Linux,
|
||||
* but are usually part of downloaded scripts that are run when various
|
||||
@@ -302,13 +349,17 @@ struct twl4030_madc_platform_data {
|
||||
int irq_line;
|
||||
};
|
||||
|
||||
/* Boards have uniqe mappings of {col, row} --> keycode.
|
||||
* Column and row are 4 bits, but range only from 0..7.
|
||||
* a PERSISTENT_KEY is "always on" and never reported.
|
||||
*/
|
||||
#define PERSISTENT_KEY(c, r) KEY((c), (r), KEY_RESERVED)
|
||||
|
||||
struct twl4030_keypad_data {
|
||||
int rows;
|
||||
int cols;
|
||||
int *keymap;
|
||||
int irq;
|
||||
unsigned int keymapsize;
|
||||
unsigned int rep:1;
|
||||
const struct matrix_keymap_data *keymap_data;
|
||||
unsigned rows;
|
||||
unsigned cols;
|
||||
bool rep;
|
||||
};
|
||||
|
||||
enum twl4030_usb_mode {
|
||||
@@ -320,6 +371,36 @@ struct twl4030_usb_data {
|
||||
enum twl4030_usb_mode usb_mode;
|
||||
};
|
||||
|
||||
struct twl4030_ins {
|
||||
u16 pmb_message;
|
||||
u8 delay;
|
||||
};
|
||||
|
||||
struct twl4030_script {
|
||||
struct twl4030_ins *script;
|
||||
unsigned size;
|
||||
u8 flags;
|
||||
#define TWL4030_WRST_SCRIPT (1<<0)
|
||||
#define TWL4030_WAKEUP12_SCRIPT (1<<1)
|
||||
#define TWL4030_WAKEUP3_SCRIPT (1<<2)
|
||||
#define TWL4030_SLEEP_SCRIPT (1<<3)
|
||||
};
|
||||
|
||||
struct twl4030_resconfig {
|
||||
u8 resource;
|
||||
u8 devgroup; /* Processor group that Power resource belongs to */
|
||||
u8 type; /* Power resource addressed, 6 / broadcast message */
|
||||
u8 type2; /* Power resource addressed, 3 / broadcast message */
|
||||
};
|
||||
|
||||
struct twl4030_power_data {
|
||||
struct twl4030_script **scripts;
|
||||
unsigned num;
|
||||
struct twl4030_resconfig *resource_config;
|
||||
};
|
||||
|
||||
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
|
||||
|
||||
struct twl4030_platform_data {
|
||||
unsigned irq_base, irq_end;
|
||||
struct twl4030_bci_platform_data *bci;
|
||||
@@ -327,6 +408,7 @@ struct twl4030_platform_data {
|
||||
struct twl4030_madc_platform_data *madc;
|
||||
struct twl4030_keypad_data *keypad;
|
||||
struct twl4030_usb_data *usb;
|
||||
struct twl4030_power_data *power;
|
||||
|
||||
/* LDO regulators */
|
||||
struct regulator_init_data *vdac;
|
||||
@@ -357,7 +439,6 @@ int twl4030_sih_setup(int module);
|
||||
#define TWL4030_VAUX3_DEV_GRP 0x1F
|
||||
#define TWL4030_VAUX3_DEDICATED 0x22
|
||||
|
||||
|
||||
#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
|
||||
defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
|
||||
extern int twl4030charger_usb_en(int enable);
|
||||
|
@@ -171,8 +171,6 @@ struct icmp6_filter {
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
|
||||
extern void icmpv6_send(struct sk_buff *skb,
|
||||
u8 type, u8 code,
|
||||
|
@@ -258,6 +258,7 @@ enum {
|
||||
IDE_TFLAG_DYN = (1 << 5),
|
||||
IDE_TFLAG_FS = (1 << 6),
|
||||
IDE_TFLAG_MULTI_PIO = (1 << 7),
|
||||
IDE_TFLAG_SET_XFER = (1 << 8),
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -294,7 +295,7 @@ struct ide_cmd {
|
||||
} out, in;
|
||||
} valid;
|
||||
|
||||
u8 tf_flags;
|
||||
u16 tf_flags;
|
||||
u8 ftf_flags; /* for TASKFILE ioctl */
|
||||
int protocol;
|
||||
|
||||
@@ -918,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
|
||||
typedef struct {
|
||||
const char *name;
|
||||
mode_t mode;
|
||||
read_proc_t *read_proc;
|
||||
write_proc_t *write_proc;
|
||||
const struct file_operations *proc_fops;
|
||||
} ide_proc_entry_t;
|
||||
|
||||
void proc_ide_create(void);
|
||||
@@ -931,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *);
|
||||
void ide_proc_register_driver(ide_drive_t *, struct ide_driver *);
|
||||
void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *);
|
||||
|
||||
read_proc_t proc_ide_read_capacity;
|
||||
read_proc_t proc_ide_read_geometry;
|
||||
|
||||
/*
|
||||
* Standard exit stuff:
|
||||
*/
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \
|
||||
{ \
|
||||
len -= off; \
|
||||
if (len < count) { \
|
||||
*eof = 1; \
|
||||
if (len <= 0) \
|
||||
return 0; \
|
||||
} else \
|
||||
len = count; \
|
||||
*start = page + off; \
|
||||
return len; \
|
||||
}
|
||||
extern const struct file_operations ide_capacity_proc_fops;
|
||||
extern const struct file_operations ide_geometry_proc_fops;
|
||||
#else
|
||||
static inline void proc_ide_create(void) { ; }
|
||||
static inline void proc_ide_destroy(void) { ; }
|
||||
@@ -960,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive,
|
||||
struct ide_driver *driver) { ; }
|
||||
static inline void ide_proc_unregister_driver(ide_drive_t *drive,
|
||||
struct ide_driver *driver) { ; }
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
@@ -1081,6 +1064,7 @@ extern void ide_fixstring(u8 *, const int, const int);
|
||||
|
||||
int ide_busy_sleep(ide_drive_t *, unsigned long, int);
|
||||
|
||||
int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long, u8 *);
|
||||
int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
|
||||
|
||||
ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
|
||||
@@ -1169,7 +1153,7 @@ int ide_no_data_taskfile(ide_drive_t *, struct ide_cmd *);
|
||||
|
||||
int ide_taskfile_ioctl(ide_drive_t *, unsigned long);
|
||||
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *);
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *, int);
|
||||
|
||||
extern int ide_driveid_update(ide_drive_t *);
|
||||
extern int ide_config_drive_speed(ide_drive_t *, u8);
|
||||
|
@@ -115,7 +115,7 @@
|
||||
#define IEEE80211_MAX_SSID_LEN 32
|
||||
|
||||
#define IEEE80211_MAX_MESH_ID_LEN 32
|
||||
#define IEEE80211_MESH_CONFIG_LEN 19
|
||||
#define IEEE80211_MESH_CONFIG_LEN 24
|
||||
|
||||
#define IEEE80211_QOS_CTL_LEN 2
|
||||
#define IEEE80211_QOS_CTL_TID_MASK 0x000F
|
||||
@@ -802,6 +802,31 @@ struct ieee80211_ht_cap {
|
||||
#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
|
||||
#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
|
||||
|
||||
/*
|
||||
* Maximum length of AMPDU that the STA can receive.
|
||||
* Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
|
||||
*/
|
||||
enum ieee80211_max_ampdu_length_exp {
|
||||
IEEE80211_HT_MAX_AMPDU_8K = 0,
|
||||
IEEE80211_HT_MAX_AMPDU_16K = 1,
|
||||
IEEE80211_HT_MAX_AMPDU_32K = 2,
|
||||
IEEE80211_HT_MAX_AMPDU_64K = 3
|
||||
};
|
||||
|
||||
#define IEEE80211_HT_MAX_AMPDU_FACTOR 13
|
||||
|
||||
/* Minimum MPDU start spacing */
|
||||
enum ieee80211_min_mpdu_spacing {
|
||||
IEEE80211_HT_MPDU_DENSITY_NONE = 0, /* No restriction */
|
||||
IEEE80211_HT_MPDU_DENSITY_0_25 = 1, /* 1/4 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_0_5 = 2, /* 1/2 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_1 = 3, /* 1 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_2 = 4, /* 2 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_4 = 5, /* 4 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_8 = 6, /* 8 usec */
|
||||
IEEE80211_HT_MPDU_DENSITY_16 = 7 /* 16 usec */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_ht_info - HT information
|
||||
*
|
||||
@@ -1196,6 +1221,10 @@ enum ieee80211_sa_query_action {
|
||||
#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
|
||||
#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
|
||||
|
||||
/* AKM suite selectors */
|
||||
#define WLAN_AKM_SUITE_8021X 0x000FAC01
|
||||
#define WLAN_AKM_SUITE_PSK 0x000FAC02
|
||||
|
||||
#define WLAN_MAX_KEY_LEN 32
|
||||
|
||||
/**
|
||||
|
@@ -41,6 +41,7 @@ enum
|
||||
|
||||
#define IFA_F_NODAD 0x02
|
||||
#define IFA_F_OPTIMISTIC 0x04
|
||||
#define IFA_F_DADFAILED 0x08
|
||||
#define IFA_F_HOMEADDRESS 0x10
|
||||
#define IFA_F_DEPRECATED 0x20
|
||||
#define IFA_F_TENTATIVE 0x40
|
||||
|
@@ -87,7 +87,6 @@
|
||||
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
|
||||
#define ARPHRD_IEEE802154 804
|
||||
#define ARPHRD_IEEE802154_PHY 805
|
||||
|
||||
#define ARPHRD_PHONET 820 /* PhoNet media type */
|
||||
#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
|
||||
|
@@ -78,6 +78,7 @@
|
||||
#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
|
||||
#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
|
||||
#define ETH_P_TIPC 0x88CA /* TIPC */
|
||||
#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
|
||||
#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
|
||||
#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
|
||||
#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
@@ -138,10 +139,10 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
|
||||
/*
|
||||
* Display a 6 byte device address (MAC) in a readable format.
|
||||
*/
|
||||
extern char *print_mac(char *buf, const unsigned char *addr);
|
||||
extern char *print_mac(char *buf, const unsigned char *addr) __deprecated;
|
||||
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#define MAC_BUF_SIZE 18
|
||||
#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused
|
||||
#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE]
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -69,11 +69,6 @@ struct dlci_conf {
|
||||
|
||||
#define DLCI_VALID_FLAGS 0x000B
|
||||
|
||||
/* FRAD driver uses these to indicate what it did with packet */
|
||||
#define DLCI_RET_OK 0x00
|
||||
#define DLCI_RET_ERR 0x01
|
||||
#define DLCI_RET_DROP 0x02
|
||||
|
||||
/* defines for the actual Frame Relay hardware */
|
||||
#define FRAD_GET_CONF (SIOCDEVPRIVATE)
|
||||
#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
|
||||
|
@@ -62,6 +62,7 @@
|
||||
#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
|
||||
#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
|
||||
#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
|
||||
#define TUN_F_UFO 0x10 /* I can handle UFO packets */
|
||||
|
||||
/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
|
||||
#define TUN_PKT_STRIP 0x0001
|
||||
|
@@ -233,6 +233,8 @@ extern void ip_mc_init_dev(struct in_device *);
|
||||
extern void ip_mc_destroy_dev(struct in_device *);
|
||||
extern void ip_mc_up(struct in_device *);
|
||||
extern void ip_mc_down(struct in_device *);
|
||||
extern void ip_mc_unmap(struct in_device *);
|
||||
extern void ip_mc_remap(struct in_device *);
|
||||
extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
|
||||
extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
|
||||
extern void ip_mc_rejoin_group(struct ip_mc_list *im);
|
||||
|
@@ -82,7 +82,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
|
||||
|
||||
#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
|
||||
#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING)
|
||||
#define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER)
|
||||
#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
|
||||
#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
|
||||
ACCEPT_SOURCE_ROUTE)
|
||||
#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
|
||||
|
@@ -103,8 +103,8 @@
|
||||
#define __INIT .section ".init.text","ax"
|
||||
#define __FINIT .previous
|
||||
|
||||
#define __INITDATA .section ".init.data","aw"
|
||||
#define __INITRODATA .section ".init.rodata","a"
|
||||
#define __INITDATA .section ".init.data","aw",%progbits
|
||||
#define __INITRODATA .section ".init.rodata","a",%progbits
|
||||
#define __FINITDATA .previous
|
||||
|
||||
#define __DEVINIT .section ".devinit.text", "ax"
|
||||
@@ -305,9 +305,17 @@ void __init parse_early_options(char *cmdline);
|
||||
#ifdef CONFIG_MODULES
|
||||
#define __init_or_module
|
||||
#define __initdata_or_module
|
||||
#define __initconst_or_module
|
||||
#define __INIT_OR_MODULE .text
|
||||
#define __INITDATA_OR_MODULE .data
|
||||
#define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits
|
||||
#else
|
||||
#define __init_or_module __init
|
||||
#define __initdata_or_module __initdata
|
||||
#define __initconst_or_module __initconst
|
||||
#define __INIT_OR_MODULE __INIT
|
||||
#define __INITDATA_OR_MODULE __INITDATA
|
||||
#define __INITRODATA_OR_MODULE __INITRODATA
|
||||
#endif /*CONFIG_MODULES*/
|
||||
|
||||
/* Functions marked as __devexit may be discarded at kernel link time, depending
|
||||
|
@@ -94,15 +94,25 @@ extern struct group_info init_groups;
|
||||
# define CAP_INIT_BSET CAP_INIT_EFF_SET
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TREE_PREEMPT_RCU
|
||||
#define INIT_TASK_RCU_PREEMPT(tsk) \
|
||||
.rcu_read_lock_nesting = 0, \
|
||||
.rcu_read_unlock_special = 0, \
|
||||
.rcu_blocked_node = NULL, \
|
||||
.rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry),
|
||||
#else
|
||||
#define INIT_TASK_RCU_PREEMPT(tsk)
|
||||
#endif
|
||||
|
||||
extern struct cred init_cred;
|
||||
|
||||
#ifdef CONFIG_PERF_COUNTERS
|
||||
# define INIT_PERF_COUNTERS(tsk) \
|
||||
.perf_counter_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.perf_counter_mutex), \
|
||||
.perf_counter_list = LIST_HEAD_INIT(tsk.perf_counter_list),
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
# define INIT_PERF_EVENTS(tsk) \
|
||||
.perf_event_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.perf_event_mutex), \
|
||||
.perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
|
||||
#else
|
||||
# define INIT_PERF_COUNTERS(tsk)
|
||||
# define INIT_PERF_EVENTS(tsk)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -168,11 +178,12 @@ extern struct cred init_cred;
|
||||
}, \
|
||||
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
|
||||
INIT_IDS \
|
||||
INIT_PERF_COUNTERS(tsk) \
|
||||
INIT_PERF_EVENTS(tsk) \
|
||||
INIT_TRACE_IRQFLAGS \
|
||||
INIT_LOCKDEP \
|
||||
INIT_FTRACE_GRAPH \
|
||||
INIT_TRACE_RECURSION \
|
||||
INIT_TASK_RCU_PREEMPT(tsk) \
|
||||
}
|
||||
|
||||
|
||||
@@ -183,5 +194,8 @@ extern struct cred init_cred;
|
||||
LIST_HEAD_INIT(cpu_timers[2]), \
|
||||
}
|
||||
|
||||
/* Attach to the init_task data structure for proper alignment */
|
||||
#define __init_task_data __attribute__((__section__(".data.init_task")))
|
||||
|
||||
|
||||
#endif
|
||||
|
9
include/linux/input/eeti_ts.h
Normal file
9
include/linux/input/eeti_ts.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef LINUX_INPUT_EETI_TS_H
|
||||
#define LINUX_INPUT_EETI_TS_H
|
||||
|
||||
struct eeti_ts_platform_data {
|
||||
unsigned int irq_active_high;
|
||||
};
|
||||
|
||||
#endif /* LINUX_INPUT_EETI_TS_H */
|
||||
|
98
include/linux/input/matrix_keypad.h
Normal file
98
include/linux/input/matrix_keypad.h
Normal file
@@ -0,0 +1,98 @@
|
||||
#ifndef _MATRIX_KEYPAD_H
|
||||
#define _MATRIX_KEYPAD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#define MATRIX_MAX_ROWS 16
|
||||
#define MATRIX_MAX_COLS 16
|
||||
|
||||
#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\
|
||||
(((col) & (MATRIX_MAX_COLS - 1)) << 16) |\
|
||||
(val & 0xffff))
|
||||
|
||||
#define KEY_ROW(k) (((k) >> 24) & 0xff)
|
||||
#define KEY_COL(k) (((k) >> 16) & 0xff)
|
||||
#define KEY_VAL(k) ((k) & 0xffff)
|
||||
|
||||
#define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col))
|
||||
|
||||
/**
|
||||
* struct matrix_keymap_data - keymap for matrix keyboards
|
||||
* @keymap: pointer to array of uint32 values encoded with KEY() macro
|
||||
* representing keymap
|
||||
* @keymap_size: number of entries (initialized) in this keymap
|
||||
*
|
||||
* This structure is supposed to be used by platform code to supply
|
||||
* keymaps to drivers that implement matrix-like keypads/keyboards.
|
||||
*/
|
||||
struct matrix_keymap_data {
|
||||
const uint32_t *keymap;
|
||||
unsigned int keymap_size;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct matrix_keypad_platform_data - platform-dependent keypad data
|
||||
* @keymap_data: pointer to &matrix_keymap_data
|
||||
* @row_gpios: pointer to array of gpio numbers representing rows
|
||||
* @col_gpios: pointer to array of gpio numbers reporesenting colums
|
||||
* @num_row_gpios: actual number of row gpios used by device
|
||||
* @num_col_gpios: actual number of col gpios used by device
|
||||
* @col_scan_delay_us: delay, measured in microseconds, that is
|
||||
* needed before we can keypad after activating column gpio
|
||||
* @debounce_ms: debounce interval in milliseconds
|
||||
*
|
||||
* This structure represents platform-specific data that use used by
|
||||
* matrix_keypad driver to perform proper initialization.
|
||||
*/
|
||||
struct matrix_keypad_platform_data {
|
||||
const struct matrix_keymap_data *keymap_data;
|
||||
|
||||
const unsigned int *row_gpios;
|
||||
const unsigned int *col_gpios;
|
||||
|
||||
unsigned int num_row_gpios;
|
||||
unsigned int num_col_gpios;
|
||||
|
||||
unsigned int col_scan_delay_us;
|
||||
|
||||
/* key debounce interval in milli-second */
|
||||
unsigned int debounce_ms;
|
||||
|
||||
bool active_low;
|
||||
bool wakeup;
|
||||
};
|
||||
|
||||
/**
|
||||
* matrix_keypad_build_keymap - convert platform keymap into matrix keymap
|
||||
* @keymap_data: keymap supplied by the platform code
|
||||
* @row_shift: number of bits to shift row value by to advance to the next
|
||||
* line in the keymap
|
||||
* @keymap: expanded version of keymap that is suitable for use by
|
||||
* matrix keyboad driver
|
||||
* @keybit: pointer to bitmap of keys supported by input device
|
||||
*
|
||||
* This function converts platform keymap (encoded with KEY() macro) into
|
||||
* an array of keycodes that is suitable for using in a standard matrix
|
||||
* keyboard driver that uses row and col as indices.
|
||||
*/
|
||||
static inline void
|
||||
matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
|
||||
unsigned int row_shift,
|
||||
unsigned short *keymap, unsigned long *keybit)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < keymap_data->keymap_size; i++) {
|
||||
unsigned int key = keymap_data->keymap[i];
|
||||
unsigned int row = KEY_ROW(key);
|
||||
unsigned int col = KEY_COL(key);
|
||||
unsigned short code = KEY_VAL(key);
|
||||
|
||||
keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code;
|
||||
__set_bit(code, keybit);
|
||||
}
|
||||
__clear_bit(KEY_RESERVED, keybit);
|
||||
}
|
||||
|
||||
#endif /* _MATRIX_KEYPAD_H */
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/irqflags.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hrtimer.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
@@ -49,6 +50,9 @@
|
||||
* IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
|
||||
* registered first in an shared interrupt is considered for
|
||||
* performance reasons)
|
||||
* IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
|
||||
* Used by threaded interrupts which need to keep the
|
||||
* irq line disabled until the threaded handler has been run.
|
||||
*/
|
||||
#define IRQF_DISABLED 0x00000020
|
||||
#define IRQF_SAMPLE_RANDOM 0x00000040
|
||||
@@ -58,17 +62,20 @@
|
||||
#define IRQF_PERCPU 0x00000400
|
||||
#define IRQF_NOBALANCING 0x00000800
|
||||
#define IRQF_IRQPOLL 0x00001000
|
||||
#define IRQF_ONESHOT 0x00002000
|
||||
|
||||
/*
|
||||
* Bits used by threaded handlers:
|
||||
* IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
|
||||
* IRQTF_DIED - handler thread died
|
||||
* IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
|
||||
* IRQTF_AFFINITY - irq thread is requested to adjust affinity
|
||||
*/
|
||||
enum {
|
||||
IRQTF_RUNTHREAD,
|
||||
IRQTF_DIED,
|
||||
IRQTF_WARNED,
|
||||
IRQTF_AFFINITY,
|
||||
};
|
||||
|
||||
typedef irqreturn_t (*irq_handler_t)(int, void *);
|
||||
@@ -341,6 +348,7 @@ enum
|
||||
NET_TX_SOFTIRQ,
|
||||
NET_RX_SOFTIRQ,
|
||||
BLOCK_SOFTIRQ,
|
||||
BLOCK_IOPOLL_SOFTIRQ,
|
||||
TASKLET_SOFTIRQ,
|
||||
SCHED_SOFTIRQ,
|
||||
HRTIMER_SOFTIRQ,
|
||||
@@ -517,6 +525,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
|
||||
extern void tasklet_init(struct tasklet_struct *t,
|
||||
void (*func)(unsigned long), unsigned long data);
|
||||
|
||||
struct tasklet_hrtimer {
|
||||
struct hrtimer timer;
|
||||
struct tasklet_struct tasklet;
|
||||
enum hrtimer_restart (*function)(struct hrtimer *);
|
||||
};
|
||||
|
||||
extern void
|
||||
tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
|
||||
enum hrtimer_restart (*function)(struct hrtimer *),
|
||||
clockid_t which_clock, enum hrtimer_mode mode);
|
||||
|
||||
static inline
|
||||
int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
|
||||
const enum hrtimer_mode mode)
|
||||
{
|
||||
return hrtimer_start(&ttimer->timer, time, mode);
|
||||
}
|
||||
|
||||
static inline
|
||||
void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
|
||||
{
|
||||
hrtimer_cancel(&ttimer->timer);
|
||||
tasklet_kill(&ttimer->tasklet);
|
||||
}
|
||||
|
||||
/*
|
||||
* Autoprobing for irqs:
|
||||
*
|
||||
|
@@ -49,23 +49,30 @@ static inline struct io_mapping *
|
||||
io_mapping_create_wc(resource_size_t base, unsigned long size)
|
||||
{
|
||||
struct io_mapping *iomap;
|
||||
|
||||
if (!is_io_mapping_possible(base, size))
|
||||
return NULL;
|
||||
pgprot_t prot;
|
||||
|
||||
iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
|
||||
if (!iomap)
|
||||
return NULL;
|
||||
goto out_err;
|
||||
|
||||
if (iomap_create_wc(base, size, &prot))
|
||||
goto out_free;
|
||||
|
||||
iomap->base = base;
|
||||
iomap->size = size;
|
||||
iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
|
||||
iomap->prot = prot;
|
||||
return iomap;
|
||||
|
||||
out_free:
|
||||
kfree(iomap);
|
||||
out_err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
io_mapping_free(struct io_mapping *mapping)
|
||||
{
|
||||
iomap_free(mapping->base, mapping->size);
|
||||
kfree(mapping);
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
|
||||
* a race).
|
||||
*/
|
||||
if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
|
||||
atomic_long_inc(&ioc->refcount);
|
||||
atomic_inc(&ioc->nr_tasks);
|
||||
return ioc;
|
||||
}
|
||||
|
||||
|
@@ -69,6 +69,8 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
|
||||
#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
|
||||
#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/
|
||||
#define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */
|
||||
#define IRQ_ONESHOT 0x08000000 /* IRQ is not unmasked after hardirq */
|
||||
#define IRQ_NESTED_THREAD 0x10000000 /* IRQ is nested into another, no own handler thread */
|
||||
|
||||
#ifdef CONFIG_IRQ_PER_CPU
|
||||
# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
|
||||
@@ -100,6 +102,9 @@ struct msi_desc;
|
||||
* @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
|
||||
* @set_wake: enable/disable power-management wake-on of an IRQ
|
||||
*
|
||||
* @bus_lock: function to lock access to slow bus (i2c) chips
|
||||
* @bus_sync_unlock: function to sync and unlock slow bus (i2c) chips
|
||||
*
|
||||
* @release: release function solely used by UML
|
||||
* @typename: obsoleted by name, kept as migration helper
|
||||
*/
|
||||
@@ -123,6 +128,9 @@ struct irq_chip {
|
||||
int (*set_type)(unsigned int irq, unsigned int flow_type);
|
||||
int (*set_wake)(unsigned int irq, unsigned int on);
|
||||
|
||||
void (*bus_lock)(unsigned int irq);
|
||||
void (*bus_sync_unlock)(unsigned int irq);
|
||||
|
||||
/* Currently used only by UML, might disappear one day.*/
|
||||
#ifdef CONFIG_IRQ_RELEASE_METHOD
|
||||
void (*release)(unsigned int irq, void *dev_id);
|
||||
@@ -219,13 +227,6 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
|
||||
|
||||
extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
|
||||
|
||||
/*
|
||||
* Migration helpers for obsolete names, they will go away:
|
||||
*/
|
||||
#define hw_interrupt_type irq_chip
|
||||
#define no_irq_type no_irq_chip
|
||||
typedef struct irq_desc irq_desc_t;
|
||||
|
||||
/*
|
||||
* Pick up the arch-dependent methods:
|
||||
*/
|
||||
@@ -289,6 +290,7 @@ 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);
|
||||
extern void handle_nested_irq(unsigned int irq);
|
||||
|
||||
/*
|
||||
* Monolithic do_IRQ implementation.
|
||||
@@ -379,6 +381,8 @@ set_irq_chained_handler(unsigned int irq,
|
||||
__set_irq_handler(irq, handle, 1, NULL);
|
||||
}
|
||||
|
||||
extern void set_irq_nested_thread(unsigned int irq, int nest);
|
||||
|
||||
extern void set_irq_noprobe(unsigned int irq);
|
||||
extern void set_irq_probe(unsigned int irq);
|
||||
|
||||
|
@@ -41,6 +41,12 @@ extern struct irq_desc *irq_to_desc(unsigned int irq);
|
||||
; \
|
||||
else
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define irq_node(irq) (irq_to_desc(irq)->node)
|
||||
#else
|
||||
#define irq_node(irq) 0
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
#define for_each_irq_nr(irq) \
|
||||
|
82
include/linux/isdn/hdlc.h
Normal file
82
include/linux/isdn/hdlc.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* hdlc.h -- General purpose ISDN HDLC decoder.
|
||||
*
|
||||
* Implementation of a HDLC decoder/encoder in software.
|
||||
* Neccessary because some ISDN devices don't have HDLC
|
||||
* controllers.
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2009 Karsten Keil <keil@b1-systems.de>
|
||||
* 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
|
||||
* 2001 Frode Isaksen <fisaksen@bewan.com>
|
||||
* 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 __ISDNHDLC_H__
|
||||
#define __ISDNHDLC_H__
|
||||
|
||||
struct isdnhdlc_vars {
|
||||
int bit_shift;
|
||||
int hdlc_bits1;
|
||||
int data_bits;
|
||||
int ffbit_shift; /* encoding only */
|
||||
int state;
|
||||
int dstpos;
|
||||
|
||||
u16 crc;
|
||||
|
||||
u8 cbin;
|
||||
u8 shift_reg;
|
||||
u8 ffvalue;
|
||||
|
||||
/* set if transferring data */
|
||||
u32 data_received:1;
|
||||
/* set if D channel (send idle instead of flags) */
|
||||
u32 dchannel:1;
|
||||
/* set if 56K adaptation */
|
||||
u32 do_adapt56:1;
|
||||
/* set if in closing phase (need to send CRC + flag) */
|
||||
u32 do_closing:1;
|
||||
/* set if data is bitreverse */
|
||||
u32 do_bitreverse:1;
|
||||
};
|
||||
|
||||
/* Feature Flags */
|
||||
#define HDLC_56KBIT 0x01
|
||||
#define HDLC_DCHANNEL 0x02
|
||||
#define HDLC_BITREVERSE 0x04
|
||||
|
||||
/*
|
||||
The return value from isdnhdlc_decode is
|
||||
the frame length, 0 if no complete frame was decoded,
|
||||
or a negative error number
|
||||
*/
|
||||
#define HDLC_FRAMING_ERROR 1
|
||||
#define HDLC_CRC_ERROR 2
|
||||
#define HDLC_LENGTH_ERROR 3
|
||||
|
||||
extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features);
|
||||
|
||||
extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
|
||||
int slen, int *count, u8 *dst, int dsize);
|
||||
|
||||
extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features);
|
||||
|
||||
extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
|
||||
u16 slen, int *count, u8 *dst, int dsize);
|
||||
|
||||
#endif /* __ISDNHDLC_H__ */
|
@@ -446,7 +446,7 @@ struct transaction_s
|
||||
/*
|
||||
* Where in the log does this transaction's commit start? [no locking]
|
||||
*/
|
||||
unsigned long t_log_start;
|
||||
unsigned int t_log_start;
|
||||
|
||||
/* Number of buffers on the t_buffers list [j_list_lock] */
|
||||
int t_nr_buffers;
|
||||
@@ -701,26 +701,26 @@ struct journal_s
|
||||
* Journal head: identifies the first unused block in the journal.
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_head;
|
||||
unsigned int j_head;
|
||||
|
||||
/*
|
||||
* Journal tail: identifies the oldest still-used block in the journal.
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_tail;
|
||||
unsigned int j_tail;
|
||||
|
||||
/*
|
||||
* Journal free: how many free blocks are there in the journal?
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_free;
|
||||
unsigned int j_free;
|
||||
|
||||
/*
|
||||
* Journal start and end: the block numbers of the first usable block
|
||||
* and one beyond the last usable block in the journal. [j_state_lock]
|
||||
*/
|
||||
unsigned long j_first;
|
||||
unsigned long j_last;
|
||||
unsigned int j_first;
|
||||
unsigned int j_last;
|
||||
|
||||
/*
|
||||
* Device, blocksize and starting block offset for the location where we
|
||||
@@ -728,7 +728,7 @@ struct journal_s
|
||||
*/
|
||||
struct block_device *j_dev;
|
||||
int j_blocksize;
|
||||
unsigned long j_blk_offset;
|
||||
unsigned int j_blk_offset;
|
||||
|
||||
/*
|
||||
* Device which holds the client fs. For internal journal this will be
|
||||
@@ -859,7 +859,7 @@ extern void __journal_clean_data_list(transaction_t *transaction);
|
||||
|
||||
/* Log buffer allocation */
|
||||
extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
|
||||
int journal_next_log_block(journal_t *, unsigned long *);
|
||||
int journal_next_log_block(journal_t *, unsigned int *);
|
||||
|
||||
/* Commit management */
|
||||
extern void journal_commit_transaction(journal_t *);
|
||||
@@ -874,7 +874,7 @@ extern int
|
||||
journal_write_metadata_buffer(transaction_t *transaction,
|
||||
struct journal_head *jh_in,
|
||||
struct journal_head **jh_out,
|
||||
unsigned long blocknr);
|
||||
unsigned int blocknr);
|
||||
|
||||
/* Transaction locking */
|
||||
extern void __wait_on_journal (journal_t *);
|
||||
@@ -942,7 +942,7 @@ extern void journal_abort (journal_t *, int);
|
||||
extern int journal_errno (journal_t *);
|
||||
extern void journal_ack_err (journal_t *);
|
||||
extern int journal_clear_err (journal_t *);
|
||||
extern int journal_bmap(journal_t *, unsigned long, unsigned long *);
|
||||
extern int journal_bmap(journal_t *, unsigned int, unsigned int *);
|
||||
extern int journal_force_commit(journal_t *);
|
||||
|
||||
/*
|
||||
@@ -976,14 +976,14 @@ extern int journal_init_revoke_caches(void);
|
||||
|
||||
extern void journal_destroy_revoke(journal_t *);
|
||||
extern int journal_revoke (handle_t *,
|
||||
unsigned long, struct buffer_head *);
|
||||
unsigned int, struct buffer_head *);
|
||||
extern int journal_cancel_revoke(handle_t *, struct journal_head *);
|
||||
extern void journal_write_revoke_records(journal_t *,
|
||||
transaction_t *, int);
|
||||
|
||||
/* Recovery revoke support */
|
||||
extern int journal_set_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern int journal_test_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern int journal_set_revoke(journal_t *, unsigned int, tid_t);
|
||||
extern int journal_test_revoke(journal_t *, unsigned int, tid_t);
|
||||
extern void journal_clear_revoke(journal_t *);
|
||||
extern void journal_switch_revoke_table(journal_t *journal);
|
||||
|
||||
|
@@ -652,7 +652,7 @@ struct transaction_s
|
||||
* This transaction is being forced and some process is
|
||||
* waiting for it to finish.
|
||||
*/
|
||||
int t_synchronous_commit:1;
|
||||
unsigned int t_synchronous_commit:1;
|
||||
|
||||
/*
|
||||
* For use by the filesystem to store fs-specific data
|
||||
|
@@ -125,7 +125,7 @@ extern int _cond_resched(void);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
|
||||
void __might_sleep(char *file, int line);
|
||||
void __might_sleep(char *file, int line, int preempt_offset);
|
||||
/**
|
||||
* might_sleep - annotation for functions that can sleep
|
||||
*
|
||||
@@ -137,8 +137,9 @@ extern int _cond_resched(void);
|
||||
* supposed to.
|
||||
*/
|
||||
# define might_sleep() \
|
||||
do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)
|
||||
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
|
||||
#else
|
||||
static inline void __might_sleep(char *file, int line, int preempt_offset) { }
|
||||
# define might_sleep() do { might_resched(); } while (0)
|
||||
#endif
|
||||
|
||||
|
@@ -129,7 +129,10 @@ struct key {
|
||||
struct rw_semaphore sem; /* change vs change sem */
|
||||
struct key_user *user; /* owner of this key */
|
||||
void *security; /* security data for this key */
|
||||
time_t expiry; /* time at which key expires (or 0) */
|
||||
union {
|
||||
time_t expiry; /* time at which key expires (or 0) */
|
||||
time_t revoked_at; /* time at which key was revoked */
|
||||
};
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
key_perm_t perm; /* access permissions */
|
||||
@@ -275,6 +278,8 @@ static inline key_serial_t key_serial(struct key *key)
|
||||
extern ctl_table key_sysctls[];
|
||||
#endif
|
||||
|
||||
extern void key_replace_session_keyring(void);
|
||||
|
||||
/*
|
||||
* the userspace interface
|
||||
*/
|
||||
@@ -297,6 +302,7 @@ extern void key_init(void);
|
||||
#define key_fsuid_changed(t) do { } while(0)
|
||||
#define key_fsgid_changed(t) do { } while(0)
|
||||
#define key_init() do { } while(0)
|
||||
#define key_replace_session_keyring() do { } while(0)
|
||||
|
||||
#endif /* CONFIG_KEYS */
|
||||
#endif /* __KERNEL__ */
|
||||
|
@@ -52,5 +52,6 @@
|
||||
#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
|
||||
#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
|
||||
#define KEYCTL_GET_SECURITY 17 /* get key security label */
|
||||
#define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */
|
||||
|
||||
#endif /* _LINUX_KEYCTL_H */
|
||||
|
@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
|
||||
spinlock_t *lock);
|
||||
extern void kfifo_free(struct kfifo *fifo);
|
||||
extern unsigned int __kfifo_put(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len);
|
||||
const unsigned char *buffer, unsigned int len);
|
||||
extern unsigned int __kfifo_get(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len);
|
||||
|
||||
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
|
||||
* bytes copied.
|
||||
*/
|
||||
static inline unsigned int kfifo_put(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len)
|
||||
const unsigned char *buffer, unsigned int len)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int ret;
|
||||
|
@@ -34,6 +34,8 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n);
|
||||
int kmemcheck_show_addr(unsigned long address);
|
||||
int kmemcheck_hide_addr(unsigned long address);
|
||||
|
||||
bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size);
|
||||
|
||||
#else
|
||||
#define kmemcheck_enabled 0
|
||||
|
||||
@@ -99,6 +101,11 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p,
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_KMEMCHECK */
|
||||
|
||||
/*
|
||||
@@ -137,7 +144,10 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p,
|
||||
int name##_end[0];
|
||||
|
||||
#define kmemcheck_annotate_bitfield(ptr, name) \
|
||||
do if (ptr) { \
|
||||
do { \
|
||||
if (!ptr) \
|
||||
break; \
|
||||
\
|
||||
int _n = (long) &((ptr)->name##_end) \
|
||||
- (long) &((ptr)->name##_begin); \
|
||||
BUILD_BUG_ON(_n < 0); \
|
||||
|
@@ -23,17 +23,18 @@
|
||||
|
||||
#ifdef CONFIG_DEBUG_KMEMLEAK
|
||||
|
||||
extern void kmemleak_init(void);
|
||||
extern void kmemleak_init(void) __ref;
|
||||
extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
|
||||
gfp_t gfp);
|
||||
extern void kmemleak_free(const void *ptr);
|
||||
gfp_t gfp) __ref;
|
||||
extern void kmemleak_free(const void *ptr) __ref;
|
||||
extern void kmemleak_free_part(const void *ptr, size_t size) __ref;
|
||||
extern void kmemleak_padding(const void *ptr, unsigned long offset,
|
||||
size_t size);
|
||||
extern void kmemleak_not_leak(const void *ptr);
|
||||
extern void kmemleak_ignore(const void *ptr);
|
||||
size_t size) __ref;
|
||||
extern void kmemleak_not_leak(const void *ptr) __ref;
|
||||
extern void kmemleak_ignore(const void *ptr) __ref;
|
||||
extern void kmemleak_scan_area(const void *ptr, unsigned long offset,
|
||||
size_t length, gfp_t gfp);
|
||||
extern void kmemleak_no_scan(const void *ptr);
|
||||
size_t length, gfp_t gfp) __ref;
|
||||
extern void kmemleak_no_scan(const void *ptr) __ref;
|
||||
|
||||
static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
|
||||
int min_count, unsigned long flags,
|
||||
@@ -71,6 +72,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
|
||||
static inline void kmemleak_free(const void *ptr)
|
||||
{
|
||||
}
|
||||
static inline void kmemleak_free_part(const void *ptr, size_t size)
|
||||
{
|
||||
}
|
||||
static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
|
||||
{
|
||||
}
|
||||
|
@@ -48,13 +48,13 @@
|
||||
#define KPROBE_HIT_SSDONE 0x00000008
|
||||
|
||||
/* Attach to insert probes on any functions which should be ignored*/
|
||||
#define __kprobes __attribute__((__section__(".kprobes.text"))) notrace
|
||||
#define __kprobes __attribute__((__section__(".kprobes.text")))
|
||||
#else /* CONFIG_KPROBES */
|
||||
typedef int kprobe_opcode_t;
|
||||
struct arch_specific_insn {
|
||||
int dummy;
|
||||
};
|
||||
#define __kprobes notrace
|
||||
#define __kprobes
|
||||
#endif /* CONFIG_KPROBES */
|
||||
|
||||
struct kprobe;
|
||||
|
79
include/linux/ksm.h
Normal file
79
include/linux/ksm.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef __LINUX_KSM_H
|
||||
#define __LINUX_KSM_H
|
||||
/*
|
||||
* Memory merging support.
|
||||
*
|
||||
* This code enables dynamic sharing of identical pages found in different
|
||||
* memory areas, even if they are not shared by fork().
|
||||
*/
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/vmstat.h>
|
||||
|
||||
#ifdef CONFIG_KSM
|
||||
int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, int advice, unsigned long *vm_flags);
|
||||
int __ksm_enter(struct mm_struct *mm);
|
||||
void __ksm_exit(struct mm_struct *mm);
|
||||
|
||||
static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
{
|
||||
if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags))
|
||||
return __ksm_enter(mm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ksm_exit(struct mm_struct *mm)
|
||||
{
|
||||
if (test_bit(MMF_VM_MERGEABLE, &mm->flags))
|
||||
__ksm_exit(mm);
|
||||
}
|
||||
|
||||
/*
|
||||
* A KSM page is one of those write-protected "shared pages" or "merged pages"
|
||||
* which KSM maps into multiple mms, wherever identical anonymous page content
|
||||
* is found in VM_MERGEABLE vmas. It's a PageAnon page, with NULL anon_vma.
|
||||
*/
|
||||
static inline int PageKsm(struct page *page)
|
||||
{
|
||||
return ((unsigned long)page->mapping == PAGE_MAPPING_ANON);
|
||||
}
|
||||
|
||||
/*
|
||||
* But we have to avoid the checking which page_add_anon_rmap() performs.
|
||||
*/
|
||||
static inline void page_add_ksm_rmap(struct page *page)
|
||||
{
|
||||
if (atomic_inc_and_test(&page->_mapcount)) {
|
||||
page->mapping = (void *) PAGE_MAPPING_ANON;
|
||||
__inc_zone_page_state(page, NR_ANON_PAGES);
|
||||
}
|
||||
}
|
||||
#else /* !CONFIG_KSM */
|
||||
|
||||
static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, int advice, unsigned long *vm_flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ksm_exit(struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int PageKsm(struct page *page)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No stub required for page_add_ksm_rmap(page) */
|
||||
#endif /* !CONFIG_KSM */
|
||||
|
||||
#endif
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#define KVM_API_VERSION 12
|
||||
|
||||
/* for KVM_TRACE_ENABLE */
|
||||
/* for KVM_TRACE_ENABLE, deprecated */
|
||||
struct kvm_user_trace_setup {
|
||||
__u32 buf_size; /* sub_buffer size of each per-cpu */
|
||||
__u32 buf_nr; /* the number of sub_buffers of each per-cpu */
|
||||
@@ -70,6 +70,14 @@ struct kvm_irqchip {
|
||||
} chip;
|
||||
};
|
||||
|
||||
/* for KVM_CREATE_PIT2 */
|
||||
struct kvm_pit_config {
|
||||
__u32 flags;
|
||||
__u32 pad[15];
|
||||
};
|
||||
|
||||
#define KVM_PIT_SPEAKER_DUMMY 1
|
||||
|
||||
#define KVM_EXIT_UNKNOWN 0
|
||||
#define KVM_EXIT_EXCEPTION 1
|
||||
#define KVM_EXIT_IO 2
|
||||
@@ -87,6 +95,10 @@ struct kvm_irqchip {
|
||||
#define KVM_EXIT_S390_RESET 14
|
||||
#define KVM_EXIT_DCR 15
|
||||
#define KVM_EXIT_NMI 16
|
||||
#define KVM_EXIT_INTERNAL_ERROR 17
|
||||
|
||||
/* For KVM_EXIT_INTERNAL_ERROR */
|
||||
#define KVM_INTERNAL_ERROR_EMULATION 1
|
||||
|
||||
/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
|
||||
struct kvm_run {
|
||||
@@ -173,6 +185,9 @@ struct kvm_run {
|
||||
__u32 data;
|
||||
__u8 is_write;
|
||||
} dcr;
|
||||
struct {
|
||||
__u32 suberror;
|
||||
} internal;
|
||||
/* Fix the size of the union. */
|
||||
char padding[256];
|
||||
};
|
||||
@@ -292,6 +307,28 @@ struct kvm_guest_debug {
|
||||
struct kvm_guest_debug_arch arch;
|
||||
};
|
||||
|
||||
enum {
|
||||
kvm_ioeventfd_flag_nr_datamatch,
|
||||
kvm_ioeventfd_flag_nr_pio,
|
||||
kvm_ioeventfd_flag_nr_deassign,
|
||||
kvm_ioeventfd_flag_nr_max,
|
||||
};
|
||||
|
||||
#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
|
||||
#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
|
||||
#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
|
||||
|
||||
#define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1)
|
||||
|
||||
struct kvm_ioeventfd {
|
||||
__u64 datamatch;
|
||||
__u64 addr; /* legal pio/mmio address */
|
||||
__u32 len; /* 1, 2, 4, or 8 bytes */
|
||||
__s32 fd;
|
||||
__u32 flags;
|
||||
__u8 pad[36];
|
||||
};
|
||||
|
||||
#define KVM_TRC_SHIFT 16
|
||||
/*
|
||||
* kvm trace categories
|
||||
@@ -310,35 +347,6 @@ struct kvm_guest_debug {
|
||||
#define KVM_TRC_CYCLE_SIZE 8
|
||||
#define KVM_TRC_EXTRA_MAX 7
|
||||
|
||||
/* This structure represents a single trace buffer record. */
|
||||
struct kvm_trace_rec {
|
||||
/* variable rec_val
|
||||
* is split into:
|
||||
* bits 0 - 27 -> event id
|
||||
* bits 28 -30 -> number of extra data args of size u32
|
||||
* bits 31 -> binary indicator for if tsc is in record
|
||||
*/
|
||||
__u32 rec_val;
|
||||
__u32 pid;
|
||||
__u32 vcpu_id;
|
||||
union {
|
||||
struct {
|
||||
__u64 timestamp;
|
||||
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
|
||||
} __attribute__((packed)) timestamp;
|
||||
struct {
|
||||
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
|
||||
} notimestamp;
|
||||
} u;
|
||||
};
|
||||
|
||||
#define TRACE_REC_EVENT_ID(val) \
|
||||
(0x0fffffff & (val))
|
||||
#define TRACE_REC_NUM_DATA_ARGS(val) \
|
||||
(0x70000000 & ((val) << 28))
|
||||
#define TRACE_REC_TCS(val) \
|
||||
(0x80000000 & ((val) << 31))
|
||||
|
||||
#define KVMIO 0xAE
|
||||
|
||||
/*
|
||||
@@ -415,6 +423,19 @@ struct kvm_trace_rec {
|
||||
#define KVM_CAP_ASSIGN_DEV_IRQ 29
|
||||
/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */
|
||||
#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
|
||||
#ifdef __KVM_HAVE_MCE
|
||||
#define KVM_CAP_MCE 31
|
||||
#endif
|
||||
#define KVM_CAP_IRQFD 32
|
||||
#ifdef __KVM_HAVE_PIT
|
||||
#define KVM_CAP_PIT2 33
|
||||
#endif
|
||||
#define KVM_CAP_SET_BOOT_CPU_ID 34
|
||||
#ifdef __KVM_HAVE_PIT_STATE2
|
||||
#define KVM_CAP_PIT_STATE2 35
|
||||
#endif
|
||||
#define KVM_CAP_IOEVENTFD 36
|
||||
#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
@@ -454,15 +475,32 @@ struct kvm_irq_routing {
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef KVM_CAP_MCE
|
||||
/* x86 MCE */
|
||||
struct kvm_x86_mce {
|
||||
__u64 status;
|
||||
__u64 addr;
|
||||
__u64 misc;
|
||||
__u64 mcg_status;
|
||||
__u8 bank;
|
||||
__u8 pad1[7];
|
||||
__u64 pad2[3];
|
||||
};
|
||||
#endif
|
||||
|
||||
#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
|
||||
|
||||
struct kvm_irqfd {
|
||||
__u32 fd;
|
||||
__u32 gsi;
|
||||
__u32 flags;
|
||||
__u8 pad[20];
|
||||
};
|
||||
|
||||
/*
|
||||
* ioctls for VM fds
|
||||
*/
|
||||
#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
|
||||
#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
|
||||
#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
|
||||
#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
|
||||
struct kvm_userspace_memory_region)
|
||||
#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
|
||||
/*
|
||||
* KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
|
||||
* a vcpu fd.
|
||||
@@ -470,6 +508,12 @@ struct kvm_irq_routing {
|
||||
#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
|
||||
#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
|
||||
#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
|
||||
#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
|
||||
#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
|
||||
#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
|
||||
struct kvm_userspace_memory_region)
|
||||
#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
|
||||
#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
|
||||
/* Device model IOC */
|
||||
#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
|
||||
#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
|
||||
@@ -498,6 +542,10 @@ struct kvm_irq_routing {
|
||||
#define KVM_ASSIGN_SET_MSIX_ENTRY \
|
||||
_IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry)
|
||||
#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
|
||||
#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
|
||||
#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
|
||||
#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
|
||||
#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
|
||||
|
||||
/*
|
||||
* ioctls for vcpu fds
|
||||
@@ -541,6 +589,10 @@ struct kvm_irq_routing {
|
||||
#define KVM_NMI _IO(KVMIO, 0x9a)
|
||||
/* Available with KVM_CAP_SET_GUEST_DEBUG */
|
||||
#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
|
||||
/* MCE for x86 */
|
||||
#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
|
||||
#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
|
||||
#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
|
||||
|
||||
/*
|
||||
* Deprecated interfaces
|
||||
@@ -563,6 +615,9 @@ struct kvm_debug_guest {
|
||||
#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
|
||||
#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
|
||||
|
||||
#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
|
||||
#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
|
||||
|
||||
#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
|
||||
#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
|
||||
#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
|
||||
@@ -633,7 +688,7 @@ struct kvm_assigned_msix_nr {
|
||||
__u16 padding;
|
||||
};
|
||||
|
||||
#define KVM_MAX_MSIX_PER_DEV 512
|
||||
#define KVM_MAX_MSIX_PER_DEV 256
|
||||
struct kvm_assigned_msix_entry {
|
||||
__u32 assigned_dev_id;
|
||||
__u32 gsi;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/marker.h>
|
||||
#include <linux/msi.h>
|
||||
#include <asm/signal.h>
|
||||
|
||||
@@ -42,6 +41,7 @@
|
||||
|
||||
#define KVM_USERSPACE_IRQ_SOURCE_ID 0
|
||||
|
||||
struct kvm;
|
||||
struct kvm_vcpu;
|
||||
extern struct kmem_cache *kvm_vcpu_cache;
|
||||
|
||||
@@ -59,10 +59,18 @@ struct kvm_io_bus {
|
||||
|
||||
void kvm_io_bus_init(struct kvm_io_bus *bus);
|
||||
void kvm_io_bus_destroy(struct kvm_io_bus *bus);
|
||||
struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus,
|
||||
gpa_t addr, int len, int is_write);
|
||||
void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
const void *val);
|
||||
int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
void *val);
|
||||
int __kvm_io_bus_register_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
|
||||
struct kvm_vcpu {
|
||||
struct kvm *kvm;
|
||||
@@ -103,13 +111,14 @@ struct kvm_memory_slot {
|
||||
struct {
|
||||
unsigned long rmap_pde;
|
||||
int write_count;
|
||||
} *lpage_info;
|
||||
} *lpage_info[KVM_NR_PAGE_SIZES - 1];
|
||||
unsigned long userspace_addr;
|
||||
int user_alloc;
|
||||
};
|
||||
|
||||
struct kvm_kernel_irq_routing_entry {
|
||||
u32 gsi;
|
||||
u32 type;
|
||||
int (*set)(struct kvm_kernel_irq_routing_entry *e,
|
||||
struct kvm *kvm, int level);
|
||||
union {
|
||||
@@ -123,7 +132,6 @@ struct kvm_kernel_irq_routing_entry {
|
||||
};
|
||||
|
||||
struct kvm {
|
||||
struct mutex lock; /* protects the vcpus array and APIC accesses */
|
||||
spinlock_t mmu_lock;
|
||||
spinlock_t requests_lock;
|
||||
struct rw_semaphore slots_lock;
|
||||
@@ -131,10 +139,23 @@ struct kvm {
|
||||
int nmemslots;
|
||||
struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
|
||||
KVM_PRIVATE_MEM_SLOTS];
|
||||
#ifdef CONFIG_KVM_APIC_ARCHITECTURE
|
||||
u32 bsp_vcpu_id;
|
||||
struct kvm_vcpu *bsp_vcpu;
|
||||
#endif
|
||||
struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
|
||||
atomic_t online_vcpus;
|
||||
struct list_head vm_list;
|
||||
struct mutex lock;
|
||||
struct kvm_io_bus mmio_bus;
|
||||
struct kvm_io_bus pio_bus;
|
||||
#ifdef CONFIG_HAVE_KVM_EVENTFD
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
struct list_head items;
|
||||
} irqfds;
|
||||
struct list_head ioeventfds;
|
||||
#endif
|
||||
struct kvm_vm_stat stat;
|
||||
struct kvm_arch arch;
|
||||
atomic_t users_count;
|
||||
@@ -143,6 +164,7 @@ struct kvm {
|
||||
struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
|
||||
#endif
|
||||
|
||||
struct mutex irq_lock;
|
||||
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
||||
struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */
|
||||
struct hlist_head mask_notifier_list;
|
||||
@@ -166,6 +188,17 @@ struct kvm {
|
||||
#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
|
||||
#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
|
||||
|
||||
static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
|
||||
{
|
||||
smp_rmb();
|
||||
return kvm->vcpus[i];
|
||||
}
|
||||
|
||||
#define kvm_for_each_vcpu(idx, vcpup, kvm) \
|
||||
for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \
|
||||
idx < atomic_read(&kvm->online_vcpus) && vcpup; \
|
||||
vcpup = kvm_get_vcpu(kvm, ++idx))
|
||||
|
||||
int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id);
|
||||
void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
|
||||
|
||||
@@ -200,6 +233,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
|
||||
struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot old,
|
||||
int user_alloc);
|
||||
void kvm_disable_largepages(void);
|
||||
void kvm_arch_flush_shadow(struct kvm *kvm);
|
||||
gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
|
||||
struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
|
||||
@@ -242,8 +276,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
|
||||
unsigned int ioctl, unsigned long arg);
|
||||
long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||
unsigned int ioctl, unsigned long arg);
|
||||
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
|
||||
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
|
||||
|
||||
int kvm_dev_ioctl_check_extension(long ext);
|
||||
|
||||
@@ -299,7 +331,6 @@ int kvm_arch_hardware_setup(void);
|
||||
void kvm_arch_hardware_unsetup(void);
|
||||
void kvm_arch_check_processor_compat(void *rtn);
|
||||
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
|
||||
int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
|
||||
|
||||
void kvm_free_physmem(struct kvm *kvm);
|
||||
|
||||
@@ -308,8 +339,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm);
|
||||
void kvm_free_all_assigned_devices(struct kvm *kvm);
|
||||
void kvm_arch_sync_events(struct kvm *kvm);
|
||||
|
||||
int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
|
||||
int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
|
||||
int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
|
||||
void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
|
||||
|
||||
@@ -365,7 +394,8 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
|
||||
void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
|
||||
void kvm_register_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
int kvm_request_irq_source_id(struct kvm *kvm);
|
||||
void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
|
||||
|
||||
@@ -458,37 +488,6 @@ struct kvm_stats_debugfs_item {
|
||||
extern struct kvm_stats_debugfs_item debugfs_entries[];
|
||||
extern struct dentry *kvm_debugfs_dir;
|
||||
|
||||
#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 5, d1, d2, d3, d4, d5)
|
||||
#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 4, d1, d2, d3, d4, 0)
|
||||
#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 3, d1, d2, d3, 0, 0)
|
||||
#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 2, d1, d2, 0, 0, 0)
|
||||
#define KVMTRACE_1D(evt, vcpu, d1, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 1, d1, 0, 0, 0, 0)
|
||||
#define KVMTRACE_0D(evt, vcpu, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 0, 0, 0, 0, 0, 0)
|
||||
|
||||
#ifdef CONFIG_KVM_TRACE
|
||||
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
|
||||
void kvm_trace_cleanup(void);
|
||||
#else
|
||||
static inline
|
||||
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#define kvm_trace_cleanup() ((void)0)
|
||||
#endif
|
||||
|
||||
#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
|
||||
static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
|
||||
{
|
||||
@@ -524,4 +523,33 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_KVM_EVENTFD
|
||||
|
||||
void kvm_eventfd_init(struct kvm *kvm);
|
||||
int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags);
|
||||
void kvm_irqfd_release(struct kvm *kvm);
|
||||
int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
|
||||
|
||||
#else
|
||||
|
||||
static inline void kvm_eventfd_init(struct kvm *kvm) {}
|
||||
static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void kvm_irqfd_release(struct kvm *kvm) {}
|
||||
static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_KVM_EVENTFD */
|
||||
|
||||
#ifdef CONFIG_KVM_APIC_ARCHITECTURE
|
||||
static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user