mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge branch 'core/percpu' into stackprotector
Conflicts: arch/x86/include/asm/pda.h arch/x86/include/asm/system.h Also, moved include/asm-x86/stackprotector.h to arch/x86/include/asm. Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
commit
b2b062b816
4925 changed files with 728175 additions and 108139 deletions
|
|
@ -31,7 +31,7 @@ struct pciserial_board {
|
|||
struct serial_private;
|
||||
|
||||
struct serial_private *
|
||||
pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board);
|
||||
pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board);
|
||||
void pciserial_remove_ports(struct serial_private *priv);
|
||||
void pciserial_suspend_ports(struct serial_private *priv);
|
||||
void pciserial_resume_ports(struct serial_private *priv);
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ header-y += dlm_device.h
|
|||
header-y += dlm_netlink.h
|
||||
header-y += dm-ioctl.h
|
||||
header-y += dn.h
|
||||
header-y += dqblk_v1.h
|
||||
header-y += dqblk_v2.h
|
||||
header-y += dqblk_xfs.h
|
||||
header-y += efs_fs_sb.h
|
||||
header-y += elf-fdpic.h
|
||||
|
|
@ -134,8 +132,6 @@ header-y += posix_types.h
|
|||
header-y += ppdev.h
|
||||
header-y += prctl.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += quotaio_v1.h
|
||||
header-y += quotaio_v2.h
|
||||
header-y += radeonfb.h
|
||||
header-y += raw.h
|
||||
header-y += resource.h
|
||||
|
|
@ -183,7 +179,6 @@ unifdef-y += auto_fs.h
|
|||
unifdef-y += auxvec.h
|
||||
unifdef-y += binfmts.h
|
||||
unifdef-y += blktrace_api.h
|
||||
unifdef-y += byteorder.h
|
||||
unifdef-y += capability.h
|
||||
unifdef-y += capi.h
|
||||
unifdef-y += cciss_ioctl.h
|
||||
|
|
@ -376,3 +371,5 @@ unifdef-y += xattr.h
|
|||
unifdef-y += xfrm.h
|
||||
|
||||
objhdr-y += version.h
|
||||
header-y += wimax.h
|
||||
header-y += wimax/
|
||||
|
|
|
|||
|
|
@ -131,22 +131,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity);
|
|||
*/
|
||||
void acpi_unregister_gsi (u32 gsi);
|
||||
|
||||
struct acpi_prt_entry {
|
||||
struct list_head node;
|
||||
struct acpi_pci_id id;
|
||||
u8 pin;
|
||||
struct {
|
||||
acpi_handle handle;
|
||||
u32 index;
|
||||
} link;
|
||||
u32 irq;
|
||||
};
|
||||
|
||||
struct acpi_prt_list {
|
||||
int count;
|
||||
struct list_head entries;
|
||||
};
|
||||
|
||||
struct pci_dev;
|
||||
|
||||
int acpi_pci_irq_enable (struct pci_dev *dev);
|
||||
|
|
@ -270,6 +254,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,
|
|||
#ifdef CONFIG_PM_SLEEP
|
||||
void __init acpi_no_s4_hw_signature(void);
|
||||
void __init acpi_old_suspend_ordering(void);
|
||||
void __init acpi_s4_no_nvs(void);
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
#else /* CONFIG_ACPI */
|
||||
|
||||
|
|
|
|||
25
include/linux/async.h
Normal file
25
include/linux/async.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* async.h: Asynchronous function calls for boot performance
|
||||
*
|
||||
* (C) Copyright 2009 Intel Corporation
|
||||
* Author: Arjan van de Ven <arjan@linux.intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; version 2
|
||||
* of the License.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
typedef u64 async_cookie_t;
|
||||
typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
|
||||
|
||||
extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
|
||||
extern async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *list);
|
||||
extern void async_synchronize_full(void);
|
||||
extern void async_synchronize_full_special(struct list_head *list);
|
||||
extern void async_synchronize_cookie(async_cookie_t cookie);
|
||||
extern void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *list);
|
||||
|
||||
|
|
@ -59,9 +59,7 @@ enum async_tx_flags {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
void async_tx_issue_pending_all(void);
|
||||
enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
|
||||
void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
|
||||
#define async_tx_issue_pending_all dma_issue_pending_all
|
||||
#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
|
||||
#include <asm/async_tx.h>
|
||||
#else
|
||||
|
|
@ -77,19 +75,6 @@ static inline void async_tx_issue_pending_all(void)
|
|||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline enum dma_status
|
||||
dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
return DMA_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void
|
||||
async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
|
||||
struct dma_chan *host_chan)
|
||||
{
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline struct dma_chan *
|
||||
async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
enum dma_transaction_type tx_type, struct page **dst, int dst_count,
|
||||
|
|
|
|||
39
include/linux/atmel-mci.h
Normal file
39
include/linux/atmel-mci.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef __LINUX_ATMEL_MCI_H
|
||||
#define __LINUX_ATMEL_MCI_H
|
||||
|
||||
#define ATMEL_MCI_MAX_NR_SLOTS 2
|
||||
|
||||
#include <linux/dw_dmac.h>
|
||||
|
||||
/**
|
||||
* struct mci_slot_pdata - board-specific per-slot configuration
|
||||
* @bus_width: Number of data lines wired up the slot
|
||||
* @detect_pin: GPIO pin wired to the card detect switch
|
||||
* @wp_pin: GPIO pin wired to the write protect sensor
|
||||
*
|
||||
* If a given slot is not present on the board, @bus_width should be
|
||||
* set to 0. The other fields are ignored in this case.
|
||||
*
|
||||
* Any pins that aren't available should be set to a negative value.
|
||||
*
|
||||
* Note that support for multiple slots is experimental -- some cards
|
||||
* might get upset if we don't get the clock management exactly right.
|
||||
* But in most cases, it should work just fine.
|
||||
*/
|
||||
struct mci_slot_pdata {
|
||||
unsigned int bus_width;
|
||||
int detect_pin;
|
||||
int wp_pin;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mci_platform_data - board-specific MMC/SDcard configuration
|
||||
* @dma_slave: DMA slave interface to use in data transfers.
|
||||
* @slot: Per-slot configuration data.
|
||||
*/
|
||||
struct mci_platform_data {
|
||||
struct dw_dma_slave dma_slave;
|
||||
struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS];
|
||||
};
|
||||
|
||||
#endif /* __LINUX_ATMEL_MCI_H */
|
||||
|
|
@ -247,6 +247,18 @@
|
|||
#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
|
||||
#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
|
||||
|
||||
enum {
|
||||
Audit_equal,
|
||||
Audit_not_equal,
|
||||
Audit_bitmask,
|
||||
Audit_bittest,
|
||||
Audit_lt,
|
||||
Audit_gt,
|
||||
Audit_le,
|
||||
Audit_ge,
|
||||
Audit_bad
|
||||
};
|
||||
|
||||
/* Status symbols */
|
||||
/* Mask values */
|
||||
#define AUDIT_STATUS_ENABLED 0x0001
|
||||
|
|
@ -373,6 +385,8 @@ struct audit_krule {
|
|||
struct audit_watch *watch; /* associated watch */
|
||||
struct audit_tree *tree; /* associated watched tree */
|
||||
struct list_head rlist; /* entry in audit_{watch,tree}.rules list */
|
||||
struct list_head list; /* for AUDIT_LIST* purposes only */
|
||||
u64 prio;
|
||||
};
|
||||
|
||||
struct audit_field {
|
||||
|
|
@ -443,70 +457,56 @@ extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
|
|||
#define audit_get_loginuid(t) ((t)->loginuid)
|
||||
#define audit_get_sessionid(t) ((t)->sessionid)
|
||||
extern void audit_log_task_context(struct audit_buffer *ab);
|
||||
extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp);
|
||||
extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
|
||||
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
|
||||
extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
|
||||
extern int audit_bprm(struct linux_binprm *bprm);
|
||||
extern int audit_socketcall(int nargs, unsigned long *args);
|
||||
extern void audit_socketcall(int nargs, unsigned long *args);
|
||||
extern int audit_sockaddr(int len, void *addr);
|
||||
extern int __audit_fd_pair(int fd1, int fd2);
|
||||
extern void __audit_fd_pair(int fd1, int fd2);
|
||||
extern int audit_set_macxattr(const char *name);
|
||||
extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr);
|
||||
extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout);
|
||||
extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout);
|
||||
extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification);
|
||||
extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
|
||||
extern void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr);
|
||||
extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout);
|
||||
extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification);
|
||||
extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
|
||||
extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
|
||||
const struct cred *new,
|
||||
const struct cred *old);
|
||||
extern int __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old);
|
||||
extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old);
|
||||
|
||||
static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_ipc_obj(ipcp);
|
||||
return 0;
|
||||
__audit_ipc_obj(ipcp);
|
||||
}
|
||||
static inline int audit_fd_pair(int fd1, int fd2)
|
||||
static inline void audit_fd_pair(int fd1, int fd2)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_fd_pair(fd1, fd2);
|
||||
return 0;
|
||||
__audit_fd_pair(fd1, fd2);
|
||||
}
|
||||
static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
|
||||
static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_ipc_set_perm(qbytes, uid, gid, mode);
|
||||
return 0;
|
||||
__audit_ipc_set_perm(qbytes, uid, gid, mode);
|
||||
}
|
||||
static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
|
||||
static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_open(oflag, mode, u_attr);
|
||||
return 0;
|
||||
__audit_mq_open(oflag, mode, attr);
|
||||
}
|
||||
static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
|
||||
static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
|
||||
return 0;
|
||||
__audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout);
|
||||
}
|
||||
static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
|
||||
static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
|
||||
return 0;
|
||||
__audit_mq_notify(mqdes, notification);
|
||||
}
|
||||
static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
|
||||
static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_notify(mqdes, u_notification);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_getsetattr(mqdes, mqstat);
|
||||
return 0;
|
||||
__audit_mq_getsetattr(mqdes, mqstat);
|
||||
}
|
||||
|
||||
static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
|
||||
|
|
@ -518,12 +518,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int audit_log_capset(pid_t pid, const struct cred *new,
|
||||
static inline void audit_log_capset(pid_t pid, const struct cred *new,
|
||||
const struct cred *old)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_log_capset(pid, new, old);
|
||||
return 0;
|
||||
__audit_log_capset(pid, new, old);
|
||||
}
|
||||
|
||||
extern int audit_n_rules;
|
||||
|
|
@ -546,20 +545,19 @@ extern int audit_signals;
|
|||
#define audit_get_loginuid(t) (-1)
|
||||
#define audit_get_sessionid(t) (-1)
|
||||
#define audit_log_task_context(b) do { ; } while (0)
|
||||
#define audit_ipc_obj(i) ({ 0; })
|
||||
#define audit_ipc_set_perm(q,u,g,m) ({ 0; })
|
||||
#define audit_ipc_obj(i) ((void)0)
|
||||
#define audit_ipc_set_perm(q,u,g,m) ((void)0)
|
||||
#define audit_bprm(p) ({ 0; })
|
||||
#define audit_socketcall(n,a) ({ 0; })
|
||||
#define audit_fd_pair(n,a) ({ 0; })
|
||||
#define audit_socketcall(n,a) ((void)0)
|
||||
#define audit_fd_pair(n,a) ((void)0)
|
||||
#define audit_sockaddr(len, addr) ({ 0; })
|
||||
#define audit_set_macxattr(n) do { ; } while (0)
|
||||
#define audit_mq_open(o,m,a) ({ 0; })
|
||||
#define audit_mq_timedsend(d,l,p,t) ({ 0; })
|
||||
#define audit_mq_timedreceive(d,l,p,t) ({ 0; })
|
||||
#define audit_mq_notify(d,n) ({ 0; })
|
||||
#define audit_mq_getsetattr(d,s) ({ 0; })
|
||||
#define audit_mq_open(o,m,a) ((void)0)
|
||||
#define audit_mq_sendrecv(d,l,p,t) ((void)0)
|
||||
#define audit_mq_notify(d,n) ((void)0)
|
||||
#define audit_mq_getsetattr(d,s) ((void)0)
|
||||
#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; })
|
||||
#define audit_log_capset(pid, ncr, ocr) ({ 0; })
|
||||
#define audit_log_capset(pid, ncr, ocr) ((void)0)
|
||||
#define audit_ptrace(t) ((void)0)
|
||||
#define audit_n_rules 0
|
||||
#define audit_signals 0
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#ifndef _LINUX_AUTO_DEV_IOCTL_H
|
||||
#define _LINUX_AUTO_DEV_IOCTL_H
|
||||
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define AUTOFS_DEVICE_NAME "autofs"
|
||||
|
|
@ -25,6 +26,60 @@
|
|||
* An ioctl interface for autofs mount point control.
|
||||
*/
|
||||
|
||||
struct args_protover {
|
||||
__u32 version;
|
||||
};
|
||||
|
||||
struct args_protosubver {
|
||||
__u32 sub_version;
|
||||
};
|
||||
|
||||
struct args_openmount {
|
||||
__u32 devid;
|
||||
};
|
||||
|
||||
struct args_ready {
|
||||
__u32 token;
|
||||
};
|
||||
|
||||
struct args_fail {
|
||||
__u32 token;
|
||||
__s32 status;
|
||||
};
|
||||
|
||||
struct args_setpipefd {
|
||||
__s32 pipefd;
|
||||
};
|
||||
|
||||
struct args_timeout {
|
||||
__u64 timeout;
|
||||
};
|
||||
|
||||
struct args_requester {
|
||||
__u32 uid;
|
||||
__u32 gid;
|
||||
};
|
||||
|
||||
struct args_expire {
|
||||
__u32 how;
|
||||
};
|
||||
|
||||
struct args_askumount {
|
||||
__u32 may_umount;
|
||||
};
|
||||
|
||||
struct args_ismountpoint {
|
||||
union {
|
||||
struct args_in {
|
||||
__u32 type;
|
||||
} in;
|
||||
struct args_out {
|
||||
__u32 devid;
|
||||
__u32 magic;
|
||||
} out;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* All the ioctls use this structure.
|
||||
* When sending a path size must account for the total length
|
||||
|
|
@ -39,20 +94,32 @@ struct autofs_dev_ioctl {
|
|||
* including this struct */
|
||||
__s32 ioctlfd; /* automount command fd */
|
||||
|
||||
__u32 arg1; /* Command parameters */
|
||||
__u32 arg2;
|
||||
/* Command parameters */
|
||||
|
||||
union {
|
||||
struct args_protover protover;
|
||||
struct args_protosubver protosubver;
|
||||
struct args_openmount openmount;
|
||||
struct args_ready ready;
|
||||
struct args_fail fail;
|
||||
struct args_setpipefd setpipefd;
|
||||
struct args_timeout timeout;
|
||||
struct args_requester requester;
|
||||
struct args_expire expire;
|
||||
struct args_askumount askumount;
|
||||
struct args_ismountpoint ismountpoint;
|
||||
};
|
||||
|
||||
char path[0];
|
||||
};
|
||||
|
||||
static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
|
||||
{
|
||||
memset(in, 0, sizeof(struct autofs_dev_ioctl));
|
||||
in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
|
||||
in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
|
||||
in->size = sizeof(struct autofs_dev_ioctl);
|
||||
in->ioctlfd = -1;
|
||||
in->arg1 = 0;
|
||||
in->arg2 = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,64 @@
|
|||
#define AUTOFS_EXP_IMMEDIATE 1
|
||||
#define AUTOFS_EXP_LEAVES 2
|
||||
|
||||
#define AUTOFS_TYPE_ANY 0x0000
|
||||
#define AUTOFS_TYPE_INDIRECT 0x0001
|
||||
#define AUTOFS_TYPE_DIRECT 0x0002
|
||||
#define AUTOFS_TYPE_OFFSET 0x0004
|
||||
#define AUTOFS_TYPE_ANY 0U
|
||||
#define AUTOFS_TYPE_INDIRECT 1U
|
||||
#define AUTOFS_TYPE_DIRECT 2U
|
||||
#define AUTOFS_TYPE_OFFSET 4U
|
||||
|
||||
static inline void set_autofs_type_indirect(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_INDIRECT;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_indirect(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_INDIRECT);
|
||||
}
|
||||
|
||||
static inline void set_autofs_type_direct(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_DIRECT;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_direct(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_DIRECT);
|
||||
}
|
||||
|
||||
static inline void set_autofs_type_offset(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_OFFSET;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_offset(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_OFFSET);
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_trigger(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
|
||||
}
|
||||
|
||||
/*
|
||||
* This isn't really a type as we use it to say "no type set" to
|
||||
* indicate we want to search for "any" mount in the
|
||||
* autofs_dev_ioctl_ismountpoint() device ioctl function.
|
||||
*/
|
||||
static inline void set_autofs_type_any(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_ANY;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_any(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_ANY);
|
||||
}
|
||||
|
||||
/* Daemon notification packet types */
|
||||
enum autofs_notify {
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@
|
|||
#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
|
||||
#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
|
||||
#define AT_CLKTCK 17 /* frequency at which times() increments */
|
||||
|
||||
/* AT_* values 18 through 22 are reserved */
|
||||
#define AT_SECURE 23 /* secure mode boolean */
|
||||
|
||||
#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
|
||||
* differ from AT_PLATFORM. */
|
||||
#define AT_RANDOM 25 /* address of 16 random bytes */
|
||||
|
||||
#define AT_EXECFN 31 /* filename of program */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define AT_VECTOR_SIZE_BASE 18 /* NEW_AUX_ENT entries in auxiliary table */
|
||||
#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */
|
||||
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ struct backlight_device;
|
|||
struct fb_info;
|
||||
|
||||
struct backlight_ops {
|
||||
unsigned int options;
|
||||
|
||||
#define BL_CORE_SUSPENDRESUME (1 << 0)
|
||||
|
||||
/* Notify the backlight driver some property has changed */
|
||||
int (*update_status)(struct backlight_device *);
|
||||
/* Return the current backlight brightness (accounting for power,
|
||||
|
|
@ -51,7 +55,19 @@ struct backlight_properties {
|
|||
modes; 4: full off), see FB_BLANK_XXX */
|
||||
int power;
|
||||
/* FB Blanking active? (values as for power) */
|
||||
/* Due to be removed, please use (state & BL_CORE_FBBLANK) */
|
||||
int fb_blank;
|
||||
/* Flags used to signal drivers of state changes */
|
||||
/* Upper 4 bits are reserved for driver internal use */
|
||||
unsigned int state;
|
||||
|
||||
#define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */
|
||||
#define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */
|
||||
#define BL_CORE_DRIVER4 (1 << 28) /* reserved for driver specific use */
|
||||
#define BL_CORE_DRIVER3 (1 << 29) /* reserved for driver specific use */
|
||||
#define BL_CORE_DRIVER2 (1 << 30) /* reserved for driver specific use */
|
||||
#define BL_CORE_DRIVER1 (1 << 31) /* reserved for driver specific use */
|
||||
|
||||
};
|
||||
|
||||
struct backlight_device {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ struct pt_regs;
|
|||
#define BINPRM_BUF_SIZE 128
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/list.h>
|
||||
|
||||
#define CORENAME_MAX_SIZE 128
|
||||
|
||||
|
|
@ -106,7 +107,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm,
|
|||
extern int bprm_mm_init(struct linux_binprm *bprm);
|
||||
extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern int set_binfmt(struct linux_binfmt *new);
|
||||
extern void free_bprm(struct linux_binprm *);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,9 +137,12 @@ extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits);
|
|||
(1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \
|
||||
)
|
||||
|
||||
#define small_const_nbits(nbits) \
|
||||
(__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
|
||||
|
||||
static inline void bitmap_zero(unsigned long *dst, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = 0UL;
|
||||
else {
|
||||
int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
|
||||
|
|
@ -150,7 +153,7 @@ static inline void bitmap_zero(unsigned long *dst, int nbits)
|
|||
static inline void bitmap_fill(unsigned long *dst, int nbits)
|
||||
{
|
||||
size_t nlongs = BITS_TO_LONGS(nbits);
|
||||
if (nlongs > 1) {
|
||||
if (!small_const_nbits(nbits)) {
|
||||
int len = (nlongs - 1) * sizeof(unsigned long);
|
||||
memset(dst, 0xff, len);
|
||||
}
|
||||
|
|
@ -160,7 +163,7 @@ static inline void bitmap_fill(unsigned long *dst, int nbits)
|
|||
static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
|
||||
int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src;
|
||||
else {
|
||||
int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
|
||||
|
|
@ -171,7 +174,7 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
|
|||
static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 & *src2;
|
||||
else
|
||||
__bitmap_and(dst, src1, src2, nbits);
|
||||
|
|
@ -180,7 +183,7 @@ static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
|
|||
static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 | *src2;
|
||||
else
|
||||
__bitmap_or(dst, src1, src2, nbits);
|
||||
|
|
@ -189,7 +192,7 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
|
|||
static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 ^ *src2;
|
||||
else
|
||||
__bitmap_xor(dst, src1, src2, nbits);
|
||||
|
|
@ -198,7 +201,7 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
|
|||
static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src1 & ~(*src2);
|
||||
else
|
||||
__bitmap_andnot(dst, src1, src2, nbits);
|
||||
|
|
@ -207,7 +210,7 @@ static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
|
|||
static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
|
||||
int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = ~(*src) & BITMAP_LAST_WORD_MASK(nbits);
|
||||
else
|
||||
__bitmap_complement(dst, src, nbits);
|
||||
|
|
@ -216,7 +219,7 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr
|
|||
static inline int bitmap_equal(const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return ! ((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_equal(src1, src2, nbits);
|
||||
|
|
@ -225,7 +228,7 @@ static inline int bitmap_equal(const unsigned long *src1,
|
|||
static inline int bitmap_intersects(const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return ((*src1 & *src2) & BITMAP_LAST_WORD_MASK(nbits)) != 0;
|
||||
else
|
||||
return __bitmap_intersects(src1, src2, nbits);
|
||||
|
|
@ -234,7 +237,7 @@ static inline int bitmap_intersects(const unsigned long *src1,
|
|||
static inline int bitmap_subset(const unsigned long *src1,
|
||||
const unsigned long *src2, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return ! ((*src1 & ~(*src2)) & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_subset(src1, src2, nbits);
|
||||
|
|
@ -242,7 +245,7 @@ static inline int bitmap_subset(const unsigned long *src1,
|
|||
|
||||
static inline int bitmap_empty(const unsigned long *src, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return ! (*src & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_empty(src, nbits);
|
||||
|
|
@ -250,7 +253,7 @@ static inline int bitmap_empty(const unsigned long *src, int nbits)
|
|||
|
||||
static inline int bitmap_full(const unsigned long *src, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_full(src, nbits);
|
||||
|
|
@ -258,7 +261,7 @@ static inline int bitmap_full(const unsigned long *src, int nbits)
|
|||
|
||||
static inline int bitmap_weight(const unsigned long *src, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits));
|
||||
return __bitmap_weight(src, nbits);
|
||||
}
|
||||
|
|
@ -266,7 +269,7 @@ static inline int bitmap_weight(const unsigned long *src, int nbits)
|
|||
static inline void bitmap_shift_right(unsigned long *dst,
|
||||
const unsigned long *src, int n, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = *src >> n;
|
||||
else
|
||||
__bitmap_shift_right(dst, src, n, nbits);
|
||||
|
|
@ -275,7 +278,7 @@ static inline void bitmap_shift_right(unsigned long *dst,
|
|||
static inline void bitmap_shift_left(unsigned long *dst,
|
||||
const unsigned long *src, int n, int nbits)
|
||||
{
|
||||
if (nbits <= BITS_PER_LONG)
|
||||
if (small_const_nbits(nbits))
|
||||
*dst = (*src << n) & BITMAP_LAST_WORD_MASK(nbits);
|
||||
else
|
||||
__bitmap_shift_left(dst, src, n, nbits);
|
||||
|
|
|
|||
|
|
@ -134,9 +134,20 @@ extern unsigned long find_first_bit(const unsigned long *addr,
|
|||
*/
|
||||
extern unsigned long find_first_zero_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
|
||||
#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
|
||||
|
||||
#ifdef CONFIG_GENERIC_FIND_LAST_BIT
|
||||
/**
|
||||
* find_last_bit - find the last set bit in a memory region
|
||||
* @addr: The address to start the search at
|
||||
* @size: The maximum size to search
|
||||
*
|
||||
* Returns the bit number of the first set bit, or size.
|
||||
*/
|
||||
extern unsigned long find_last_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
|
||||
|
||||
#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -690,6 +690,8 @@ struct rq_map_data {
|
|||
struct page **pages;
|
||||
int page_order;
|
||||
int nr_entries;
|
||||
unsigned long offset;
|
||||
int null_mapped;
|
||||
};
|
||||
|
||||
struct req_iterator {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl)
|
|||
* The accessor is a macro so we can embed a blockgroup_lock into different
|
||||
* superblock types
|
||||
*/
|
||||
#define sb_bgl_lock(sb, block_group) \
|
||||
(&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock)
|
||||
static inline spinlock_t *
|
||||
bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group)
|
||||
{
|
||||
return &bgl->locks[(block_group) & (NR_BG_LOCKS-1)].lock;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void __wait_on_buffer(struct buffer_head *);
|
|||
wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
|
||||
int fsync_bdev(struct block_device *);
|
||||
struct super_block *freeze_bdev(struct block_device *);
|
||||
void thaw_bdev(struct block_device *, struct super_block *);
|
||||
int thaw_bdev(struct block_device *, struct super_block *);
|
||||
int fsync_super(struct super_block *);
|
||||
int fsync_no_super(struct block_device *);
|
||||
struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
|
||||
|
|
@ -346,6 +346,15 @@ static inline int remove_inode_buffers(struct inode *inode) { return 1; }
|
|||
static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
|
||||
static inline void invalidate_bdev(struct block_device *bdev) {}
|
||||
|
||||
static inline struct super_block *freeze_bdev(struct block_device *sb)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLOCK */
|
||||
#endif /* _LINUX_BUFFER_HEAD_H */
|
||||
|
|
|
|||
|
|
@ -1,372 +0,0 @@
|
|||
#ifndef _LINUX_BYTEORDER_H
|
||||
#define _LINUX_BYTEORDER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/swab.h>
|
||||
|
||||
#if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
|
||||
# error Fix asm/byteorder.h to define one endianness
|
||||
#endif
|
||||
|
||||
#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
|
||||
# error Fix asm/byteorder.h to define arch endianness
|
||||
#endif
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
# undef __LITTLE_ENDIAN
|
||||
# define __LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
# undef __BIG_ENDIAN
|
||||
# define __BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#if defined(__LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
# define __LITTLE_ENDIAN_BITFIELD
|
||||
#endif
|
||||
|
||||
#if defined(__BIG_ENDIAN) && !defined(__BIG_ENDIAN_BITFIELD)
|
||||
# define __BIG_ENDIAN_BITFIELD
|
||||
#endif
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
# define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
|
||||
# define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
|
||||
# define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
|
||||
# define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
|
||||
# define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
|
||||
# define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
|
||||
|
||||
# define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
|
||||
# define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
|
||||
# define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
|
||||
# define __cpu_to_be16(x) ((__force __be16)__swab16(x))
|
||||
# define __cpu_to_be32(x) ((__force __be32)__swab32(x))
|
||||
# define __cpu_to_be64(x) ((__force __be64)__swab64(x))
|
||||
#endif
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
# define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
|
||||
# define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
|
||||
# define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
|
||||
# define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
|
||||
# define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
|
||||
# define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
|
||||
|
||||
# define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
|
||||
# define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
|
||||
# define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
|
||||
# define __cpu_to_le16(x) ((__force __le16)__swab16(x))
|
||||
# define __cpu_to_le32(x) ((__force __le32)__swab32(x))
|
||||
# define __cpu_to_le64(x) ((__force __le64)__swab64(x))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These helpers could be phased out over time as the base version
|
||||
* handles constant folding.
|
||||
*/
|
||||
#define __constant_htonl(x) __cpu_to_be32(x)
|
||||
#define __constant_ntohl(x) __be32_to_cpu(x)
|
||||
#define __constant_htons(x) __cpu_to_be16(x)
|
||||
#define __constant_ntohs(x) __be16_to_cpu(x)
|
||||
|
||||
#define __constant_le16_to_cpu(x) __le16_to_cpu(x)
|
||||
#define __constant_le32_to_cpu(x) __le32_to_cpu(x)
|
||||
#define __constant_le64_to_cpu(x) __le64_to_cpu(x)
|
||||
#define __constant_be16_to_cpu(x) __be16_to_cpu(x)
|
||||
#define __constant_be32_to_cpu(x) __be32_to_cpu(x)
|
||||
#define __constant_be64_to_cpu(x) __be64_to_cpu(x)
|
||||
|
||||
#define __constant_cpu_to_le16(x) __cpu_to_le16(x)
|
||||
#define __constant_cpu_to_le32(x) __cpu_to_le32(x)
|
||||
#define __constant_cpu_to_le64(x) __cpu_to_le64(x)
|
||||
#define __constant_cpu_to_be16(x) __cpu_to_be16(x)
|
||||
#define __constant_cpu_to_be32(x) __cpu_to_be32(x)
|
||||
#define __constant_cpu_to_be64(x) __cpu_to_be64(x)
|
||||
|
||||
static inline void __le16_to_cpus(__u16 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab16s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_le16s(__u16 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab16s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __le32_to_cpus(__u32 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab32s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_le32s(__u32 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab32s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __le64_to_cpus(__u64 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab64s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_le64s(__u64 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
__swab64s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __be16_to_cpus(__u16 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab16s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_be16s(__u16 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab16s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __be32_to_cpus(__u32 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab32s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_be32s(__u32 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab32s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __be64_to_cpus(__u64 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab64s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __cpu_to_be64s(__u64 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
__swab64s(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u16 __le16_to_cpup(const __le16 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __u16)*p;
|
||||
#else
|
||||
return __swab16p((__force __u16 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u32 __le32_to_cpup(const __le32 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __u32)*p;
|
||||
#else
|
||||
return __swab32p((__force __u32 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u64 __le64_to_cpup(const __le64 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __u64)*p;
|
||||
#else
|
||||
return __swab64p((__force __u64 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __le16 __cpu_to_le16p(const __u16 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __le16)*p;
|
||||
#else
|
||||
return (__force __le16)__swab16p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __le32 __cpu_to_le32p(const __u32 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __le32)*p;
|
||||
#else
|
||||
return (__force __le32)__swab32p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __le64 __cpu_to_le64p(const __u64 *p)
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
return (__force __le64)*p;
|
||||
#else
|
||||
return (__force __le64)__swab64p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u16 __be16_to_cpup(const __be16 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __u16)*p;
|
||||
#else
|
||||
return __swab16p((__force __u16 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u32 __be32_to_cpup(const __be32 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __u32)*p;
|
||||
#else
|
||||
return __swab32p((__force __u32 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __u64 __be64_to_cpup(const __be64 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __u64)*p;
|
||||
#else
|
||||
return __swab64p((__force __u64 *)p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __be16 __cpu_to_be16p(const __u16 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __be16)*p;
|
||||
#else
|
||||
return (__force __be16)__swab16p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __be32 __cpu_to_be32p(const __u32 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __be32)*p;
|
||||
#else
|
||||
return (__force __be32)__swab32p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __be64 __cpu_to_be64p(const __u64 *p)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
return (__force __be64)*p;
|
||||
#else
|
||||
return (__force __be64)__swab64p(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
# define le16_to_cpu __le16_to_cpu
|
||||
# define le32_to_cpu __le32_to_cpu
|
||||
# define le64_to_cpu __le64_to_cpu
|
||||
# define be16_to_cpu __be16_to_cpu
|
||||
# define be32_to_cpu __be32_to_cpu
|
||||
# define be64_to_cpu __be64_to_cpu
|
||||
# define cpu_to_le16 __cpu_to_le16
|
||||
# define cpu_to_le32 __cpu_to_le32
|
||||
# define cpu_to_le64 __cpu_to_le64
|
||||
# define cpu_to_be16 __cpu_to_be16
|
||||
# define cpu_to_be32 __cpu_to_be32
|
||||
# define cpu_to_be64 __cpu_to_be64
|
||||
|
||||
# define le16_to_cpup __le16_to_cpup
|
||||
# define le32_to_cpup __le32_to_cpup
|
||||
# define le64_to_cpup __le64_to_cpup
|
||||
# define be16_to_cpup __be16_to_cpup
|
||||
# define be32_to_cpup __be32_to_cpup
|
||||
# define be64_to_cpup __be64_to_cpup
|
||||
# define cpu_to_le16p __cpu_to_le16p
|
||||
# define cpu_to_le32p __cpu_to_le32p
|
||||
# define cpu_to_le64p __cpu_to_le64p
|
||||
# define cpu_to_be16p __cpu_to_be16p
|
||||
# define cpu_to_be32p __cpu_to_be32p
|
||||
# define cpu_to_be64p __cpu_to_be64p
|
||||
|
||||
# define le16_to_cpus __le16_to_cpus
|
||||
# define le32_to_cpus __le32_to_cpus
|
||||
# define le64_to_cpus __le64_to_cpus
|
||||
# define be16_to_cpus __be16_to_cpus
|
||||
# define be32_to_cpus __be32_to_cpus
|
||||
# define be64_to_cpus __be64_to_cpus
|
||||
# define cpu_to_le16s __cpu_to_le16s
|
||||
# define cpu_to_le32s __cpu_to_le32s
|
||||
# define cpu_to_le64s __cpu_to_le64s
|
||||
# define cpu_to_be16s __cpu_to_be16s
|
||||
# define cpu_to_be32s __cpu_to_be32s
|
||||
# define cpu_to_be64s __cpu_to_be64s
|
||||
|
||||
/*
|
||||
* They have to be macros in order to do the constant folding
|
||||
* correctly - if the argument passed into a inline function
|
||||
* it is no longer constant according to gcc..
|
||||
*/
|
||||
# undef ntohl
|
||||
# undef ntohs
|
||||
# undef htonl
|
||||
# undef htons
|
||||
|
||||
# define ___htonl(x) __cpu_to_be32(x)
|
||||
# define ___htons(x) __cpu_to_be16(x)
|
||||
# define ___ntohl(x) __be32_to_cpu(x)
|
||||
# define ___ntohs(x) __be16_to_cpu(x)
|
||||
|
||||
# define htonl(x) ___htonl(x)
|
||||
# define ntohl(x) ___ntohl(x)
|
||||
# define htons(x) ___htons(x)
|
||||
# define ntohs(x) ___ntohs(x)
|
||||
|
||||
static inline void le16_add_cpu(__le16 *var, u16 val)
|
||||
{
|
||||
*var = cpu_to_le16(le16_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
static inline void le32_add_cpu(__le32 *var, u32 val)
|
||||
{
|
||||
*var = cpu_to_le32(le32_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
static inline void le64_add_cpu(__le64 *var, u64 val)
|
||||
{
|
||||
*var = cpu_to_le64(le64_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
static inline void be16_add_cpu(__be16 *var, u16 val)
|
||||
{
|
||||
*var = cpu_to_be16(be16_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
static inline void be32_add_cpu(__be32 *var, u32 val)
|
||||
{
|
||||
*var = cpu_to_be32(be32_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
static inline void be64_add_cpu(__be64 *var, u64 val)
|
||||
{
|
||||
*var = cpu_to_be64(be64_to_cpup(var) + val);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_BYTEORDER_H */
|
||||
|
|
@ -1,4 +1,2 @@
|
|||
unifdef-y += big_endian.h
|
||||
unifdef-y += little_endian.h
|
||||
unifdef-y += swab.h
|
||||
unifdef-y += swabb.h
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
#include <linux/byteorder/swabb.h>
|
||||
#include <linux/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)(__u32)(x))
|
||||
#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
#include <linux/byteorder/swabb.h>
|
||||
#include <linux/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
|
||||
#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
|
||||
|
|
|
|||
|
|
@ -1,222 +0,0 @@
|
|||
#ifndef _LINUX_BYTEORDER_SWAB_H
|
||||
#define _LINUX_BYTEORDER_SWAB_H
|
||||
|
||||
/*
|
||||
* linux/byteorder/swab.h
|
||||
* Byte-swapping, independently from CPU endianness
|
||||
* swabXX[ps]?(foo)
|
||||
*
|
||||
* Francois-Rene Rideau <fare@tunes.org> 19971205
|
||||
* separated swab functions from cpu_to_XX,
|
||||
* to clean up support for bizarre-endian architectures.
|
||||
*
|
||||
* Trent Piepho <xyzzy@speakeasy.org> 2007114
|
||||
* make constant-folding work, provide C versions that
|
||||
* gcc can optimize better, explain different versions
|
||||
*
|
||||
* See asm-i386/byteorder.h and suches for examples of how to provide
|
||||
* architecture-dependent optimized versions
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/* Functions/macros defined, there are a lot:
|
||||
*
|
||||
* ___swabXX
|
||||
* Generic C versions of the swab functions.
|
||||
*
|
||||
* ___constant_swabXX
|
||||
* C versions that gcc can fold into a compile-time constant when
|
||||
* the argument is a compile-time constant.
|
||||
*
|
||||
* __arch__swabXX[sp]?
|
||||
* Architecture optimized versions of all the swab functions
|
||||
* (including the s and p versions). These can be defined in
|
||||
* asm-arch/byteorder.h. Any which are not, are defined here.
|
||||
* __arch__swabXXs() is defined in terms of __arch__swabXXp(), which
|
||||
* is defined in terms of __arch__swabXX(), which is in turn defined
|
||||
* in terms of ___swabXX(x).
|
||||
* These must be macros. They may be unsafe for arguments with
|
||||
* side-effects.
|
||||
*
|
||||
* __fswabXX
|
||||
* Inline function versions of the __arch__ macros. These _are_ safe
|
||||
* if the arguments have side-effects. Note there are no s and p
|
||||
* versions of these.
|
||||
*
|
||||
* __swabXX[sb]
|
||||
* There are the ones you should actually use. The __swabXX versions
|
||||
* will be a constant given a constant argument and use the arch
|
||||
* specific code (if any) for non-constant arguments. The s and p
|
||||
* versions always use the arch specific code (constant folding
|
||||
* doesn't apply). They are safe to use with arguments with
|
||||
* side-effects.
|
||||
*
|
||||
* swabXX[sb]
|
||||
* Nicknames for __swabXX[sb] to use in the kernel.
|
||||
*/
|
||||
|
||||
/* casts are necessary for constants, because we never know how for sure
|
||||
* how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
|
||||
*/
|
||||
|
||||
static __inline__ __attribute_const__ __u16 ___swab16(__u16 x)
|
||||
{
|
||||
return x<<8 | x>>8;
|
||||
}
|
||||
static __inline__ __attribute_const__ __u32 ___swab32(__u32 x)
|
||||
{
|
||||
return x<<24 | x>>24 |
|
||||
(x & (__u32)0x0000ff00UL)<<8 |
|
||||
(x & (__u32)0x00ff0000UL)>>8;
|
||||
}
|
||||
static __inline__ __attribute_const__ __u64 ___swab64(__u64 x)
|
||||
{
|
||||
return x<<56 | x>>56 |
|
||||
(x & (__u64)0x000000000000ff00ULL)<<40 |
|
||||
(x & (__u64)0x0000000000ff0000ULL)<<24 |
|
||||
(x & (__u64)0x00000000ff000000ULL)<< 8 |
|
||||
(x & (__u64)0x000000ff00000000ULL)>> 8 |
|
||||
(x & (__u64)0x0000ff0000000000ULL)>>24 |
|
||||
(x & (__u64)0x00ff000000000000ULL)>>40;
|
||||
}
|
||||
|
||||
#define ___constant_swab16(x) \
|
||||
((__u16)( \
|
||||
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
|
||||
(((__u16)(x) & (__u16)0xff00U) >> 8) ))
|
||||
#define ___constant_swab32(x) \
|
||||
((__u32)( \
|
||||
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
|
||||
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
|
||||
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
|
||||
(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
|
||||
#define ___constant_swab64(x) \
|
||||
((__u64)( \
|
||||
(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
|
||||
(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
|
||||
|
||||
/*
|
||||
* provide defaults when no architecture-specific optimization is detected
|
||||
*/
|
||||
#ifndef __arch__swab16
|
||||
# define __arch__swab16(x) ___swab16(x)
|
||||
#endif
|
||||
#ifndef __arch__swab32
|
||||
# define __arch__swab32(x) ___swab32(x)
|
||||
#endif
|
||||
#ifndef __arch__swab64
|
||||
# define __arch__swab64(x) ___swab64(x)
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab16p
|
||||
# define __arch__swab16p(x) __arch__swab16(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swab32p
|
||||
# define __arch__swab32p(x) __arch__swab32(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swab64p
|
||||
# define __arch__swab64p(x) __arch__swab64(*(x))
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab16s
|
||||
# define __arch__swab16s(x) ((void)(*(x) = __arch__swab16p(x)))
|
||||
#endif
|
||||
#ifndef __arch__swab32s
|
||||
# define __arch__swab32s(x) ((void)(*(x) = __arch__swab32p(x)))
|
||||
#endif
|
||||
#ifndef __arch__swab64s
|
||||
# define __arch__swab64s(x) ((void)(*(x) = __arch__swab64p(x)))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
# define __swab16(x) \
|
||||
(__builtin_constant_p((__u16)(x)) ? \
|
||||
___constant_swab16((x)) : \
|
||||
__fswab16((x)))
|
||||
# define __swab32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___constant_swab32((x)) : \
|
||||
__fswab32((x)))
|
||||
# define __swab64(x) \
|
||||
(__builtin_constant_p((__u64)(x)) ? \
|
||||
___constant_swab64((x)) : \
|
||||
__fswab64((x)))
|
||||
#else
|
||||
# define __swab16(x) __fswab16(x)
|
||||
# define __swab32(x) __fswab32(x)
|
||||
# define __swab64(x) __fswab64(x)
|
||||
#endif /* OPTIMIZE */
|
||||
|
||||
|
||||
static __inline__ __attribute_const__ __u16 __fswab16(__u16 x)
|
||||
{
|
||||
return __arch__swab16(x);
|
||||
}
|
||||
static __inline__ __u16 __swab16p(const __u16 *x)
|
||||
{
|
||||
return __arch__swab16p(x);
|
||||
}
|
||||
static __inline__ void __swab16s(__u16 *addr)
|
||||
{
|
||||
__arch__swab16s(addr);
|
||||
}
|
||||
|
||||
static __inline__ __attribute_const__ __u32 __fswab32(__u32 x)
|
||||
{
|
||||
return __arch__swab32(x);
|
||||
}
|
||||
static __inline__ __u32 __swab32p(const __u32 *x)
|
||||
{
|
||||
return __arch__swab32p(x);
|
||||
}
|
||||
static __inline__ void __swab32s(__u32 *addr)
|
||||
{
|
||||
__arch__swab32s(addr);
|
||||
}
|
||||
|
||||
#ifdef __BYTEORDER_HAS_U64__
|
||||
static __inline__ __attribute_const__ __u64 __fswab64(__u64 x)
|
||||
{
|
||||
# ifdef __SWAB_64_THRU_32__
|
||||
__u32 h = x >> 32;
|
||||
__u32 l = x & ((1ULL<<32)-1);
|
||||
return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
|
||||
# else
|
||||
return __arch__swab64(x);
|
||||
# endif
|
||||
}
|
||||
static __inline__ __u64 __swab64p(const __u64 *x)
|
||||
{
|
||||
return __arch__swab64p(x);
|
||||
}
|
||||
static __inline__ void __swab64s(__u64 *addr)
|
||||
{
|
||||
__arch__swab64s(addr);
|
||||
}
|
||||
#endif /* __BYTEORDER_HAS_U64__ */
|
||||
|
||||
#if defined(__KERNEL__)
|
||||
#define swab16 __swab16
|
||||
#define swab32 __swab32
|
||||
#define swab64 __swab64
|
||||
#define swab16p __swab16p
|
||||
#define swab32p __swab32p
|
||||
#define swab64p __swab64p
|
||||
#define swab16s __swab16s
|
||||
#define swab32s __swab32s
|
||||
#define swab64s __swab64s
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_SWAB_H */
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
#ifndef _LINUX_BYTEORDER_SWABB_H
|
||||
#define _LINUX_BYTEORDER_SWABB_H
|
||||
|
||||
/*
|
||||
* linux/byteorder/swabb.h
|
||||
* SWAp Bytes Bizarrely
|
||||
* swaHHXX[ps]?(foo)
|
||||
*
|
||||
* Support for obNUXIous pdp-endian and other bizarre architectures.
|
||||
* Will Linux ever run on such ancient beasts? if not, this file
|
||||
* will be but a programming pearl. Still, it's a reminder that we
|
||||
* shouldn't be making too many assumptions when trying to be portable.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Meaning of the names I chose (vaxlinux people feel free to correct them):
|
||||
* swahw32 swap 16-bit half-words in a 32-bit word
|
||||
* swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
|
||||
*
|
||||
* No 64-bit support yet. I don't know NUXI conventions for long longs.
|
||||
* I guarantee it will be a mess when it's there, though :->
|
||||
* It will be even worse if there are conflicting 64-bit conventions.
|
||||
* Hopefully, no one ever used 64-bit objects on NUXI machines.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ___swahw32(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)( \
|
||||
(((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
|
||||
(((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \
|
||||
})
|
||||
#define ___swahb32(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)( \
|
||||
(((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
|
||||
(((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \
|
||||
})
|
||||
|
||||
#define ___constant_swahw32(x) \
|
||||
((__u32)( \
|
||||
(((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
|
||||
(((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
|
||||
#define ___constant_swahb32(x) \
|
||||
((__u32)( \
|
||||
(((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
|
||||
(((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
|
||||
|
||||
/*
|
||||
* provide defaults when no architecture-specific optimization is detected
|
||||
*/
|
||||
#ifndef __arch__swahw32
|
||||
# define __arch__swahw32(x) ___swahw32(x)
|
||||
#endif
|
||||
#ifndef __arch__swahb32
|
||||
# define __arch__swahb32(x) ___swahb32(x)
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32p
|
||||
# define __arch__swahw32p(x) __swahw32(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swahb32p
|
||||
# define __arch__swahb32p(x) __swahb32(*(x))
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32s
|
||||
# define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
|
||||
#endif
|
||||
#ifndef __arch__swahb32s
|
||||
# define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#define __swahw32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahw32((x)) : \
|
||||
__fswahw32((x)))
|
||||
#define __swahb32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahb32((x)) : \
|
||||
__fswahb32((x)))
|
||||
|
||||
|
||||
static inline __u32 __fswahw32(__u32 x)
|
||||
{
|
||||
return __arch__swahw32(x);
|
||||
}
|
||||
|
||||
static inline __u32 __swahw32p(__u32 *x)
|
||||
{
|
||||
return __arch__swahw32p(x);
|
||||
}
|
||||
|
||||
static inline void __swahw32s(__u32 *addr)
|
||||
{
|
||||
__arch__swahw32s(addr);
|
||||
}
|
||||
|
||||
static inline __u32 __fswahb32(__u32 x)
|
||||
{
|
||||
return __arch__swahb32(x);
|
||||
}
|
||||
|
||||
static inline __u32 __swahb32p(__u32 *x)
|
||||
{
|
||||
return __arch__swahb32p(x);
|
||||
}
|
||||
|
||||
static inline void __swahb32s(__u32 *addr)
|
||||
{
|
||||
__arch__swahb32s(addr);
|
||||
}
|
||||
|
||||
#ifdef __BYTEORDER_HAS_U64__
|
||||
/*
|
||||
* Not supported yet
|
||||
*/
|
||||
#endif /* __BYTEORDER_HAS_U64__ */
|
||||
|
||||
#define swahw32 __swahw32
|
||||
#define swahb32 __swahb32
|
||||
#define swahw32p __swahw32p
|
||||
#define swahb32p __swahb32p
|
||||
#define swahw32s __swahw32s
|
||||
#define swahb32s __swahb32s
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_SWABB_H */
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define CAN_VERSION "20081130"
|
||||
#define CAN_VERSION "20090105"
|
||||
|
||||
/* increment this number each time you change some user-space interface */
|
||||
#define CAN_ABI_VERSION "8"
|
||||
|
|
|
|||
|
|
@ -529,8 +529,21 @@ extern const kernel_cap_t __cap_init_eff_set;
|
|||
*
|
||||
* Note that this does not set PF_SUPERPRIV on the task.
|
||||
*/
|
||||
#define has_capability(t, cap) (security_capable((t), (cap)) == 0)
|
||||
#define has_capability_noaudit(t, cap) (security_capable_noaudit((t), (cap)) == 0)
|
||||
#define has_capability(t, cap) (security_real_capable((t), (cap)) == 0)
|
||||
|
||||
/**
|
||||
* has_capability_noaudit - Determine if a task has a superior capability available (unaudited)
|
||||
* @t: The task in question
|
||||
* @cap: The capability to be tested for
|
||||
*
|
||||
* Return true if the specified task has the given superior capability
|
||||
* currently in effect, false if not, but don't write an audit message for the
|
||||
* check.
|
||||
*
|
||||
* Note that this does not set PF_SUPERPRIV on the task.
|
||||
*/
|
||||
#define has_capability_noaudit(t, cap) \
|
||||
(security_real_capable_noaudit((t), (cap)) == 0)
|
||||
|
||||
extern int capable(int cap);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ struct cgroup_subsys_state {
|
|||
* hierarchy structure */
|
||||
struct cgroup *cgroup;
|
||||
|
||||
/* State maintained by the cgroup system to allow
|
||||
* subsystems to be "busy". Should be accessed via css_get()
|
||||
* and css_put() */
|
||||
/* State maintained by the cgroup system to allow subsystems
|
||||
* to be "busy". Should be accessed via css_get(),
|
||||
* css_tryget() and and css_put(). */
|
||||
|
||||
atomic_t refcnt;
|
||||
|
||||
|
|
@ -64,11 +64,14 @@ struct cgroup_subsys_state {
|
|||
/* bits in struct cgroup_subsys_state flags field */
|
||||
enum {
|
||||
CSS_ROOT, /* This CSS is the root of the subsystem */
|
||||
CSS_REMOVED, /* This CSS is dead */
|
||||
};
|
||||
|
||||
/*
|
||||
* Call css_get() to hold a reference on the cgroup;
|
||||
*
|
||||
* Call css_get() to hold a reference on the css; it can be used
|
||||
* for a reference obtained via:
|
||||
* - an existing ref-counted reference to the css
|
||||
* - task->cgroups for a locked task
|
||||
*/
|
||||
|
||||
static inline void css_get(struct cgroup_subsys_state *css)
|
||||
|
|
@ -77,9 +80,32 @@ static inline void css_get(struct cgroup_subsys_state *css)
|
|||
if (!test_bit(CSS_ROOT, &css->flags))
|
||||
atomic_inc(&css->refcnt);
|
||||
}
|
||||
|
||||
static inline bool css_is_removed(struct cgroup_subsys_state *css)
|
||||
{
|
||||
return test_bit(CSS_REMOVED, &css->flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Call css_tryget() to take a reference on a css if your existing
|
||||
* (known-valid) reference isn't already ref-counted. Returns false if
|
||||
* the css has been destroyed.
|
||||
*/
|
||||
|
||||
static inline bool css_tryget(struct cgroup_subsys_state *css)
|
||||
{
|
||||
if (test_bit(CSS_ROOT, &css->flags))
|
||||
return true;
|
||||
while (!atomic_inc_not_zero(&css->refcnt)) {
|
||||
if (test_bit(CSS_REMOVED, &css->flags))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* css_put() should be called to release a reference taken by
|
||||
* css_get()
|
||||
* css_get() or css_tryget()
|
||||
*/
|
||||
|
||||
extern void __css_put(struct cgroup_subsys_state *css);
|
||||
|
|
@ -116,7 +142,7 @@ struct cgroup {
|
|||
struct list_head children; /* my children */
|
||||
|
||||
struct cgroup *parent; /* my parent */
|
||||
struct dentry *dentry; /* cgroup fs entry */
|
||||
struct dentry *dentry; /* cgroup fs entry, RCU protected */
|
||||
|
||||
/* Private pointers for each registered subsystem */
|
||||
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
||||
|
|
@ -145,6 +171,9 @@ struct cgroup {
|
|||
int pids_use_count;
|
||||
/* Length of the current tasks_pids array */
|
||||
int pids_length;
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
/* A css_set is a structure holding pointers to a set of
|
||||
|
|
@ -329,13 +358,7 @@ struct cgroup_subsys {
|
|||
struct cgroup *cgrp);
|
||||
void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*bind)(struct cgroup_subsys *ss, struct cgroup *root);
|
||||
/*
|
||||
* This routine is called with the task_lock of mm->owner held
|
||||
*/
|
||||
void (*mm_owner_changed)(struct cgroup_subsys *ss,
|
||||
struct cgroup *old,
|
||||
struct cgroup *new,
|
||||
struct task_struct *p);
|
||||
|
||||
int subsys_id;
|
||||
int active;
|
||||
int disabled;
|
||||
|
|
@ -343,9 +366,23 @@ struct cgroup_subsys {
|
|||
#define MAX_CGROUP_TYPE_NAMELEN 32
|
||||
const char *name;
|
||||
|
||||
/* Protected by RCU */
|
||||
struct cgroupfs_root *root;
|
||||
/*
|
||||
* Protects sibling/children links of cgroups in this
|
||||
* hierarchy, plus protects which hierarchy (or none) the
|
||||
* subsystem is a part of (i.e. root/sibling). To avoid
|
||||
* potential deadlocks, the following operations should not be
|
||||
* undertaken while holding any hierarchy_mutex:
|
||||
*
|
||||
* - allocating memory
|
||||
* - initiating hotplug events
|
||||
*/
|
||||
struct mutex hierarchy_mutex;
|
||||
|
||||
/*
|
||||
* Link to parent, and list entry in parent's children.
|
||||
* Protected by this->hierarchy_mutex and cgroup_lock()
|
||||
*/
|
||||
struct cgroupfs_root *root;
|
||||
struct list_head sibling;
|
||||
};
|
||||
|
||||
|
|
@ -400,9 +437,6 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
|
|||
int cgroup_scan_tasks(struct cgroup_scanner *scan);
|
||||
int cgroup_attach_task(struct cgroup *, struct task_struct *);
|
||||
|
||||
void cgroup_mm_owner_callbacks(struct task_struct *old,
|
||||
struct task_struct *new);
|
||||
|
||||
#else /* !CONFIG_CGROUPS */
|
||||
|
||||
static inline int cgroup_init_early(void) { return 0; }
|
||||
|
|
@ -420,9 +454,6 @@ static inline int cgroupstats_build(struct cgroupstats *stats,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void cgroup_mm_owner_callbacks(struct task_struct *old,
|
||||
struct task_struct *new) {}
|
||||
|
||||
#endif /* !CONFIG_CGROUPS */
|
||||
|
||||
#endif /* _LINUX_CGROUP_H */
|
||||
|
|
|
|||
|
|
@ -82,13 +82,13 @@ struct clock_event_device {
|
|||
int shift;
|
||||
int rating;
|
||||
int irq;
|
||||
cpumask_t cpumask;
|
||||
const struct cpumask *cpumask;
|
||||
int (*set_next_event)(unsigned long evt,
|
||||
struct clock_event_device *);
|
||||
void (*set_mode)(enum clock_event_mode mode,
|
||||
struct clock_event_device *);
|
||||
void (*event_handler)(struct clock_event_device *);
|
||||
void (*broadcast)(cpumask_t mask);
|
||||
void (*broadcast)(const struct cpumask *mask);
|
||||
struct list_head list;
|
||||
enum clock_event_mode mode;
|
||||
ktime_t next_event;
|
||||
|
|
|
|||
|
|
@ -11,9 +11,19 @@
|
|||
/* The "volatile" is due to gcc bugs */
|
||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||
|
||||
/* This macro obfuscates arithmetic on a variable address so that gcc
|
||||
shouldn't recognize the original var, and make assumptions about it */
|
||||
/*
|
||||
* This macro obfuscates arithmetic on a variable address so that gcc
|
||||
* shouldn't recognize the original var, and make assumptions about it.
|
||||
*
|
||||
* This is needed because the C standard makes it undefined to do
|
||||
* pointer arithmetic on "objects" outside their boundaries and the
|
||||
* gcc optimizers assume this is the case. In particular they
|
||||
* assume such arithmetic does not wrap.
|
||||
*
|
||||
* A miscompilation has been observed because of this on PPC.
|
||||
* To work around it we hide the relationship of the pointer and the object
|
||||
* using this macro.
|
||||
*
|
||||
* Versions of the ppc64 compiler before 4.1 had a bug where use of
|
||||
* RELOC_HIDE could trash r30. The bug can be worked around by changing
|
||||
* the inline assembly constraint from =g to =r, in this particular
|
||||
|
|
@ -61,3 +71,8 @@
|
|||
#define noinline __attribute__((noinline))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
#define __maybe_unused __attribute__((unused))
|
||||
|
||||
#define __gcc_header(x) #x
|
||||
#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
|
||||
#define gcc_header(x) _gcc_header(x)
|
||||
#include gcc_header(__GNUC__)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
|
||||
#endif
|
||||
|
||||
/* These definitions are for GCC v3.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
#if __GNUC_MINOR__ < 2
|
||||
# error Sorry, your compiler is too old - please upgrade it.
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 3
|
||||
# define __used __attribute__((__used__))
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
|
||||
#endif
|
||||
|
||||
/* These definitions are for GCC v4.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
/* GCC 4.1.[01] miscompiles __weak */
|
||||
#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
|
||||
# error Your version of gcc miscompiles the __weak directive
|
||||
#endif
|
||||
|
||||
#define __used __attribute__((__used__))
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
|
|
@ -16,7 +18,7 @@
|
|||
*/
|
||||
#define uninitialized_var(x) x = x
|
||||
|
||||
#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
|
||||
#if __GNUC_MINOR__ >= 3
|
||||
/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
to them will be unlikely. This means a lot of manual unlikely()s
|
||||
are unnecessary now for any paths leading to the usual suspects
|
||||
|
|
|
|||
|
|
@ -36,12 +36,8 @@ extern void __chk_io_ptr(const volatile void __iomem *);
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#if __GNUC__ >= 4
|
||||
# include <linux/compiler-gcc4.h>
|
||||
#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
|
||||
# include <linux/compiler-gcc3.h>
|
||||
#else
|
||||
# error Sorry, your compiler is too old/not recognized.
|
||||
#ifdef __GNUC__
|
||||
#include <linux/compiler-gcc.h>
|
||||
#endif
|
||||
|
||||
#define notrace __attribute__((no_instrument_function))
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ struct cpufreq_real_policy {
|
|||
};
|
||||
|
||||
struct cpufreq_policy {
|
||||
cpumask_t cpus; /* CPUs requiring sw coordination */
|
||||
cpumask_t related_cpus; /* CPUs with any coordination */
|
||||
cpumask_var_t cpus; /* CPUs requiring sw coordination */
|
||||
cpumask_var_t related_cpus; /* CPUs with any coordination */
|
||||
unsigned int shared_type; /* ANY or ALL affected CPUs
|
||||
should set cpufreq */
|
||||
unsigned int cpu; /* cpu nr of registered CPU */
|
||||
|
|
@ -234,6 +234,7 @@ struct cpufreq_driver {
|
|||
int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
|
||||
int (*resume) (struct cpufreq_policy *policy);
|
||||
struct freq_attr **attr;
|
||||
bool hide_interface;
|
||||
};
|
||||
|
||||
/* flags */
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@
|
|||
typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
|
||||
extern cpumask_t _unused_cpumask_arg_;
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
|
|
@ -267,6 +268,26 @@ static inline void __cpus_shift_left(cpumask_t *dstp,
|
|||
{
|
||||
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special-case data structure for "single bit set only" constant CPU masks.
|
||||
|
|
@ -278,13 +299,14 @@ static inline void __cpus_shift_left(cpumask_t *dstp,
|
|||
extern const unsigned long
|
||||
cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)];
|
||||
|
||||
static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
|
||||
static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
p -= cpu / BITS_PER_LONG;
|
||||
return (const cpumask_t *)p;
|
||||
return to_cpumask(p);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
/*
|
||||
* In cases where we take the address of the cpumask immediately,
|
||||
* gcc optimizes it out (it's a constant) and there's no huge stack
|
||||
|
|
@ -339,36 +361,6 @@ extern cpumask_t cpu_mask_all;
|
|||
#endif
|
||||
#define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v)
|
||||
|
||||
#define cpumask_scnprintf(buf, len, src) \
|
||||
__cpumask_scnprintf((buf), (len), &(src), NR_CPUS)
|
||||
static inline int __cpumask_scnprintf(char *buf, int len,
|
||||
const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_scnprintf(buf, len, srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpumask_parse_user(ubuf, ulen, dst) \
|
||||
__cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
|
||||
static inline int __cpumask_parse_user(const char __user *buf, int len,
|
||||
cpumask_t *dstp, int nbits)
|
||||
{
|
||||
return bitmap_parse_user(buf, len, dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpulist_scnprintf(buf, len, src) \
|
||||
__cpulist_scnprintf((buf), (len), &(src), NR_CPUS)
|
||||
static inline int __cpulist_scnprintf(char *buf, int len,
|
||||
const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpulist_parse(buf, dst) __cpulist_parse((buf), &(dst), NR_CPUS)
|
||||
static inline int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits)
|
||||
{
|
||||
return bitmap_parselist(buf, dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpu_remap(oldbit, old, new) \
|
||||
__cpu_remap((oldbit), &(old), &(new), NR_CPUS)
|
||||
static inline int __cpu_remap(int oldbit,
|
||||
|
|
@ -400,19 +392,22 @@ static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp,
|
|||
{
|
||||
bitmap_fold(dstp->bits, origp->bits, sz, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
#if NR_CPUS == 1
|
||||
|
||||
#define nr_cpu_ids 1
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define first_cpu(src) ({ (void)(src); 0; })
|
||||
#define next_cpu(n, src) ({ (void)(src); 1; })
|
||||
#define any_online_cpu(mask) 0
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#else /* NR_CPUS > 1 */
|
||||
|
||||
extern int nr_cpu_ids;
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
int __first_cpu(const cpumask_t *srcp);
|
||||
int __next_cpu(int n, const cpumask_t *srcp);
|
||||
int __any_online_cpu(const cpumask_t *mask);
|
||||
|
|
@ -424,8 +419,10 @@ int __any_online_cpu(const cpumask_t *mask);
|
|||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu((cpu), (mask)), \
|
||||
(cpu) < NR_CPUS; )
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#if NR_CPUS <= 64
|
||||
|
||||
#define next_cpu_nr(n, src) next_cpu(n, src)
|
||||
|
|
@ -443,77 +440,67 @@ int __next_cpu_nr(int n, const cpumask_t *srcp);
|
|||
(cpu) < nr_cpu_ids; )
|
||||
|
||||
#endif /* NR_CPUS > 64 */
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
/*
|
||||
* The following particular system cpumasks and operations manage
|
||||
* possible, present, active and online cpus. Each of them is a fixed size
|
||||
* bitmap of size NR_CPUS.
|
||||
* possible, present, active and online cpus.
|
||||
*
|
||||
* #ifdef CONFIG_HOTPLUG_CPU
|
||||
* cpu_possible_map - has bit 'cpu' set iff cpu is populatable
|
||||
* cpu_present_map - has bit 'cpu' set iff cpu is populated
|
||||
* cpu_online_map - has bit 'cpu' set iff cpu available to scheduler
|
||||
* cpu_active_map - has bit 'cpu' set iff cpu available to migration
|
||||
* #else
|
||||
* cpu_possible_map - has bit 'cpu' set iff cpu is populated
|
||||
* cpu_present_map - copy of cpu_possible_map
|
||||
* cpu_online_map - has bit 'cpu' set iff cpu available to scheduler
|
||||
* #endif
|
||||
* cpu_possible_mask- has bit 'cpu' set iff cpu is populatable
|
||||
* cpu_present_mask - has bit 'cpu' set iff cpu is populated
|
||||
* cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler
|
||||
* cpu_active_mask - has bit 'cpu' set iff cpu available to migration
|
||||
*
|
||||
* In either case, NR_CPUS is fixed at compile time, as the static
|
||||
* size of these bitmaps. The cpu_possible_map is fixed at boot
|
||||
* time, as the set of CPU id's that it is possible might ever
|
||||
* be plugged in at anytime during the life of that system boot.
|
||||
* The cpu_present_map is dynamic(*), representing which CPUs
|
||||
* are currently plugged in. And cpu_online_map is the dynamic
|
||||
* subset of cpu_present_map, indicating those CPUs available
|
||||
* for scheduling.
|
||||
* If !CONFIG_HOTPLUG_CPU, present == possible, and active == online.
|
||||
*
|
||||
* If HOTPLUG is enabled, then cpu_possible_map is forced to have
|
||||
* The cpu_possible_mask is fixed at boot time, as the set of CPU id's
|
||||
* that it is possible might ever be plugged in at anytime during the
|
||||
* life of that system boot. The cpu_present_mask is dynamic(*),
|
||||
* representing which CPUs are currently plugged in. And
|
||||
* cpu_online_mask is the dynamic subset of cpu_present_mask,
|
||||
* indicating those CPUs available for scheduling.
|
||||
*
|
||||
* If HOTPLUG is enabled, then cpu_possible_mask is forced to have
|
||||
* all NR_CPUS bits set, otherwise it is just the set of CPUs that
|
||||
* ACPI reports present at boot.
|
||||
*
|
||||
* If HOTPLUG is enabled, then cpu_present_map varies dynamically,
|
||||
* If HOTPLUG is enabled, then cpu_present_mask varies dynamically,
|
||||
* depending on what ACPI reports as currently plugged in, otherwise
|
||||
* cpu_present_map is just a copy of cpu_possible_map.
|
||||
* cpu_present_mask is just a copy of cpu_possible_mask.
|
||||
*
|
||||
* (*) Well, cpu_present_map is dynamic in the hotplug case. If not
|
||||
* hotplug, it's a copy of cpu_possible_map, hence fixed at boot.
|
||||
* (*) Well, cpu_present_mask is dynamic in the hotplug case. If not
|
||||
* hotplug, it's a copy of cpu_possible_mask, hence fixed at boot.
|
||||
*
|
||||
* Subtleties:
|
||||
* 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode
|
||||
* assumption that their single CPU is online. The UP
|
||||
* cpu_{online,possible,present}_maps are placebos. Changing them
|
||||
* cpu_{online,possible,present}_masks are placebos. Changing them
|
||||
* will have no useful affect on the following num_*_cpus()
|
||||
* and cpu_*() macros in the UP case. This ugliness is a UP
|
||||
* optimization - don't waste any instructions or memory references
|
||||
* asking if you're online or how many CPUs there are if there is
|
||||
* only one CPU.
|
||||
* 2) Most SMP arch's #define some of these maps to be some
|
||||
* other map specific to that arch. Therefore, the following
|
||||
* must be #define macros, not inlines. To see why, examine
|
||||
* the assembly code produced by the following. Note that
|
||||
* set1() writes phys_x_map, but set2() writes x_map:
|
||||
* int x_map, phys_x_map;
|
||||
* #define set1(a) x_map = a
|
||||
* inline void set2(int a) { x_map = a; }
|
||||
* #define x_map phys_x_map
|
||||
* main(){ set1(3); set2(5); }
|
||||
*/
|
||||
|
||||
extern cpumask_t cpu_possible_map;
|
||||
extern cpumask_t cpu_online_map;
|
||||
extern cpumask_t cpu_present_map;
|
||||
extern cpumask_t cpu_active_map;
|
||||
extern const struct cpumask *const cpu_possible_mask;
|
||||
extern const struct cpumask *const cpu_online_mask;
|
||||
extern const struct cpumask *const cpu_present_mask;
|
||||
extern const struct cpumask *const cpu_active_mask;
|
||||
|
||||
/* These strip const, as traditionally they weren't const. */
|
||||
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
|
||||
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
|
||||
#define cpu_present_map (*(cpumask_t *)cpu_present_mask)
|
||||
#define cpu_active_map (*(cpumask_t *)cpu_active_mask)
|
||||
|
||||
#if NR_CPUS > 1
|
||||
#define num_online_cpus() cpus_weight_nr(cpu_online_map)
|
||||
#define num_possible_cpus() cpus_weight_nr(cpu_possible_map)
|
||||
#define num_present_cpus() cpus_weight_nr(cpu_present_map)
|
||||
#define cpu_online(cpu) cpu_isset((cpu), cpu_online_map)
|
||||
#define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map)
|
||||
#define cpu_present(cpu) cpu_isset((cpu), cpu_present_map)
|
||||
#define cpu_active(cpu) cpu_isset((cpu), cpu_active_map)
|
||||
#define num_online_cpus() cpumask_weight(cpu_online_mask)
|
||||
#define num_possible_cpus() cpumask_weight(cpu_possible_mask)
|
||||
#define num_present_cpus() cpumask_weight(cpu_present_mask)
|
||||
#define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask)
|
||||
#define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask)
|
||||
#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
|
||||
#define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask)
|
||||
#else
|
||||
#define num_online_cpus() 1
|
||||
#define num_possible_cpus() 1
|
||||
|
|
@ -526,10 +513,6 @@ extern cpumask_t cpu_active_map;
|
|||
|
||||
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
|
||||
|
||||
#define for_each_possible_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_possible_map)
|
||||
#define for_each_online_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_online_map)
|
||||
#define for_each_present_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_present_map)
|
||||
|
||||
/* These are the new versions of the cpumask operators: passed by pointer.
|
||||
* The older versions will be implemented in terms of these, then deleted. */
|
||||
#define cpumask_bits(maskp) ((maskp)->bits)
|
||||
|
|
@ -540,9 +523,6 @@ extern cpumask_t cpu_active_map;
|
|||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
/* This produces more efficient code. */
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
|
||||
#else /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#define CPU_BITS_ALL \
|
||||
|
|
@ -550,10 +530,16 @@ extern cpumask_t cpu_active_map;
|
|||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#endif /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
|
||||
* not all bits may be allocated. */
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#else
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
#endif
|
||||
|
||||
/* verify cpu argument to cpumask_* operators */
|
||||
static inline unsigned int cpumask_check(unsigned int cpu)
|
||||
{
|
||||
|
|
@ -714,7 +700,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
|
|||
* No static inline type checking - see Subtlety (1) above.
|
||||
*/
|
||||
#define cpumask_test_cpu(cpu, cpumask) \
|
||||
test_bit(cpumask_check(cpu), (cpumask)->bits)
|
||||
test_bit(cpumask_check(cpu), cpumask_bits((cpumask)))
|
||||
|
||||
/**
|
||||
* cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask
|
||||
|
|
@ -946,22 +932,61 @@ static inline void cpumask_copy(struct cpumask *dstp,
|
|||
#define cpumask_of(cpu) (get_cpu_mask(cpu))
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
* cpumask_scnprintf - print a cpumask into a string as comma-separated hex
|
||||
* @buf: the buffer to sprintf into
|
||||
* @len: the length of the buffer
|
||||
* @srcp: the cpumask to print
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
* If len is zero, returns zero. Otherwise returns the length of the
|
||||
* (nul-terminated) @buf string.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
static inline int cpumask_scnprintf(char *buf, int len,
|
||||
const struct cpumask *srcp)
|
||||
{
|
||||
return 1;
|
||||
return bitmap_scnprintf(buf, len, cpumask_bits(srcp), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_parse_user - extract a cpumask from a user string
|
||||
* @buf: the buffer to extract from
|
||||
* @len: the length of the buffer
|
||||
* @dstp: the cpumask to set.
|
||||
*
|
||||
* Returns -errno, or 0 for success.
|
||||
*/
|
||||
static inline int cpumask_parse_user(const char __user *buf, int len,
|
||||
struct cpumask *dstp)
|
||||
{
|
||||
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* cpulist_scnprintf - print a cpumask into a string as comma-separated list
|
||||
* @buf: the buffer to sprintf into
|
||||
* @len: the length of the buffer
|
||||
* @srcp: the cpumask to print
|
||||
*
|
||||
* If len is zero, returns zero. Otherwise returns the length of the
|
||||
* (nul-terminated) @buf string.
|
||||
*/
|
||||
static inline int cpulist_scnprintf(char *buf, int len,
|
||||
const struct cpumask *srcp)
|
||||
{
|
||||
return bitmap_scnlistprintf(buf, len, cpumask_bits(srcp),
|
||||
nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* cpulist_parse_user - extract a cpumask from a user string of ranges
|
||||
* @buf: the buffer to extract from
|
||||
* @len: the length of the buffer
|
||||
* @dstp: the cpumask to set.
|
||||
*
|
||||
* Returns -errno, or 0 for success.
|
||||
*/
|
||||
static inline int cpulist_parse(const char *buf, struct cpumask *dstp)
|
||||
{
|
||||
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -995,6 +1020,7 @@ static inline size_t cpumask_size(void)
|
|||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
typedef struct cpumask *cpumask_var_t;
|
||||
|
||||
bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);
|
||||
bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
|
||||
void alloc_bootmem_cpumask_var(cpumask_var_t *mask);
|
||||
void free_cpumask_var(cpumask_var_t mask);
|
||||
|
|
@ -1008,6 +1034,12 @@ static inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
|
|||
return true;
|
||||
}
|
||||
|
||||
static inline bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
|
||||
int node)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
|
||||
{
|
||||
}
|
||||
|
|
@ -1021,12 +1053,6 @@ static inline void free_bootmem_cpumask_var(cpumask_var_t mask)
|
|||
}
|
||||
#endif /* CONFIG_CPUMASK_OFFSTACK */
|
||||
|
||||
/* The pointer versions of the maps, these will become the primary versions. */
|
||||
#define cpu_possible_mask ((const struct cpumask *)&cpu_possible_map)
|
||||
#define cpu_online_mask ((const struct cpumask *)&cpu_online_map)
|
||||
#define cpu_present_mask ((const struct cpumask *)&cpu_present_map)
|
||||
#define cpu_active_mask ((const struct cpumask *)&cpu_active_map)
|
||||
|
||||
/* It's common to want to use cpu_all_mask in struct member initializers,
|
||||
* so it has to refer to an address rather than a pointer. */
|
||||
extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
|
||||
|
|
@ -1035,51 +1061,16 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
|
|||
/* First bits of cpu_bit_bitmap are in fact unset. */
|
||||
#define cpu_none_mask to_cpumask(cpu_bit_bitmap[0])
|
||||
|
||||
#define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask)
|
||||
#define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask)
|
||||
#define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask)
|
||||
|
||||
/* Wrappers for arch boot code to manipulate normally-constant masks */
|
||||
static inline void set_cpu_possible(unsigned int cpu, bool possible)
|
||||
{
|
||||
if (possible)
|
||||
cpumask_set_cpu(cpu, &cpu_possible_map);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, &cpu_possible_map);
|
||||
}
|
||||
|
||||
static inline void set_cpu_present(unsigned int cpu, bool present)
|
||||
{
|
||||
if (present)
|
||||
cpumask_set_cpu(cpu, &cpu_present_map);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, &cpu_present_map);
|
||||
}
|
||||
|
||||
static inline void set_cpu_online(unsigned int cpu, bool online)
|
||||
{
|
||||
if (online)
|
||||
cpumask_set_cpu(cpu, &cpu_online_map);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, &cpu_online_map);
|
||||
}
|
||||
|
||||
static inline void set_cpu_active(unsigned int cpu, bool active)
|
||||
{
|
||||
if (active)
|
||||
cpumask_set_cpu(cpu, &cpu_active_map);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, &cpu_active_map);
|
||||
}
|
||||
|
||||
static inline void init_cpu_present(const struct cpumask *src)
|
||||
{
|
||||
cpumask_copy(&cpu_present_map, src);
|
||||
}
|
||||
|
||||
static inline void init_cpu_possible(const struct cpumask *src)
|
||||
{
|
||||
cpumask_copy(&cpu_possible_map, src);
|
||||
}
|
||||
|
||||
static inline void init_cpu_online(const struct cpumask *src)
|
||||
{
|
||||
cpumask_copy(&cpu_online_map, src);
|
||||
}
|
||||
void set_cpu_possible(unsigned int cpu, bool possible);
|
||||
void set_cpu_present(unsigned int cpu, bool present);
|
||||
void set_cpu_online(unsigned int cpu, bool online);
|
||||
void set_cpu_active(unsigned int cpu, bool active);
|
||||
void init_cpu_present(const struct cpumask *src);
|
||||
void init_cpu_possible(const struct cpumask *src);
|
||||
void init_cpu_online(const struct cpumask *src);
|
||||
#endif /* __LINUX_CPUMASK_H */
|
||||
|
|
|
|||
|
|
@ -20,8 +20,9 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
|
|||
extern int cpuset_init_early(void);
|
||||
extern int cpuset_init(void);
|
||||
extern void cpuset_init_smp(void);
|
||||
extern void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask);
|
||||
extern void cpuset_cpus_allowed_locked(struct task_struct *p, cpumask_t *mask);
|
||||
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
|
||||
extern void cpuset_cpus_allowed_locked(struct task_struct *p,
|
||||
struct cpumask *mask);
|
||||
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
|
||||
#define cpuset_current_mems_allowed (current->mems_allowed)
|
||||
void cpuset_init_current_mems_allowed(void);
|
||||
|
|
@ -78,18 +79,21 @@ extern int current_cpuset_is_being_rebound(void);
|
|||
|
||||
extern void rebuild_sched_domains(void);
|
||||
|
||||
extern void cpuset_print_task_mems_allowed(struct task_struct *p);
|
||||
|
||||
#else /* !CONFIG_CPUSETS */
|
||||
|
||||
static inline int cpuset_init_early(void) { return 0; }
|
||||
static inline int cpuset_init(void) { return 0; }
|
||||
static inline void cpuset_init_smp(void) {}
|
||||
|
||||
static inline void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask)
|
||||
static inline void cpuset_cpus_allowed(struct task_struct *p,
|
||||
struct cpumask *mask)
|
||||
{
|
||||
*mask = cpu_possible_map;
|
||||
}
|
||||
static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
|
||||
cpumask_t *mask)
|
||||
struct cpumask *mask)
|
||||
{
|
||||
*mask = cpu_possible_map;
|
||||
}
|
||||
|
|
@ -159,6 +163,10 @@ static inline void rebuild_sched_domains(void)
|
|||
partition_sched_domains(1, NULL, NULL);
|
||||
}
|
||||
|
||||
static inline void cpuset_print_task_mems_allowed(struct task_struct *p)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_CPUSETS */
|
||||
|
||||
#endif /* _LINUX_CPUSET_H */
|
||||
|
|
|
|||
|
|
@ -75,14 +75,22 @@ full_name_hash(const unsigned char *name, unsigned int len)
|
|||
return end_name_hash(hash);
|
||||
}
|
||||
|
||||
struct dcookie_struct;
|
||||
|
||||
#define DNAME_INLINE_LEN_MIN 36
|
||||
/*
|
||||
* Try to keep struct dentry aligned on 64 byte cachelines (this will
|
||||
* give reasonable cacheline footprint with larger lines without the
|
||||
* large memory footprint increase).
|
||||
*/
|
||||
#ifdef CONFIG_64BIT
|
||||
#define DNAME_INLINE_LEN_MIN 32 /* 192 bytes */
|
||||
#else
|
||||
#define DNAME_INLINE_LEN_MIN 40 /* 128 bytes */
|
||||
#endif
|
||||
|
||||
struct dentry {
|
||||
atomic_t d_count;
|
||||
unsigned int d_flags; /* protected by d_lock */
|
||||
spinlock_t d_lock; /* per dentry lock */
|
||||
int d_mounted;
|
||||
struct inode *d_inode; /* Where the name belongs to - NULL is
|
||||
* negative */
|
||||
/*
|
||||
|
|
@ -107,10 +115,7 @@ struct dentry {
|
|||
struct dentry_operations *d_op;
|
||||
struct super_block *d_sb; /* The root of the dentry tree */
|
||||
void *d_fsdata; /* fs-specific data */
|
||||
#ifdef CONFIG_PROFILING
|
||||
struct dcookie_struct *d_cookie; /* cookie, if any */
|
||||
#endif
|
||||
int d_mounted;
|
||||
|
||||
unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
|
||||
};
|
||||
|
||||
|
|
@ -177,6 +182,8 @@ d_iput: no no no yes
|
|||
|
||||
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */
|
||||
|
||||
#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
|
||||
|
||||
extern spinlock_t dcache_lock;
|
||||
extern seqlock_t rename_lock;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ struct dentry *debugfs_create_x16(const char *name, mode_t mode,
|
|||
struct dentry *parent, u16 *value);
|
||||
struct dentry *debugfs_create_x32(const char *name, mode_t mode,
|
||||
struct dentry *parent, u32 *value);
|
||||
struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
|
||||
struct dentry *parent, size_t *value);
|
||||
struct dentry *debugfs_create_bool(const char *name, mode_t mode,
|
||||
struct dentry *parent, u32 *value);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
|
|||
*/
|
||||
typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
|
||||
union map_info *map_context);
|
||||
typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
|
||||
union map_info *map_context);
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
|
|
@ -57,6 +59,9 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
|
|||
typedef int (*dm_endio_fn) (struct dm_target *ti,
|
||||
struct bio *bio, int error,
|
||||
union map_info *map_context);
|
||||
typedef int (*dm_request_endio_fn) (struct dm_target *ti,
|
||||
struct request *clone, int error,
|
||||
union map_info *map_context);
|
||||
|
||||
typedef void (*dm_flush_fn) (struct dm_target *ti);
|
||||
typedef void (*dm_presuspend_fn) (struct dm_target *ti);
|
||||
|
|
@ -75,6 +80,13 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
|
|||
typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
|
||||
struct bio_vec *biovec, int max_size);
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0: The target can handle the next I/O immediately.
|
||||
* 1: The target can't handle the next I/O immediately.
|
||||
*/
|
||||
typedef int (*dm_busy_fn) (struct dm_target *ti);
|
||||
|
||||
void dm_error(const char *message);
|
||||
|
||||
/*
|
||||
|
|
@ -100,14 +112,23 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
|
|||
/*
|
||||
* Information about a target type
|
||||
*/
|
||||
|
||||
/*
|
||||
* Target features
|
||||
*/
|
||||
#define DM_TARGET_SUPPORTS_BARRIERS 0x00000001
|
||||
|
||||
struct target_type {
|
||||
uint64_t features;
|
||||
const char *name;
|
||||
struct module *module;
|
||||
unsigned version[3];
|
||||
dm_ctr_fn ctr;
|
||||
dm_dtr_fn dtr;
|
||||
dm_map_fn map;
|
||||
dm_map_request_fn map_rq;
|
||||
dm_endio_fn end_io;
|
||||
dm_request_endio_fn rq_end_io;
|
||||
dm_flush_fn flush;
|
||||
dm_presuspend_fn presuspend;
|
||||
dm_postsuspend_fn postsuspend;
|
||||
|
|
@ -117,6 +138,7 @@ struct target_type {
|
|||
dm_message_fn message;
|
||||
dm_ioctl_fn ioctl;
|
||||
dm_merge_fn merge;
|
||||
dm_busy_fn busy;
|
||||
};
|
||||
|
||||
struct io_restrictions {
|
||||
|
|
@ -157,8 +179,7 @@ struct dm_target {
|
|||
};
|
||||
|
||||
int dm_register_target(struct target_type *t);
|
||||
int dm_unregister_target(struct target_type *t);
|
||||
|
||||
void dm_unregister_target(struct target_type *t);
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* Functions for creating and manipulating mapped devices.
|
||||
|
|
@ -276,6 +297,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
|
|||
*---------------------------------------------------------------*/
|
||||
#define DM_NAME "device-mapper"
|
||||
|
||||
#define DMCRIT(f, arg...) \
|
||||
printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
|
||||
|
||||
#define DMERR(f, arg...) \
|
||||
printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
|
||||
#define DMERR_LIMIT(f, arg...) \
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ struct bus_type {
|
|||
int (*resume_early)(struct device *dev);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct pm_ext_ops *pm;
|
||||
struct dev_pm_ops *pm;
|
||||
|
||||
struct bus_type_private *p;
|
||||
};
|
||||
|
|
@ -133,7 +133,7 @@ struct device_driver {
|
|||
int (*resume) (struct device *dev);
|
||||
struct attribute_group **groups;
|
||||
|
||||
struct pm_ops *pm;
|
||||
struct dev_pm_ops *pm;
|
||||
|
||||
struct driver_private *p;
|
||||
};
|
||||
|
|
@ -198,7 +198,7 @@ struct class {
|
|||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct pm_ops *pm;
|
||||
struct dev_pm_ops *pm;
|
||||
struct class_private *p;
|
||||
};
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ struct device_type {
|
|||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct pm_ops *pm;
|
||||
struct dev_pm_ops *pm;
|
||||
};
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
|
|
@ -373,9 +373,9 @@ struct device {
|
|||
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
|
||||
unsigned uevent_suppress:1;
|
||||
const char *init_name; /* initial name of the device */
|
||||
struct device_type *type;
|
||||
unsigned uevent_suppress:1;
|
||||
|
||||
struct semaphore sem; /* semaphore to synchronize calls to
|
||||
* its driver.
|
||||
|
|
@ -408,12 +408,13 @@ struct device {
|
|||
/* arch specific additions */
|
||||
struct dev_archdata archdata;
|
||||
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
|
||||
spinlock_t devres_lock;
|
||||
struct list_head devres_head;
|
||||
|
||||
struct klist_node knode_class;
|
||||
struct class *class;
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device *dev);
|
||||
|
|
@ -482,6 +483,17 @@ 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);
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
*/
|
||||
extern struct device *__root_device_register(const char *name,
|
||||
struct module *owner);
|
||||
static inline struct device *root_device_register(const char *name)
|
||||
{
|
||||
return __root_device_register(name, THIS_MODULE);
|
||||
}
|
||||
extern void root_device_unregister(struct device *root);
|
||||
|
||||
/*
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
|
|
@ -553,13 +565,13 @@ extern const char *dev_driver_string(const struct device *dev);
|
|||
#define dev_info(dev, format, arg...) \
|
||||
dev_printk(KERN_INFO , dev , format , ## arg)
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
|
||||
#if defined(DEBUG)
|
||||
#define dev_dbg(dev, format, arg...) \
|
||||
dev_printk(KERN_DEBUG , dev , format , ## arg)
|
||||
#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
|
||||
#define dev_dbg(dev, format, ...) do { \
|
||||
dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#elif defined(DEBUG)
|
||||
#define dev_dbg(dev, format, arg...) \
|
||||
dev_printk(KERN_DEBUG , dev , format , ## arg)
|
||||
#else
|
||||
#define dev_dbg(dev, format, arg...) \
|
||||
({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ struct dio_driver {
|
|||
|
||||
extern int dio_find(int deviceid);
|
||||
extern unsigned long dio_scodetophysaddr(int scode);
|
||||
extern void dio_create_sysfs_dev_files(struct dio_dev *);
|
||||
extern int dio_create_sysfs_dev_files(struct dio_dev *);
|
||||
|
||||
/* New-style probing */
|
||||
extern int dio_register_driver(struct dio_driver *);
|
||||
|
|
|
|||
|
|
@ -9,148 +9,24 @@
|
|||
#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
|
||||
#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
|
||||
|
||||
#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT)
|
||||
#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK)
|
||||
#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK)
|
||||
|
||||
|
||||
/*
|
||||
* 0: Present
|
||||
* 1-11: Reserved
|
||||
* 12-63: Context Ptr (12 - (haw-1))
|
||||
* 64-127: Reserved
|
||||
*/
|
||||
struct root_entry {
|
||||
u64 val;
|
||||
u64 rsvd1;
|
||||
};
|
||||
#define ROOT_ENTRY_NR (VTD_PAGE_SIZE/sizeof(struct root_entry))
|
||||
static inline bool root_present(struct root_entry *root)
|
||||
{
|
||||
return (root->val & 1);
|
||||
}
|
||||
static inline void set_root_present(struct root_entry *root)
|
||||
{
|
||||
root->val |= 1;
|
||||
}
|
||||
static inline void set_root_value(struct root_entry *root, unsigned long value)
|
||||
{
|
||||
root->val |= value & VTD_PAGE_MASK;
|
||||
}
|
||||
|
||||
struct context_entry;
|
||||
static inline struct context_entry *
|
||||
get_context_addr_from_root(struct root_entry *root)
|
||||
{
|
||||
return (struct context_entry *)
|
||||
(root_present(root)?phys_to_virt(
|
||||
root->val & VTD_PAGE_MASK) :
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* low 64 bits:
|
||||
* 0: present
|
||||
* 1: fault processing disable
|
||||
* 2-3: translation type
|
||||
* 12-63: address space root
|
||||
* high 64 bits:
|
||||
* 0-2: address width
|
||||
* 3-6: aval
|
||||
* 8-23: domain id
|
||||
*/
|
||||
struct context_entry {
|
||||
u64 lo;
|
||||
u64 hi;
|
||||
};
|
||||
#define context_present(c) ((c).lo & 1)
|
||||
#define context_fault_disable(c) (((c).lo >> 1) & 1)
|
||||
#define context_translation_type(c) (((c).lo >> 2) & 3)
|
||||
#define context_address_root(c) ((c).lo & VTD_PAGE_MASK)
|
||||
#define context_address_width(c) ((c).hi & 7)
|
||||
#define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1))
|
||||
|
||||
#define context_set_present(c) do {(c).lo |= 1;} while (0)
|
||||
#define context_set_fault_enable(c) \
|
||||
do {(c).lo &= (((u64)-1) << 2) | 1;} while (0)
|
||||
#define context_set_translation_type(c, val) \
|
||||
do { \
|
||||
(c).lo &= (((u64)-1) << 4) | 3; \
|
||||
(c).lo |= ((val) & 3) << 2; \
|
||||
} while (0)
|
||||
#define CONTEXT_TT_MULTI_LEVEL 0
|
||||
#define context_set_address_root(c, val) \
|
||||
do {(c).lo |= (val) & VTD_PAGE_MASK; } while (0)
|
||||
#define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0)
|
||||
#define context_set_domain_id(c, val) \
|
||||
do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0)
|
||||
#define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0)
|
||||
|
||||
/*
|
||||
* 0: readable
|
||||
* 1: writable
|
||||
* 2-6: reserved
|
||||
* 7: super page
|
||||
* 8-11: available
|
||||
* 12-63: Host physcial address
|
||||
*/
|
||||
struct dma_pte {
|
||||
u64 val;
|
||||
};
|
||||
#define dma_clear_pte(p) do {(p).val = 0;} while (0)
|
||||
|
||||
#define DMA_PTE_READ (1)
|
||||
#define DMA_PTE_WRITE (2)
|
||||
|
||||
#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0)
|
||||
#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0)
|
||||
#define dma_set_pte_prot(p, prot) \
|
||||
do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
|
||||
#define dma_pte_addr(p) ((p).val & VTD_PAGE_MASK)
|
||||
#define dma_set_pte_addr(p, addr) do {\
|
||||
(p).val |= ((addr) & VTD_PAGE_MASK); } while (0)
|
||||
#define dma_pte_present(p) (((p).val & 3) != 0)
|
||||
|
||||
struct intel_iommu;
|
||||
struct dmar_domain;
|
||||
struct root_entry;
|
||||
|
||||
struct dmar_domain {
|
||||
int id; /* domain id */
|
||||
struct intel_iommu *iommu; /* back pointer to owning iommu */
|
||||
|
||||
struct list_head devices; /* all devices' list */
|
||||
struct iova_domain iovad; /* iova's that belong to this domain */
|
||||
|
||||
struct dma_pte *pgd; /* virtual address */
|
||||
spinlock_t mapping_lock; /* page table lock */
|
||||
int gaw; /* max guest address width */
|
||||
|
||||
/* adjusted guest address width, 0 is level 2 30-bit */
|
||||
int agaw;
|
||||
|
||||
#define DOMAIN_FLAG_MULTIPLE_DEVICES 1
|
||||
int flags;
|
||||
};
|
||||
|
||||
/* PCI domain-device relationship */
|
||||
struct device_domain_info {
|
||||
struct list_head link; /* link to domain siblings */
|
||||
struct list_head global; /* link to global list */
|
||||
u8 bus; /* PCI bus numer */
|
||||
u8 devfn; /* PCI devfn number */
|
||||
struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */
|
||||
struct dmar_domain *domain; /* pointer to domain */
|
||||
};
|
||||
|
||||
extern int init_dmars(void);
|
||||
extern void free_dmar_iommu(struct intel_iommu *iommu);
|
||||
|
||||
#ifdef CONFIG_DMAR
|
||||
extern int iommu_calculate_agaw(struct intel_iommu *iommu);
|
||||
#else
|
||||
static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int dmar_disabled;
|
||||
|
||||
#ifndef CONFIG_DMAR_GFX_WA
|
||||
static inline void iommu_prepare_gfx_mapping(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DMAR_GFX_WA */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,32 +28,6 @@
|
|||
#include <linux/rcupdate.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
/**
|
||||
* enum dma_state - resource PNP/power management state
|
||||
* @DMA_RESOURCE_SUSPEND: DMA device going into low power state
|
||||
* @DMA_RESOURCE_RESUME: DMA device returning to full power
|
||||
* @DMA_RESOURCE_AVAILABLE: DMA device available to the system
|
||||
* @DMA_RESOURCE_REMOVED: DMA device removed from the system
|
||||
*/
|
||||
enum dma_state {
|
||||
DMA_RESOURCE_SUSPEND,
|
||||
DMA_RESOURCE_RESUME,
|
||||
DMA_RESOURCE_AVAILABLE,
|
||||
DMA_RESOURCE_REMOVED,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dma_state_client - state of the channel in the client
|
||||
* @DMA_ACK: client would like to use, or was using this channel
|
||||
* @DMA_DUP: client has already seen this channel, or is not using this channel
|
||||
* @DMA_NAK: client does not want to see any more channels
|
||||
*/
|
||||
enum dma_state_client {
|
||||
DMA_ACK,
|
||||
DMA_DUP,
|
||||
DMA_NAK,
|
||||
};
|
||||
|
||||
/**
|
||||
* typedef dma_cookie_t - an opaque DMA cookie
|
||||
*
|
||||
|
|
@ -89,23 +63,13 @@ enum dma_transaction_type {
|
|||
DMA_MEMSET,
|
||||
DMA_MEMCPY_CRC32C,
|
||||
DMA_INTERRUPT,
|
||||
DMA_PRIVATE,
|
||||
DMA_SLAVE,
|
||||
};
|
||||
|
||||
/* last transaction type for creation of the capabilities mask */
|
||||
#define DMA_TX_TYPE_END (DMA_SLAVE + 1)
|
||||
|
||||
/**
|
||||
* enum dma_slave_width - DMA slave register access width.
|
||||
* @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses
|
||||
* @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses
|
||||
* @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses
|
||||
*/
|
||||
enum dma_slave_width {
|
||||
DMA_SLAVE_WIDTH_8BIT,
|
||||
DMA_SLAVE_WIDTH_16BIT,
|
||||
DMA_SLAVE_WIDTH_32BIT,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dma_ctrl_flags - DMA flags to augment operation preparation,
|
||||
|
|
@ -131,32 +95,6 @@ enum dma_ctrl_flags {
|
|||
*/
|
||||
typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t;
|
||||
|
||||
/**
|
||||
* struct dma_slave - Information about a DMA slave
|
||||
* @dev: device acting as DMA slave
|
||||
* @dma_dev: required DMA master device. If non-NULL, the client can not be
|
||||
* bound to other masters than this.
|
||||
* @tx_reg: physical address of data register used for
|
||||
* memory-to-peripheral transfers
|
||||
* @rx_reg: physical address of data register used for
|
||||
* peripheral-to-memory transfers
|
||||
* @reg_width: peripheral register width
|
||||
*
|
||||
* If dma_dev is non-NULL, the client can not be bound to other DMA
|
||||
* masters than the one corresponding to this device. The DMA master
|
||||
* driver may use this to determine if there is controller-specific
|
||||
* data wrapped around this struct. Drivers of platform code that sets
|
||||
* the dma_dev field must therefore make sure to use an appropriate
|
||||
* controller-specific dma slave structure wrapping this struct.
|
||||
*/
|
||||
struct dma_slave {
|
||||
struct device *dev;
|
||||
struct device *dma_dev;
|
||||
dma_addr_t tx_reg;
|
||||
dma_addr_t rx_reg;
|
||||
enum dma_slave_width reg_width;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dma_chan_percpu - the per-CPU part of struct dma_chan
|
||||
* @refcount: local_t used for open-coded "bigref" counting
|
||||
|
|
@ -165,7 +103,6 @@ struct dma_slave {
|
|||
*/
|
||||
|
||||
struct dma_chan_percpu {
|
||||
local_t refcount;
|
||||
/* stats */
|
||||
unsigned long memcpy_count;
|
||||
unsigned long bytes_transferred;
|
||||
|
|
@ -176,13 +113,14 @@ struct dma_chan_percpu {
|
|||
* @device: ptr to the dma device who supplies this channel, always !%NULL
|
||||
* @cookie: last cookie value returned to client
|
||||
* @chan_id: channel ID for sysfs
|
||||
* @class_dev: class device for sysfs
|
||||
* @dev: class device for sysfs
|
||||
* @refcount: kref, used in "bigref" slow-mode
|
||||
* @slow_ref: indicates that the DMA channel is free
|
||||
* @rcu: the DMA channel's RCU head
|
||||
* @device_node: used to add this to the device chan list
|
||||
* @local: per-cpu pointer to a struct dma_chan_percpu
|
||||
* @client-count: how many clients are using this channel
|
||||
* @table_count: number of appearances in the mem-to-mem allocation table
|
||||
*/
|
||||
struct dma_chan {
|
||||
struct dma_device *device;
|
||||
|
|
@ -190,73 +128,47 @@ struct dma_chan {
|
|||
|
||||
/* sysfs */
|
||||
int chan_id;
|
||||
struct device dev;
|
||||
|
||||
struct kref refcount;
|
||||
int slow_ref;
|
||||
struct rcu_head rcu;
|
||||
struct dma_chan_dev *dev;
|
||||
|
||||
struct list_head device_node;
|
||||
struct dma_chan_percpu *local;
|
||||
int client_count;
|
||||
int table_count;
|
||||
};
|
||||
|
||||
#define to_dma_chan(p) container_of(p, struct dma_chan, dev)
|
||||
/**
|
||||
* struct dma_chan_dev - relate sysfs device node to backing channel device
|
||||
* @chan - driver channel device
|
||||
* @device - sysfs device
|
||||
* @dev_id - parent dma_device dev_id
|
||||
* @idr_ref - reference count to gate release of dma_device dev_id
|
||||
*/
|
||||
struct dma_chan_dev {
|
||||
struct dma_chan *chan;
|
||||
struct device device;
|
||||
int dev_id;
|
||||
atomic_t *idr_ref;
|
||||
};
|
||||
|
||||
static inline const char *dma_chan_name(struct dma_chan *chan)
|
||||
{
|
||||
return dev_name(&chan->dev->device);
|
||||
}
|
||||
|
||||
void dma_chan_cleanup(struct kref *kref);
|
||||
|
||||
static inline void dma_chan_get(struct dma_chan *chan)
|
||||
{
|
||||
if (unlikely(chan->slow_ref))
|
||||
kref_get(&chan->refcount);
|
||||
else {
|
||||
local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
|
||||
put_cpu();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void dma_chan_put(struct dma_chan *chan)
|
||||
{
|
||||
if (unlikely(chan->slow_ref))
|
||||
kref_put(&chan->refcount, dma_chan_cleanup);
|
||||
else {
|
||||
local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
|
||||
put_cpu();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* typedef dma_event_callback - function pointer to a DMA event callback
|
||||
* For each channel added to the system this routine is called for each client.
|
||||
* If the client would like to use the channel it returns '1' to signal (ack)
|
||||
* the dmaengine core to take out a reference on the channel and its
|
||||
* corresponding device. A client must not 'ack' an available channel more
|
||||
* than once. When a channel is removed all clients are notified. If a client
|
||||
* is using the channel it must 'ack' the removal. A client must not 'ack' a
|
||||
* removed channel more than once.
|
||||
* @client - 'this' pointer for the client context
|
||||
* @chan - channel to be acted upon
|
||||
* @state - available or removed
|
||||
*/
|
||||
struct dma_client;
|
||||
typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client,
|
||||
struct dma_chan *chan, enum dma_state state);
|
||||
|
||||
/**
|
||||
* struct dma_client - info on the entity making use of DMA services
|
||||
* @event_callback: func ptr to call when something happens
|
||||
* @cap_mask: only return channels that satisfy the requested capabilities
|
||||
* a value of zero corresponds to any capability
|
||||
* @slave: data for preparing slave transfer. Must be non-NULL iff the
|
||||
* DMA_SLAVE capability is requested.
|
||||
* @global_node: list_head for global dma_client_list
|
||||
* typedef dma_filter_fn - callback filter for dma_request_channel
|
||||
* @chan: channel to be reviewed
|
||||
* @filter_param: opaque parameter passed through dma_request_channel
|
||||
*
|
||||
* When this optional parameter is specified in a call to dma_request_channel a
|
||||
* suitable channel is passed to this routine for further dispositioning before
|
||||
* being returned. Where 'suitable' indicates a non-busy channel that
|
||||
* satisfies the given capability mask. It returns 'true' to indicate that the
|
||||
* channel is suitable.
|
||||
*/
|
||||
struct dma_client {
|
||||
dma_event_callback event_callback;
|
||||
dma_cap_mask_t cap_mask;
|
||||
struct dma_slave *slave;
|
||||
struct list_head global_node;
|
||||
};
|
||||
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
|
||||
|
||||
typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
||||
/**
|
||||
|
|
@ -323,14 +235,10 @@ struct dma_device {
|
|||
dma_cap_mask_t cap_mask;
|
||||
int max_xor;
|
||||
|
||||
struct kref refcount;
|
||||
struct completion done;
|
||||
|
||||
int dev_id;
|
||||
struct device *dev;
|
||||
|
||||
int (*device_alloc_chan_resources)(struct dma_chan *chan,
|
||||
struct dma_client *client);
|
||||
int (*device_alloc_chan_resources)(struct dma_chan *chan);
|
||||
void (*device_free_chan_resources)(struct dma_chan *chan);
|
||||
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
|
||||
|
|
@ -362,9 +270,18 @@ struct dma_device {
|
|||
|
||||
/* --- public DMA engine API --- */
|
||||
|
||||
void dma_async_client_register(struct dma_client *client);
|
||||
void dma_async_client_unregister(struct dma_client *client);
|
||||
void dma_async_client_chan_request(struct dma_client *client);
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
void dmaengine_get(void);
|
||||
void dmaengine_put(void);
|
||||
#else
|
||||
static inline void dmaengine_get(void)
|
||||
{
|
||||
}
|
||||
static inline void dmaengine_put(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
|
||||
void *dest, void *src, size_t len);
|
||||
dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
|
||||
|
|
@ -406,6 +323,12 @@ __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp)
|
|||
set_bit(tx_type, dstp->bits);
|
||||
}
|
||||
|
||||
#define dma_cap_zero(mask) __dma_cap_zero(&(mask))
|
||||
static inline void __dma_cap_zero(dma_cap_mask_t *dstp)
|
||||
{
|
||||
bitmap_zero(dstp->bits, DMA_TX_TYPE_END);
|
||||
}
|
||||
|
||||
#define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask))
|
||||
static inline int
|
||||
__dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp)
|
||||
|
|
@ -475,11 +398,25 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
|
|||
}
|
||||
|
||||
enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
|
||||
#else
|
||||
static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
return DMA_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --- DMA device --- */
|
||||
|
||||
int dma_async_device_register(struct dma_device *device);
|
||||
void dma_async_device_unregister(struct dma_device *device);
|
||||
void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
|
||||
struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
|
||||
void dma_issue_pending_all(void);
|
||||
#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
|
||||
struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
|
||||
void dma_release_channel(struct dma_chan *chan);
|
||||
|
||||
/* --- Helper iov-locking functions --- */
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ struct dmar_rmrr_unit {
|
|||
list_for_each_entry(rmrr, &dmar_rmrr_units, list)
|
||||
/* Intel DMAR initialization functions */
|
||||
extern int intel_iommu_init(void);
|
||||
extern int dmar_disabled;
|
||||
#else
|
||||
static inline int intel_iommu_init(void)
|
||||
{
|
||||
|
|
|
|||
56
include/linux/dqblk_qtree.h
Normal file
56
include/linux/dqblk_qtree.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Definitions of structures and functions for quota formats using trie
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_DQBLK_QTREE_H
|
||||
#define _LINUX_DQBLK_QTREE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Numbers of blocks needed for updates - we count with the smallest
|
||||
* possible block size (1024) */
|
||||
#define QTREE_INIT_ALLOC 4
|
||||
#define QTREE_INIT_REWRITE 2
|
||||
#define QTREE_DEL_ALLOC 0
|
||||
#define QTREE_DEL_REWRITE 6
|
||||
|
||||
struct dquot;
|
||||
|
||||
/* Operations */
|
||||
struct qtree_fmt_operations {
|
||||
void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */
|
||||
void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */
|
||||
int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */
|
||||
};
|
||||
|
||||
/* Inmemory copy of version specific information */
|
||||
struct qtree_mem_dqinfo {
|
||||
struct super_block *dqi_sb; /* Sb quota is on */
|
||||
int dqi_type; /* Quota type */
|
||||
unsigned int dqi_blocks; /* # of blocks in quota file */
|
||||
unsigned int dqi_free_blk; /* First block in list of free blocks */
|
||||
unsigned int dqi_free_entry; /* First block with free entry */
|
||||
unsigned int dqi_blocksize_bits; /* Block size of quota file */
|
||||
unsigned int dqi_entry_size; /* Size of quota entry in quota file */
|
||||
unsigned int dqi_usable_bs; /* Space usable in block for quota data */
|
||||
unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */
|
||||
struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */
|
||||
};
|
||||
|
||||
int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
||||
int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
||||
int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
||||
int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
||||
int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
|
||||
static inline int qtree_depth(struct qtree_mem_dqinfo *info)
|
||||
{
|
||||
unsigned int epb = info->dqi_usable_bs >> 2;
|
||||
unsigned long long entries = epb;
|
||||
int i;
|
||||
|
||||
for (i = 1; entries < (1ULL << 32); i++)
|
||||
entries *= epb;
|
||||
return i;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_DQBLK_QTREE_H */
|
||||
|
|
@ -5,9 +5,6 @@
|
|||
#ifndef _LINUX_DQBLK_V1_H
|
||||
#define _LINUX_DQBLK_V1_H
|
||||
|
||||
/* Id of quota format */
|
||||
#define QFMT_VFS_OLD 1
|
||||
|
||||
/* Root squash turned on */
|
||||
#define V1_DQF_RSQUASH 1
|
||||
|
||||
|
|
@ -17,8 +14,4 @@
|
|||
#define V1_DEL_ALLOC 0
|
||||
#define V1_DEL_REWRITE 2
|
||||
|
||||
/* Special information about quotafile */
|
||||
struct v1_mem_dqinfo {
|
||||
};
|
||||
|
||||
#endif /* _LINUX_DQBLK_V1_H */
|
||||
|
|
|
|||
|
|
@ -1,26 +1,16 @@
|
|||
/*
|
||||
* Definitions of structures for vfsv0 quota format
|
||||
* Definitions for vfsv0 quota format
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_DQBLK_V2_H
|
||||
#define _LINUX_DQBLK_V2_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* id numbers of quota format */
|
||||
#define QFMT_VFS_V0 2
|
||||
#include <linux/dqblk_qtree.h>
|
||||
|
||||
/* Numbers of blocks needed for updates */
|
||||
#define V2_INIT_ALLOC 4
|
||||
#define V2_INIT_REWRITE 2
|
||||
#define V2_DEL_ALLOC 0
|
||||
#define V2_DEL_REWRITE 6
|
||||
|
||||
/* Inmemory copy of version specific information */
|
||||
struct v2_mem_dqinfo {
|
||||
unsigned int dqi_blocks;
|
||||
unsigned int dqi_free_blk;
|
||||
unsigned int dqi_free_entry;
|
||||
};
|
||||
#define V2_INIT_ALLOC QTREE_INIT_ALLOC
|
||||
#define V2_INIT_REWRITE QTREE_INIT_REWRITE
|
||||
#define V2_DEL_ALLOC QTREE_DEL_ALLOC
|
||||
#define V2_DEL_REWRITE QTREE_DEL_REWRITE
|
||||
|
||||
#endif /* _LINUX_DQBLK_V2_H */
|
||||
|
|
|
|||
|
|
@ -62,10 +62,11 @@ typedef enum fe_caps {
|
|||
FE_CAN_HIERARCHY_AUTO = 0x100000,
|
||||
FE_CAN_8VSB = 0x200000,
|
||||
FE_CAN_16VSB = 0x400000,
|
||||
FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this.
|
||||
FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
|
||||
FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
|
||||
FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output
|
||||
FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
|
||||
FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
|
||||
FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
|
||||
FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */
|
||||
FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */
|
||||
} fe_caps_t;
|
||||
|
||||
|
||||
|
|
@ -121,15 +122,15 @@ typedef enum fe_sec_mini_cmd {
|
|||
|
||||
|
||||
typedef enum fe_status {
|
||||
FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
|
||||
FE_HAS_CARRIER = 0x02, /* found a DVB signal */
|
||||
FE_HAS_VITERBI = 0x04, /* FEC is stable */
|
||||
FE_HAS_SYNC = 0x08, /* found sync bytes */
|
||||
FE_HAS_LOCK = 0x10, /* everything's working... */
|
||||
FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
|
||||
FE_REINIT = 0x40 /* frontend was reinitialized, */
|
||||
} fe_status_t; /* application is recommended to reset */
|
||||
/* DiSEqC, tone and parameters */
|
||||
FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
|
||||
FE_HAS_CARRIER = 0x02, /* found a DVB signal */
|
||||
FE_HAS_VITERBI = 0x04, /* FEC is stable */
|
||||
FE_HAS_SYNC = 0x08, /* found sync bytes */
|
||||
FE_HAS_LOCK = 0x10, /* everything's working... */
|
||||
FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
|
||||
FE_REINIT = 0x40 /* frontend was reinitialized, */
|
||||
} fe_status_t; /* application is recommended to reset */
|
||||
/* DiSEqC, tone and parameters */
|
||||
|
||||
typedef enum fe_spectral_inversion {
|
||||
INVERSION_OFF,
|
||||
|
|
|
|||
|
|
@ -21,15 +21,35 @@ struct dw_dma_platform_data {
|
|||
unsigned int nr_channels;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dw_dma_slave_width - DMA slave register access width.
|
||||
* @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses
|
||||
* @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses
|
||||
* @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses
|
||||
*/
|
||||
enum dw_dma_slave_width {
|
||||
DW_DMA_SLAVE_WIDTH_8BIT,
|
||||
DW_DMA_SLAVE_WIDTH_16BIT,
|
||||
DW_DMA_SLAVE_WIDTH_32BIT,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dw_dma_slave - Controller-specific information about a slave
|
||||
* @slave: Generic information about the slave
|
||||
* @ctl_lo: Platform-specific initializer for the CTL_LO register
|
||||
*
|
||||
* @dma_dev: required DMA master device
|
||||
* @tx_reg: physical address of data register used for
|
||||
* memory-to-peripheral transfers
|
||||
* @rx_reg: physical address of data register used for
|
||||
* peripheral-to-memory transfers
|
||||
* @reg_width: peripheral register width
|
||||
* @cfg_hi: Platform-specific initializer for the CFG_HI register
|
||||
* @cfg_lo: Platform-specific initializer for the CFG_LO register
|
||||
*/
|
||||
struct dw_dma_slave {
|
||||
struct dma_slave slave;
|
||||
struct device *dma_dev;
|
||||
dma_addr_t tx_reg;
|
||||
dma_addr_t rx_reg;
|
||||
enum dw_dma_slave_width reg_width;
|
||||
u32 cfg_hi;
|
||||
u32 cfg_lo;
|
||||
};
|
||||
|
|
@ -54,9 +74,4 @@ struct dw_dma_slave {
|
|||
#define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */
|
||||
#define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */
|
||||
|
||||
static inline struct dw_dma_slave *to_dw_dma_slave(struct dma_slave *slave)
|
||||
{
|
||||
return container_of(slave, struct dw_dma_slave, slave);
|
||||
}
|
||||
|
||||
#endif /* DW_DMAC_H */
|
||||
|
|
|
|||
|
|
@ -194,6 +194,30 @@ struct ext2_group_desc
|
|||
#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
|
||||
#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
|
||||
|
||||
/* Flags that should be inherited by new inodes from their parent. */
|
||||
#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
|
||||
EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\
|
||||
EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\
|
||||
EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
|
||||
EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)
|
||||
|
||||
/* Flags that are appropriate for regular files (all but dir-specific ones). */
|
||||
#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL))
|
||||
|
||||
/* Flags that are appropriate for non-directories/regular files. */
|
||||
#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL)
|
||||
|
||||
/* Mask out flags that are inappropriate for the given type of inode. */
|
||||
static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags)
|
||||
{
|
||||
if (S_ISDIR(mode))
|
||||
return flags;
|
||||
else if (S_ISREG(mode))
|
||||
return flags & EXT2_REG_FLMASK;
|
||||
else
|
||||
return flags & EXT2_OTHER_FLMASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* ioctl commands
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -101,11 +101,17 @@ struct ext2_sb_info {
|
|||
struct percpu_counter s_freeblocks_counter;
|
||||
struct percpu_counter s_freeinodes_counter;
|
||||
struct percpu_counter s_dirs_counter;
|
||||
struct blockgroup_lock s_blockgroup_lock;
|
||||
struct blockgroup_lock *s_blockgroup_lock;
|
||||
/* root of the per fs reservation window tree */
|
||||
spinlock_t s_rsv_window_lock;
|
||||
struct rb_root s_rsv_window_root;
|
||||
struct ext2_reserve_window_node s_rsv_window_head;
|
||||
};
|
||||
|
||||
static inline spinlock_t *
|
||||
sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group)
|
||||
{
|
||||
return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_EXT2_FS_SB */
|
||||
|
|
|
|||
|
|
@ -178,6 +178,30 @@ struct ext3_group_desc
|
|||
#define EXT3_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
|
||||
#define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
|
||||
|
||||
/* Flags that should be inherited by new inodes from their parent. */
|
||||
#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\
|
||||
EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\
|
||||
EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\
|
||||
EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
|
||||
EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
|
||||
|
||||
/* Flags that are appropriate for regular files (all but dir-specific ones). */
|
||||
#define EXT3_REG_FLMASK (~(EXT3_DIRSYNC_FL | EXT3_TOPDIR_FL))
|
||||
|
||||
/* Flags that are appropriate for non-directories/regular files. */
|
||||
#define EXT3_OTHER_FLMASK (EXT3_NODUMP_FL | EXT3_NOATIME_FL)
|
||||
|
||||
/* Mask out flags that are inappropriate for the given type of inode. */
|
||||
static inline __u32 ext3_mask_flags(umode_t mode, __u32 flags)
|
||||
{
|
||||
if (S_ISDIR(mode))
|
||||
return flags;
|
||||
else if (S_ISREG(mode))
|
||||
return flags & EXT3_REG_FLMASK;
|
||||
else
|
||||
return flags & EXT3_OTHER_FLMASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inode dynamic state flags
|
||||
*/
|
||||
|
|
@ -353,6 +377,13 @@ struct ext3_inode {
|
|||
#define EXT3_ERROR_FS 0x0002 /* Errors detected */
|
||||
#define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */
|
||||
|
||||
/*
|
||||
* Misc. filesystem flags
|
||||
*/
|
||||
#define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */
|
||||
#define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */
|
||||
#define EXT2_FLAGS_TEST_FILESYS 0x0004 /* to test development code */
|
||||
|
||||
/*
|
||||
* Mount flags
|
||||
*/
|
||||
|
|
@ -489,7 +520,23 @@ struct ext3_super_block {
|
|||
__u16 s_reserved_word_pad;
|
||||
__le32 s_default_mount_opts;
|
||||
__le32 s_first_meta_bg; /* First metablock block group */
|
||||
__u32 s_reserved[190]; /* Padding to the end of the block */
|
||||
__le32 s_mkfs_time; /* When the filesystem was created */
|
||||
__le32 s_jnl_blocks[17]; /* Backup of the journal inode */
|
||||
/* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */
|
||||
/*150*/ __le32 s_blocks_count_hi; /* Blocks count */
|
||||
__le32 s_r_blocks_count_hi; /* Reserved blocks count */
|
||||
__le32 s_free_blocks_count_hi; /* Free blocks count */
|
||||
__le16 s_min_extra_isize; /* All inodes have at least # bytes */
|
||||
__le16 s_want_extra_isize; /* New inodes should reserve # bytes */
|
||||
__le32 s_flags; /* Miscellaneous flags */
|
||||
__le16 s_raid_stride; /* RAID stride */
|
||||
__le16 s_mmp_interval; /* # seconds to wait in MMP checking */
|
||||
__le64 s_mmp_block; /* Block for multi-mount protection */
|
||||
__le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/
|
||||
__u8 s_log_groups_per_flex; /* FLEX_BG group size */
|
||||
__u8 s_reserved_char_pad2;
|
||||
__le16 s_reserved_pad;
|
||||
__u32 s_reserved[162]; /* Padding to the end of the block */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
|
@ -694,6 +741,9 @@ static inline __le16 ext3_rec_len_to_disk(unsigned len)
|
|||
#define DX_HASH_LEGACY 0
|
||||
#define DX_HASH_HALF_MD4 1
|
||||
#define DX_HASH_TEA 2
|
||||
#define DX_HASH_LEGACY_UNSIGNED 3
|
||||
#define DX_HASH_HALF_MD4_UNSIGNED 4
|
||||
#define DX_HASH_TEA_UNSIGNED 5
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
|
|||
|
|
@ -57,10 +57,11 @@ struct ext3_sb_info {
|
|||
u32 s_next_generation;
|
||||
u32 s_hash_seed[4];
|
||||
int s_def_hash_version;
|
||||
int s_hash_unsigned; /* 3 if hash should be signed, 0 if not */
|
||||
struct percpu_counter s_freeblocks_counter;
|
||||
struct percpu_counter s_freeinodes_counter;
|
||||
struct percpu_counter s_dirs_counter;
|
||||
struct blockgroup_lock s_blockgroup_lock;
|
||||
struct blockgroup_lock *s_blockgroup_lock;
|
||||
|
||||
/* root of the per fs reservation window tree */
|
||||
spinlock_t s_rsv_window_lock;
|
||||
|
|
@ -83,4 +84,10 @@ struct ext3_sb_info {
|
|||
#endif
|
||||
};
|
||||
|
||||
static inline spinlock_t *
|
||||
sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group)
|
||||
{
|
||||
return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_EXT3_FS_SB */
|
||||
|
|
|
|||
|
|
@ -57,8 +57,6 @@ struct files_struct {
|
|||
|
||||
#define files_fdtable(files) (rcu_dereference((files)->fdt))
|
||||
|
||||
extern struct kmem_cache *filp_cachep;
|
||||
|
||||
struct file_operations;
|
||||
struct vfsmount;
|
||||
struct dentry;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
/* Fixed constants first: */
|
||||
#undef NR_OPEN
|
||||
extern int sysctl_nr_open;
|
||||
#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
|
||||
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
|
|
@ -38,21 +37,13 @@ struct files_stat_struct {
|
|||
int nr_free_files; /* read only */
|
||||
int max_files; /* tunable */
|
||||
};
|
||||
extern struct files_stat_struct files_stat;
|
||||
extern int get_max_files(void);
|
||||
|
||||
struct inodes_stat_t {
|
||||
int nr_inodes;
|
||||
int nr_unused;
|
||||
int dummy[5]; /* padding for sysctl ABI compatibility */
|
||||
};
|
||||
extern struct inodes_stat_t inodes_stat;
|
||||
|
||||
extern int leases_enable, lease_break_time;
|
||||
|
||||
#ifdef CONFIG_DNOTIFY
|
||||
extern int dir_notify_enable;
|
||||
#endif
|
||||
|
||||
#define NR_FILE 8192 /* this can well be larger on a larger system */
|
||||
|
||||
|
|
@ -243,6 +234,8 @@ extern int dir_notify_enable;
|
|||
#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
|
||||
#define FIBMAP _IO(0x00,1) /* bmap access */
|
||||
#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
|
||||
#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
|
||||
#define FITHAW _IOWR('X', 120, int) /* Thaw */
|
||||
|
||||
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
|
|
@ -330,6 +323,15 @@ extern void __init inode_init(void);
|
|||
extern void __init inode_init_early(void);
|
||||
extern void __init files_init(unsigned long);
|
||||
|
||||
extern struct files_stat_struct files_stat;
|
||||
extern int get_max_files(void);
|
||||
extern int sysctl_nr_open;
|
||||
extern struct inodes_stat_t inodes_stat;
|
||||
extern int leases_enable, lease_break_time;
|
||||
#ifdef CONFIG_DNOTIFY
|
||||
extern int dir_notify_enable;
|
||||
#endif
|
||||
|
||||
struct buffer_head;
|
||||
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
|
||||
struct buffer_head *bh_result, int create);
|
||||
|
|
@ -423,6 +425,9 @@ enum positive_aop_returns {
|
|||
|
||||
#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */
|
||||
#define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */
|
||||
#define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct
|
||||
* helper code (eg buffer layer)
|
||||
* to clear GFP_FS from alloc */
|
||||
|
||||
/*
|
||||
* oh the beauties of C type declarations.
|
||||
|
|
@ -562,6 +567,7 @@ struct address_space {
|
|||
struct block_device {
|
||||
dev_t bd_dev; /* not a kdev_t - it's a search key */
|
||||
struct inode * bd_inode; /* will die */
|
||||
struct super_block * bd_super;
|
||||
int bd_openers;
|
||||
struct mutex bd_mutex; /* open/close mutex */
|
||||
struct semaphore bd_mount_sem;
|
||||
|
|
@ -587,6 +593,11 @@ struct block_device {
|
|||
* care to not mess up bd_private for that case.
|
||||
*/
|
||||
unsigned long bd_private;
|
||||
|
||||
/* The counter of freeze processes */
|
||||
int bd_fsfreeze_count;
|
||||
/* Mutex for freeze */
|
||||
struct mutex bd_fsfreeze_mutex;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -1130,7 +1141,6 @@ struct super_block {
|
|||
struct rw_semaphore s_umount;
|
||||
struct mutex s_lock;
|
||||
int s_count;
|
||||
int s_syncing;
|
||||
int s_need_sync_fs;
|
||||
atomic_t s_active;
|
||||
#ifdef CONFIG_SECURITY
|
||||
|
|
@ -1182,6 +1192,11 @@ struct super_block {
|
|||
* generic_show_options()
|
||||
*/
|
||||
char *s_options;
|
||||
|
||||
/*
|
||||
* storage for asynchronous operations
|
||||
*/
|
||||
struct list_head s_async_list;
|
||||
};
|
||||
|
||||
extern struct timespec current_fs_time(struct super_block *sb);
|
||||
|
|
@ -1212,7 +1227,6 @@ extern void unlock_super(struct super_block *);
|
|||
/*
|
||||
* VFS helper functions..
|
||||
*/
|
||||
extern int vfs_permission(struct nameidata *, int);
|
||||
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
|
||||
extern int vfs_mkdir(struct inode *, struct dentry *, int);
|
||||
extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
|
||||
|
|
@ -1310,7 +1324,6 @@ struct file_operations {
|
|||
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
||||
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
int (*check_flags)(int);
|
||||
int (*dir_notify)(struct file *filp, unsigned long arg);
|
||||
int (*flock) (struct file *, int, struct file_lock *);
|
||||
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
|
||||
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
|
||||
|
|
@ -1371,8 +1384,8 @@ struct super_operations {
|
|||
void (*put_super) (struct super_block *);
|
||||
void (*write_super) (struct super_block *);
|
||||
int (*sync_fs)(struct super_block *sb, int wait);
|
||||
void (*write_super_lockfs) (struct super_block *);
|
||||
void (*unlockfs) (struct super_block *);
|
||||
int (*freeze_fs) (struct super_block *);
|
||||
int (*unfreeze_fs) (struct super_block *);
|
||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||
int (*remount_fs) (struct super_block *, int *, char *);
|
||||
void (*clear_inode) (struct inode *);
|
||||
|
|
@ -1384,6 +1397,7 @@ struct super_operations {
|
|||
ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
|
||||
ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
|
||||
#endif
|
||||
int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -1829,7 +1843,7 @@ 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 long do_fsync(struct file *file, int datasync);
|
||||
extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
|
||||
extern void sync_supers(void);
|
||||
extern void sync_filesystems(int wait);
|
||||
extern void __fsync_super(struct super_block *sb);
|
||||
|
|
@ -1869,7 +1883,7 @@ extern void free_write_pipe(struct file *);
|
|||
|
||||
extern struct file *do_filp_open(int dfd, const char *pathname,
|
||||
int open_flag, int mode);
|
||||
extern int may_open(struct nameidata *, int, int);
|
||||
extern int may_open(struct path *, int, int);
|
||||
|
||||
extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
|
||||
extern struct file * open_exec(const char *);
|
||||
|
|
@ -1904,6 +1918,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
|
|||
|
||||
extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
|
||||
extern struct inode * iget_locked(struct super_block *, unsigned long);
|
||||
extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
|
||||
extern int insert_inode_locked(struct inode *);
|
||||
extern void unlock_new_inode(struct inode *);
|
||||
|
||||
extern void __iget(struct inode * inode);
|
||||
|
|
@ -2035,7 +2051,7 @@ extern int page_readlink(struct dentry *, char __user *, int);
|
|||
extern void *page_follow_link_light(struct dentry *, struct nameidata *);
|
||||
extern void page_put_link(struct dentry *, struct nameidata *, void *);
|
||||
extern int __page_symlink(struct inode *inode, const char *symname, int len,
|
||||
gfp_t gfp_mask);
|
||||
int nofs);
|
||||
extern int page_symlink(struct inode *inode, const char *symname, int len);
|
||||
extern const struct inode_operations page_symlink_inode_operations;
|
||||
extern int generic_readlink(struct dentry *, char __user *, int);
|
||||
|
|
@ -2056,6 +2072,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
|
|||
|
||||
extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
|
||||
unsigned long arg);
|
||||
extern int __generic_block_fiemap(struct inode *inode,
|
||||
struct fiemap_extent_info *fieinfo, u64 start,
|
||||
u64 len, get_block_t *get_block);
|
||||
extern int generic_block_fiemap(struct inode *inode,
|
||||
struct fiemap_extent_info *fieinfo, u64 start,
|
||||
u64 len, get_block_t *get_block);
|
||||
|
|
|
|||
|
|
@ -10,12 +10,6 @@ struct fs_struct {
|
|||
struct path root, pwd;
|
||||
};
|
||||
|
||||
#define INIT_FS { \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.lock = RW_LOCK_UNLOCKED, \
|
||||
.umask = 0022, \
|
||||
}
|
||||
|
||||
extern struct kmem_cache *fs_cachep;
|
||||
|
||||
extern void exit_fs(struct task_struct *);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
FUSE: Filesystem in Userspace
|
||||
Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu>
|
||||
Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
This program can be distributed under the terms of the GNU GPL.
|
||||
See the file COPYING.
|
||||
|
|
@ -20,29 +20,27 @@
|
|||
*
|
||||
* 7.10
|
||||
* - add nonseekable open flag
|
||||
*
|
||||
* 7.11
|
||||
* - add IOCTL message
|
||||
* - add unsolicited notification support
|
||||
* - add POLL message and NOTIFY_POLL notification
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
#define _LINUX_FUSE_H
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/** Version number of this interface */
|
||||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 10
|
||||
#define FUSE_KERNEL_MINOR_VERSION 11
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
|
||||
/** The major number of the fuse character device */
|
||||
#define FUSE_MAJOR MISC_MAJOR
|
||||
|
||||
/** The minor number of the fuse character device */
|
||||
#define FUSE_MINOR 229
|
||||
|
||||
/* Make sure all structures are padded to 64bit boundary, so 32bit
|
||||
userspace works under 64bit kernels */
|
||||
|
||||
|
|
@ -151,6 +149,28 @@ struct fuse_file_lock {
|
|||
*/
|
||||
#define FUSE_READ_LOCKOWNER (1 << 1)
|
||||
|
||||
/**
|
||||
* Ioctl flags
|
||||
*
|
||||
* FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
|
||||
* FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
|
||||
* FUSE_IOCTL_RETRY: retry with new iovecs
|
||||
*
|
||||
* FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
|
||||
*/
|
||||
#define FUSE_IOCTL_COMPAT (1 << 0)
|
||||
#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
|
||||
#define FUSE_IOCTL_RETRY (1 << 2)
|
||||
|
||||
#define FUSE_IOCTL_MAX_IOV 256
|
||||
|
||||
/**
|
||||
* Poll flags
|
||||
*
|
||||
* FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
|
||||
*/
|
||||
#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
|
||||
|
||||
enum fuse_opcode {
|
||||
FUSE_LOOKUP = 1,
|
||||
FUSE_FORGET = 2, /* no reply */
|
||||
|
|
@ -188,6 +208,13 @@ enum fuse_opcode {
|
|||
FUSE_INTERRUPT = 36,
|
||||
FUSE_BMAP = 37,
|
||||
FUSE_DESTROY = 38,
|
||||
FUSE_IOCTL = 39,
|
||||
FUSE_POLL = 40,
|
||||
};
|
||||
|
||||
enum fuse_notify_code {
|
||||
FUSE_NOTIFY_POLL = 1,
|
||||
FUSE_NOTIFY_CODE_MAX,
|
||||
};
|
||||
|
||||
/* The read buffer is required to be at least 8k, but may be much larger */
|
||||
|
|
@ -388,6 +415,38 @@ struct fuse_bmap_out {
|
|||
__u64 block;
|
||||
};
|
||||
|
||||
struct fuse_ioctl_in {
|
||||
__u64 fh;
|
||||
__u32 flags;
|
||||
__u32 cmd;
|
||||
__u64 arg;
|
||||
__u32 in_size;
|
||||
__u32 out_size;
|
||||
};
|
||||
|
||||
struct fuse_ioctl_out {
|
||||
__s32 result;
|
||||
__u32 flags;
|
||||
__u32 in_iovs;
|
||||
__u32 out_iovs;
|
||||
};
|
||||
|
||||
struct fuse_poll_in {
|
||||
__u64 fh;
|
||||
__u64 kh;
|
||||
__u32 flags;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_poll_out {
|
||||
__u32 revents;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_notify_poll_wakeup_out {
|
||||
__u64 kh;
|
||||
};
|
||||
|
||||
struct fuse_in_header {
|
||||
__u32 len;
|
||||
__u32 opcode;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ struct real_driver {
|
|||
void (*enable_tx_interrupts) (void *);
|
||||
void (*disable_rx_interrupts) (void *);
|
||||
void (*enable_rx_interrupts) (void *);
|
||||
int (*get_CD) (void *);
|
||||
void (*shutdown_port) (void*);
|
||||
int (*set_real_termios) (void*);
|
||||
int (*chars_in_buffer) (void*);
|
||||
|
|
|
|||
|
|
@ -69,12 +69,6 @@ struct vm_area_struct;
|
|||
#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
|
||||
__GFP_HARDWALL | __GFP_HIGHMEM | \
|
||||
__GFP_MOVABLE)
|
||||
#define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE)
|
||||
#define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
|
||||
__GFP_HARDWALL | __GFP_MOVABLE)
|
||||
#define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
|
||||
__GFP_HARDWALL | __GFP_HIGHMEM | \
|
||||
__GFP_MOVABLE)
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ struct gpio_keys_button {
|
|||
struct gpio_keys_platform_data {
|
||||
struct gpio_keys_button *buttons;
|
||||
int nbuttons;
|
||||
unsigned int rep:1; /* enable input subsystem auto repeat */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -403,15 +403,6 @@ struct hid_output_fifo {
|
|||
#define HID_STAT_ADDED 1
|
||||
#define HID_STAT_PARSED 2
|
||||
|
||||
#define HID_CTRL_RUNNING 1
|
||||
#define HID_OUT_RUNNING 2
|
||||
#define HID_IN_RUNNING 3
|
||||
#define HID_RESET_PENDING 4
|
||||
#define HID_SUSPENDED 5
|
||||
#define HID_CLEAR_HALT 6
|
||||
#define HID_DISCONNECTED 7
|
||||
#define HID_STARTED 8
|
||||
|
||||
struct hid_input {
|
||||
struct list_head list;
|
||||
struct hid_report *report;
|
||||
|
|
@ -540,6 +531,8 @@ struct hid_usage_id {
|
|||
* @name: driver name (e.g. "Footech_bar-wheel")
|
||||
* @id_table: which devices is this driver for (must be non-NULL for probe
|
||||
* to be called)
|
||||
* @dyn_list: list of dynamically added device ids
|
||||
* @dyn_lock: lock protecting @dyn_list
|
||||
* @probe: new device inserted
|
||||
* @remove: device removed (NULL if not a hot-plug capable driver)
|
||||
* @report_table: on which reports to call raw_event (NULL means all)
|
||||
|
|
@ -567,6 +560,9 @@ struct hid_driver {
|
|||
char *name;
|
||||
const struct hid_device_id *id_table;
|
||||
|
||||
struct list_head dyn_list;
|
||||
spinlock_t dyn_lock;
|
||||
|
||||
int (*probe)(struct hid_device *dev, const struct hid_device_id *id);
|
||||
void (*remove)(struct hid_device *dev);
|
||||
|
||||
|
|
@ -797,6 +793,8 @@ dbg_hid(const char *fmt, ...)
|
|||
|
||||
#ifdef CONFIG_HID_COMPAT
|
||||
#define HID_COMPAT_LOAD_DRIVER(name) \
|
||||
/* prototype to avoid sparse warning */ \
|
||||
extern void hid_compat_##name(void); \
|
||||
void hid_compat_##name(void) { } \
|
||||
EXPORT_SYMBOL(hid_compat_##name)
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ struct hidraw_devinfo {
|
|||
#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
|
||||
#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
|
||||
#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
|
||||
#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
|
||||
#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
|
||||
|
||||
#define HIDRAW_FIRST_MINOR 0
|
||||
#define HIDRAW_MAX_DEVICES 64
|
||||
|
|
|
|||
|
|
@ -233,6 +233,10 @@ static inline unsigned long huge_page_size(struct hstate *h)
|
|||
return (unsigned long)PAGE_SIZE << h->order;
|
||||
}
|
||||
|
||||
extern unsigned long vma_kernel_pagesize(struct vm_area_struct *vma);
|
||||
|
||||
extern unsigned long vma_mmu_pagesize(struct vm_area_struct *vma);
|
||||
|
||||
static inline unsigned long huge_page_mask(struct hstate *h)
|
||||
{
|
||||
return h->mask;
|
||||
|
|
@ -273,6 +277,8 @@ struct hstate {};
|
|||
#define hstate_inode(i) NULL
|
||||
#define huge_page_size(h) PAGE_SIZE
|
||||
#define huge_page_mask(h) PAGE_MASK
|
||||
#define vma_kernel_pagesize(v) PAGE_SIZE
|
||||
#define vma_mmu_pagesize(v) PAGE_SIZE
|
||||
#define huge_page_order(h) 0
|
||||
#define huge_page_shift(h) PAGE_SHIFT
|
||||
static inline unsigned int pages_per_huge_page(struct hstate *h)
|
||||
|
|
|
|||
|
|
@ -393,11 +393,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
|
|||
#define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */
|
||||
#define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */
|
||||
#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
|
||||
#define I2C_CLASS_CAM_ANALOG (1<<4) /* camera with analog CCD */
|
||||
#define I2C_CLASS_CAM_DIGITAL (1<<5) /* most webcams */
|
||||
#define I2C_CLASS_SOUND (1<<6) /* sound devices */
|
||||
#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
|
||||
#define I2C_CLASS_ALL (UINT_MAX) /* all of the above */
|
||||
|
||||
/* i2c_client_address_data is the struct for holding default client
|
||||
* addresses for a driver and for the parameters supplied on the
|
||||
|
|
|
|||
79
include/linux/i2c/dm355evm_msp.h
Normal file
79
include/linux/i2c/dm355evm_msp.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board
|
||||
*/
|
||||
#ifndef __LINUX_I2C_DM355EVM_MSP
|
||||
#define __LINUX_I2C_DM355EVM_MSP
|
||||
|
||||
/*
|
||||
* Written against Spectrum's writeup for the A4 firmware revision,
|
||||
* and tweaked to match source and rev D2 schematics by removing CPLD
|
||||
* and NOR flash hooks (which were last appropriate in rev B boards).
|
||||
*
|
||||
* Note that the firmware supports a flavor of write posting ... to be
|
||||
* sure a write completes, issue another read or write.
|
||||
*/
|
||||
|
||||
/* utilities to access "registers" emulated by msp430 firmware */
|
||||
extern int dm355evm_msp_write(u8 value, u8 reg);
|
||||
extern int dm355evm_msp_read(u8 reg);
|
||||
|
||||
|
||||
/* command/control registers */
|
||||
#define DM355EVM_MSP_COMMAND 0x00
|
||||
# define MSP_COMMAND_NULL 0
|
||||
# define MSP_COMMAND_RESET_COLD 1
|
||||
# define MSP_COMMAND_RESET_WARM 2
|
||||
# define MSP_COMMAND_RESET_WARM_I 3
|
||||
# define MSP_COMMAND_POWEROFF 4
|
||||
# define MSP_COMMAND_IR_REINIT 5
|
||||
#define DM355EVM_MSP_STATUS 0x01
|
||||
# define MSP_STATUS_BAD_OFFSET BIT(0)
|
||||
# define MSP_STATUS_BAD_COMMAND BIT(1)
|
||||
# define MSP_STATUS_POWER_ERROR BIT(2)
|
||||
# define MSP_STATUS_RXBUF_OVERRUN BIT(3)
|
||||
#define DM355EVM_MSP_RESET 0x02 /* 0 bits == in reset */
|
||||
# define MSP_RESET_DC5 BIT(0)
|
||||
# define MSP_RESET_TVP5154 BIT(2)
|
||||
# define MSP_RESET_IMAGER BIT(3)
|
||||
# define MSP_RESET_ETHERNET BIT(4)
|
||||
# define MSP_RESET_SYS BIT(5)
|
||||
# define MSP_RESET_AIC33 BIT(7)
|
||||
|
||||
/* GPIO registers ... bit patterns mostly match the source MSP ports */
|
||||
#define DM355EVM_MSP_LED 0x03 /* active low (MSP P4) */
|
||||
#define DM355EVM_MSP_SWITCH1 0x04 /* (MSP P5, masked) */
|
||||
# define MSP_SWITCH1_SW6_1 BIT(0)
|
||||
# define MSP_SWITCH1_SW6_2 BIT(1)
|
||||
# define MSP_SWITCH1_SW6_3 BIT(2)
|
||||
# define MSP_SWITCH1_SW6_4 BIT(3)
|
||||
# define MSP_SWITCH1_J1 BIT(4) /* NTSC/PAL */
|
||||
# define MSP_SWITCH1_MSP_INT BIT(5) /* active low */
|
||||
#define DM355EVM_MSP_SWITCH2 0x05 /* (MSP P6, masked) */
|
||||
# define MSP_SWITCH2_SW10 BIT(3)
|
||||
# define MSP_SWITCH2_SW11 BIT(4)
|
||||
# define MSP_SWITCH2_SW12 BIT(5)
|
||||
# define MSP_SWITCH2_SW13 BIT(6)
|
||||
# define MSP_SWITCH2_SW14 BIT(7)
|
||||
#define DM355EVM_MSP_SDMMC 0x06 /* (MSP P2, masked) */
|
||||
# define MSP_SDMMC_0_WP BIT(1)
|
||||
# define MSP_SDMMC_0_CD BIT(2) /* active low */
|
||||
# define MSP_SDMMC_1_WP BIT(3)
|
||||
# define MSP_SDMMC_1_CD BIT(4) /* active low */
|
||||
#define DM355EVM_MSP_FIRMREV 0x07 /* not a GPIO (out of order) */
|
||||
#define DM355EVM_MSP_VIDEO_IN 0x08 /* (MSP P3, masked) */
|
||||
# define MSP_VIDEO_IMAGER BIT(7) /* low == tvp5146 */
|
||||
|
||||
/* power supply registers are currently omitted */
|
||||
|
||||
/* RTC registers */
|
||||
#define DM355EVM_MSP_RTC_0 0x12 /* LSB */
|
||||
#define DM355EVM_MSP_RTC_1 0x13
|
||||
#define DM355EVM_MSP_RTC_2 0x14
|
||||
#define DM355EVM_MSP_RTC_3 0x15 /* MSB */
|
||||
|
||||
/* input event queue registers; code == ((HIGH << 8) | LOW) */
|
||||
#define DM355EVM_MSP_INPUT_COUNT 0x16 /* decrement by reading LOW */
|
||||
#define DM355EVM_MSP_INPUT_HIGH 0x17
|
||||
#define DM355EVM_MSP_INPUT_LOW 0x18
|
||||
|
||||
#endif /* __LINUX_I2C_DM355EVM_MSP */
|
||||
17
include/linux/i2c/tsc2007.h
Normal file
17
include/linux/i2c/tsc2007.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef __LINUX_I2C_TSC2007_H
|
||||
#define __LINUX_I2C_TSC2007_H
|
||||
|
||||
/* linux/i2c/tsc2007.h */
|
||||
|
||||
struct tsc2007_platform_data {
|
||||
u16 model; /* 2007. */
|
||||
u16 x_plate_ohms;
|
||||
|
||||
int (*get_pendown_state)(void);
|
||||
void (*clear_penirq)(void); /* If needed, clear 2nd level
|
||||
interrupt source */
|
||||
int (*init_platform_hw)(void);
|
||||
void (*exit_platform_hw)(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
|
|||
* IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1
|
||||
* for the value, and populate your data starting at offset 1.
|
||||
*/
|
||||
int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
|
||||
int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
|
||||
int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
|
@ -234,6 +234,9 @@ struct twl4030_gpio_platform_data {
|
|||
/* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */
|
||||
u8 mmc_cd;
|
||||
|
||||
/* if BIT(N) is set, or VMMC(n+1) is linked, debounce GPIO-N */
|
||||
u32 debounce;
|
||||
|
||||
/* For gpio-N, bit (1 << N) in "pullups" is set if that pullup
|
||||
* should be enabled. Else, if that bit is set in "pulldowns",
|
||||
* that pulldown is enabled. Don't waste power by letting any
|
||||
|
|
@ -278,6 +281,18 @@ struct twl4030_platform_data {
|
|||
struct twl4030_keypad_data *keypad;
|
||||
struct twl4030_usb_data *usb;
|
||||
|
||||
/* LDO regulators */
|
||||
struct regulator_init_data *vdac;
|
||||
struct regulator_init_data *vpll1;
|
||||
struct regulator_init_data *vpll2;
|
||||
struct regulator_init_data *vmmc1;
|
||||
struct regulator_init_data *vmmc2;
|
||||
struct regulator_init_data *vsim;
|
||||
struct regulator_init_data *vaux1;
|
||||
struct regulator_init_data *vaux2;
|
||||
struct regulator_init_data *vaux3;
|
||||
struct regulator_init_data *vaux4;
|
||||
|
||||
/* REVISIT more to come ... _nothing_ should be hard-wired */
|
||||
};
|
||||
|
||||
|
|
@ -285,33 +300,6 @@ struct twl4030_platform_data {
|
|||
|
||||
int twl4030_sih_setup(int module);
|
||||
|
||||
/*
|
||||
* FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the
|
||||
* IRQ data to subsidiary devices using platform device resources.
|
||||
*/
|
||||
|
||||
/* IRQ information-need base */
|
||||
#include <mach/irqs.h>
|
||||
/* TWL4030 interrupts */
|
||||
|
||||
/* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */
|
||||
#define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1)
|
||||
#define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2)
|
||||
#define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3)
|
||||
/* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */
|
||||
/* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */
|
||||
|
||||
#define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0)
|
||||
/* #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) */
|
||||
/* #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) */
|
||||
/* #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) */
|
||||
/* #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) */
|
||||
/* #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) */
|
||||
/* #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) */
|
||||
/* #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) */
|
||||
|
||||
/* Rest are unsued currently*/
|
||||
|
||||
/* Offsets to Power Registers */
|
||||
#define TWL4030_VDAC_DEV_GRP 0x3B
|
||||
#define TWL4030_VDAC_DEDICATED 0x3E
|
||||
|
|
@ -322,16 +310,6 @@ int twl4030_sih_setup(int module);
|
|||
#define TWL4030_VAUX3_DEV_GRP 0x1F
|
||||
#define TWL4030_VAUX3_DEDICATED 0x22
|
||||
|
||||
/* TWL4030 GPIO interrupt definitions */
|
||||
|
||||
#define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n))
|
||||
|
||||
/*
|
||||
* Exported TWL4030 GPIO APIs
|
||||
*
|
||||
* WARNING -- use standard GPIO and IRQ calls instead; these will vanish.
|
||||
*/
|
||||
int twl4030_set_gpio_debounce(int gpio, int enable);
|
||||
|
||||
#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
|
||||
defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
|
||||
|
|
@ -340,4 +318,38 @@ int twl4030_set_gpio_debounce(int gpio, int enable);
|
|||
static inline int twl4030charger_usb_en(int enable) { return 0; }
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* Linux-specific regulator identifiers ... for now, we only support
|
||||
* the LDOs, and leave the three buck converters alone. VDD1 and VDD2
|
||||
* need to tie into hardware based voltage scaling (cpufreq etc), while
|
||||
* VIO is generally fixed.
|
||||
*/
|
||||
|
||||
/* EXTERNAL dc-to-dc buck converters */
|
||||
#define TWL4030_REG_VDD1 0
|
||||
#define TWL4030_REG_VDD2 1
|
||||
#define TWL4030_REG_VIO 2
|
||||
|
||||
/* EXTERNAL LDOs */
|
||||
#define TWL4030_REG_VDAC 3
|
||||
#define TWL4030_REG_VPLL1 4
|
||||
#define TWL4030_REG_VPLL2 5 /* not on all chips */
|
||||
#define TWL4030_REG_VMMC1 6
|
||||
#define TWL4030_REG_VMMC2 7 /* not on all chips */
|
||||
#define TWL4030_REG_VSIM 8 /* not on all chips */
|
||||
#define TWL4030_REG_VAUX1 9 /* not on all chips */
|
||||
#define TWL4030_REG_VAUX2_4030 10 /* (twl4030-specific) */
|
||||
#define TWL4030_REG_VAUX2 11 /* (twl5030 and newer) */
|
||||
#define TWL4030_REG_VAUX3 12 /* not on all chips */
|
||||
#define TWL4030_REG_VAUX4 13 /* not on all chips */
|
||||
|
||||
/* INTERNAL LDOs */
|
||||
#define TWL4030_REG_VINTANA1 14
|
||||
#define TWL4030_REG_VINTANA2 15
|
||||
#define TWL4030_REG_VINTDIG 16
|
||||
#define TWL4030_REG_VUSB1V5 17
|
||||
#define TWL4030_REG_VUSB1V8 18
|
||||
#define TWL4030_REG_VUSB3V1 19
|
||||
|
||||
#endif /* End of __TWL4030_H */
|
||||
|
|
|
|||
|
|
@ -32,25 +32,14 @@
|
|||
# define SUPPORT_VLB_SYNC 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Used to indicate "no IRQ", should be a value that cannot be an IRQ
|
||||
* number.
|
||||
*/
|
||||
|
||||
#define IDE_NO_IRQ (-1)
|
||||
|
||||
typedef unsigned char byte; /* used everywhere */
|
||||
|
||||
/*
|
||||
* Probably not wise to fiddle with these
|
||||
*/
|
||||
#define IDE_DEFAULT_MAX_FAILURES 1
|
||||
#define ERROR_MAX 8 /* Max read/write errors per sector */
|
||||
#define ERROR_RESET 3 /* Reset controller every 4th retry */
|
||||
#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */
|
||||
|
||||
#define HWIF(drive) ((ide_hwif_t *)((drive)->hwif))
|
||||
#define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup))
|
||||
|
||||
/*
|
||||
* Definitions for accessing IDE controller registers
|
||||
*/
|
||||
|
|
@ -192,9 +181,6 @@ typedef struct hw_regs_s {
|
|||
unsigned long config;
|
||||
} hw_regs_t;
|
||||
|
||||
void ide_init_port_data(struct hwif_s *, unsigned int);
|
||||
void ide_init_port_hw(struct hwif_s *, hw_regs_t *);
|
||||
|
||||
static inline void ide_std_init_ports(hw_regs_t *hw,
|
||||
unsigned long io_addr,
|
||||
unsigned long ctl_addr)
|
||||
|
|
@ -403,6 +389,7 @@ enum {
|
|||
* This is used for several packet commands (not for READ/WRITE commands).
|
||||
*/
|
||||
#define IDE_PC_BUFFER_SIZE 256
|
||||
#define ATAPI_WAIT_PC (60 * HZ)
|
||||
|
||||
struct ide_atapi_pc {
|
||||
/* actual packet bytes */
|
||||
|
|
@ -439,18 +426,14 @@ struct ide_atapi_pc {
|
|||
struct idetape_bh *bh;
|
||||
char *b_data;
|
||||
|
||||
/* idescsi only for now */
|
||||
struct scatterlist *sg;
|
||||
unsigned int sg_cnt;
|
||||
|
||||
struct scsi_cmnd *scsi_cmd;
|
||||
void (*done) (struct scsi_cmnd *);
|
||||
|
||||
unsigned long timeout;
|
||||
};
|
||||
|
||||
struct ide_devset;
|
||||
struct ide_driver_s;
|
||||
struct ide_driver;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
struct ide_acpi_drive_link;
|
||||
|
|
@ -480,53 +463,53 @@ enum {
|
|||
|
||||
/* ide-cd */
|
||||
/* Drive cannot eject the disc. */
|
||||
IDE_AFLAG_NO_EJECT = (1 << 3),
|
||||
IDE_AFLAG_NO_EJECT = (1 << 1),
|
||||
/* Drive is a pre ATAPI 1.2 drive. */
|
||||
IDE_AFLAG_PRE_ATAPI12 = (1 << 4),
|
||||
IDE_AFLAG_PRE_ATAPI12 = (1 << 2),
|
||||
/* TOC addresses are in BCD. */
|
||||
IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5),
|
||||
IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3),
|
||||
/* TOC track numbers are in BCD. */
|
||||
IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6),
|
||||
IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4),
|
||||
/*
|
||||
* Drive does not provide data in multiples of SECTOR_SIZE
|
||||
* when more than one interrupt is needed.
|
||||
*/
|
||||
IDE_AFLAG_LIMIT_NFRAMES = (1 << 7),
|
||||
IDE_AFLAG_LIMIT_NFRAMES = (1 << 5),
|
||||
/* Saved TOC information is current. */
|
||||
IDE_AFLAG_TOC_VALID = (1 << 9),
|
||||
IDE_AFLAG_TOC_VALID = (1 << 6),
|
||||
/* We think that the drive door is locked. */
|
||||
IDE_AFLAG_DOOR_LOCKED = (1 << 10),
|
||||
IDE_AFLAG_DOOR_LOCKED = (1 << 7),
|
||||
/* SET_CD_SPEED command is unsupported. */
|
||||
IDE_AFLAG_NO_SPEED_SELECT = (1 << 11),
|
||||
IDE_AFLAG_VERTOS_300_SSD = (1 << 12),
|
||||
IDE_AFLAG_VERTOS_600_ESD = (1 << 13),
|
||||
IDE_AFLAG_SANYO_3CD = (1 << 14),
|
||||
IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15),
|
||||
IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16),
|
||||
IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17),
|
||||
IDE_AFLAG_NO_SPEED_SELECT = (1 << 8),
|
||||
IDE_AFLAG_VERTOS_300_SSD = (1 << 9),
|
||||
IDE_AFLAG_VERTOS_600_ESD = (1 << 10),
|
||||
IDE_AFLAG_SANYO_3CD = (1 << 11),
|
||||
IDE_AFLAG_FULL_CAPS_PAGE = (1 << 12),
|
||||
IDE_AFLAG_PLAY_AUDIO_OK = (1 << 13),
|
||||
IDE_AFLAG_LE_SPEED_FIELDS = (1 << 14),
|
||||
|
||||
/* ide-floppy */
|
||||
/* Avoid commands not supported in Clik drive */
|
||||
IDE_AFLAG_CLIK_DRIVE = (1 << 19),
|
||||
IDE_AFLAG_CLIK_DRIVE = (1 << 15),
|
||||
/* Requires BH algorithm for packets */
|
||||
IDE_AFLAG_ZIP_DRIVE = (1 << 20),
|
||||
IDE_AFLAG_ZIP_DRIVE = (1 << 16),
|
||||
/* Supports format progress report */
|
||||
IDE_AFLAG_SRFP = (1 << 22),
|
||||
IDE_AFLAG_SRFP = (1 << 17),
|
||||
|
||||
/* ide-tape */
|
||||
IDE_AFLAG_IGNORE_DSC = (1 << 23),
|
||||
IDE_AFLAG_IGNORE_DSC = (1 << 18),
|
||||
/* 0 When the tape position is unknown */
|
||||
IDE_AFLAG_ADDRESS_VALID = (1 << 24),
|
||||
IDE_AFLAG_ADDRESS_VALID = (1 << 19),
|
||||
/* Device already opened */
|
||||
IDE_AFLAG_BUSY = (1 << 25),
|
||||
IDE_AFLAG_BUSY = (1 << 20),
|
||||
/* Attempt to auto-detect the current user block size */
|
||||
IDE_AFLAG_DETECT_BS = (1 << 26),
|
||||
IDE_AFLAG_DETECT_BS = (1 << 21),
|
||||
/* Currently on a filemark */
|
||||
IDE_AFLAG_FILEMARK = (1 << 27),
|
||||
IDE_AFLAG_FILEMARK = (1 << 22),
|
||||
/* 0 = no tape is loaded, so we don't rewind after ejecting */
|
||||
IDE_AFLAG_MEDIUM_PRESENT = (1 << 28),
|
||||
IDE_AFLAG_MEDIUM_PRESENT = (1 << 23),
|
||||
|
||||
IDE_AFLAG_NO_AUTOCLOSE = (1 << 29),
|
||||
IDE_AFLAG_NO_AUTOCLOSE = (1 << 24),
|
||||
};
|
||||
|
||||
/* device flags */
|
||||
|
|
@ -565,28 +548,26 @@ enum {
|
|||
IDE_DFLAG_NODMA = (1 << 16),
|
||||
/* powermanagment told us not to do anything, so sleep nicely */
|
||||
IDE_DFLAG_BLOCKED = (1 << 17),
|
||||
/* ide-scsi emulation */
|
||||
IDE_DFLAG_SCSI = (1 << 18),
|
||||
/* sleeping & sleep field valid */
|
||||
IDE_DFLAG_SLEEPING = (1 << 19),
|
||||
IDE_DFLAG_POST_RESET = (1 << 20),
|
||||
IDE_DFLAG_UDMA33_WARNED = (1 << 21),
|
||||
IDE_DFLAG_LBA48 = (1 << 22),
|
||||
IDE_DFLAG_SLEEPING = (1 << 18),
|
||||
IDE_DFLAG_POST_RESET = (1 << 19),
|
||||
IDE_DFLAG_UDMA33_WARNED = (1 << 20),
|
||||
IDE_DFLAG_LBA48 = (1 << 21),
|
||||
/* status of write cache */
|
||||
IDE_DFLAG_WCACHE = (1 << 23),
|
||||
IDE_DFLAG_WCACHE = (1 << 22),
|
||||
/* used for ignoring ATA_DF */
|
||||
IDE_DFLAG_NOWERR = (1 << 24),
|
||||
IDE_DFLAG_NOWERR = (1 << 23),
|
||||
/* retrying in PIO */
|
||||
IDE_DFLAG_DMA_PIO_RETRY = (1 << 25),
|
||||
IDE_DFLAG_LBA = (1 << 26),
|
||||
IDE_DFLAG_DMA_PIO_RETRY = (1 << 24),
|
||||
IDE_DFLAG_LBA = (1 << 25),
|
||||
/* don't unload heads */
|
||||
IDE_DFLAG_NO_UNLOAD = (1 << 27),
|
||||
IDE_DFLAG_NO_UNLOAD = (1 << 26),
|
||||
/* heads unloaded, please don't reset port */
|
||||
IDE_DFLAG_PARKED = (1 << 28),
|
||||
IDE_DFLAG_MEDIA_CHANGED = (1 << 29),
|
||||
IDE_DFLAG_PARKED = (1 << 27),
|
||||
IDE_DFLAG_MEDIA_CHANGED = (1 << 28),
|
||||
/* write protect */
|
||||
IDE_DFLAG_WP = (1 << 30),
|
||||
IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 31),
|
||||
IDE_DFLAG_WP = (1 << 29),
|
||||
IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
|
||||
};
|
||||
|
||||
struct ide_drive_s {
|
||||
|
|
@ -596,7 +577,6 @@ struct ide_drive_s {
|
|||
struct request_queue *queue; /* request queue */
|
||||
|
||||
struct request *rq; /* current request */
|
||||
struct ide_drive_s *next; /* circular list of hwgroup drives */
|
||||
void *driver_data; /* extra driver data */
|
||||
u16 *id; /* identification info */
|
||||
#ifdef CONFIG_IDE_PROC_FS
|
||||
|
|
@ -610,8 +590,6 @@ struct ide_drive_s {
|
|||
unsigned long dev_flags;
|
||||
|
||||
unsigned long sleep; /* sleep until this time */
|
||||
unsigned long service_start; /* time we started last request */
|
||||
unsigned long service_time; /* service time of last request */
|
||||
unsigned long timeout; /* max time to wait for irq */
|
||||
|
||||
special_t special; /* special action flags */
|
||||
|
|
@ -672,6 +650,8 @@ struct ide_drive_s {
|
|||
int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
|
||||
unsigned int, int);
|
||||
|
||||
ide_startstop_t (*irq_handler)(struct ide_drive_s *);
|
||||
|
||||
unsigned long atapi_flags;
|
||||
|
||||
struct ide_atapi_pc request_sense_pc;
|
||||
|
|
@ -694,7 +674,6 @@ struct ide_tp_ops {
|
|||
void (*exec_command)(struct hwif_s *, u8);
|
||||
u8 (*read_status)(struct hwif_s *);
|
||||
u8 (*read_altstatus)(struct hwif_s *);
|
||||
u8 (*read_sff_dma_status)(struct hwif_s *);
|
||||
|
||||
void (*set_irq)(struct hwif_s *, int);
|
||||
|
||||
|
|
@ -755,14 +734,17 @@ struct ide_dma_ops {
|
|||
int (*dma_test_irq)(struct ide_drive_s *);
|
||||
void (*dma_lost_irq)(struct ide_drive_s *);
|
||||
void (*dma_timeout)(struct ide_drive_s *);
|
||||
/*
|
||||
* The following method is optional and only required to be
|
||||
* implemented for the SFF-8038i compatible controllers.
|
||||
*/
|
||||
u8 (*dma_sff_read_status)(struct hwif_s *);
|
||||
};
|
||||
|
||||
struct ide_host;
|
||||
|
||||
typedef struct hwif_s {
|
||||
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
|
||||
struct hwif_s *mate; /* other hwif from same PCI chip */
|
||||
struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
|
||||
struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
|
||||
|
||||
struct ide_host *host;
|
||||
|
|
@ -773,7 +755,7 @@ typedef struct hwif_s {
|
|||
|
||||
unsigned long sata_scr[SATA_NR_PORTS];
|
||||
|
||||
ide_drive_t drives[MAX_DRIVES]; /* drive info */
|
||||
ide_drive_t *devices[MAX_DRIVES + 1];
|
||||
|
||||
u8 major; /* our major number */
|
||||
u8 index; /* 0 for ide0; 1 for ide1; ... */
|
||||
|
|
@ -839,7 +821,7 @@ typedef struct hwif_s {
|
|||
unsigned extra_ports; /* number of extra dma ports */
|
||||
|
||||
unsigned present : 1; /* this interface exists */
|
||||
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
|
||||
unsigned busy : 1; /* serializes devices on a port */
|
||||
|
||||
struct device gendev;
|
||||
struct device *portdev;
|
||||
|
|
@ -851,19 +833,49 @@ typedef struct hwif_s {
|
|||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
struct ide_acpi_hwif_link *acpidata;
|
||||
#endif
|
||||
|
||||
/* IRQ handler, if active */
|
||||
ide_startstop_t (*handler)(ide_drive_t *);
|
||||
|
||||
/* BOOL: polling active & poll_timeout field valid */
|
||||
unsigned int polling : 1;
|
||||
|
||||
/* current drive */
|
||||
ide_drive_t *cur_dev;
|
||||
|
||||
/* current request */
|
||||
struct request *rq;
|
||||
|
||||
/* failsafe timer */
|
||||
struct timer_list timer;
|
||||
/* timeout value during long polls */
|
||||
unsigned long poll_timeout;
|
||||
/* queried upon timeouts */
|
||||
int (*expiry)(ide_drive_t *);
|
||||
|
||||
int req_gen;
|
||||
int req_gen_timer;
|
||||
|
||||
spinlock_t lock;
|
||||
} ____cacheline_internodealigned_in_smp ide_hwif_t;
|
||||
|
||||
#define MAX_HOST_PORTS 4
|
||||
|
||||
struct ide_host {
|
||||
ide_hwif_t *ports[MAX_HOST_PORTS];
|
||||
ide_hwif_t *ports[MAX_HOST_PORTS + 1];
|
||||
unsigned int n_ports;
|
||||
struct device *dev[2];
|
||||
unsigned int (*init_chipset)(struct pci_dev *);
|
||||
unsigned long host_flags;
|
||||
void *host_priv;
|
||||
ide_hwif_t *cur_port; /* for hosts requiring serialization */
|
||||
|
||||
/* used for hosts requiring serialization */
|
||||
volatile long host_busy;
|
||||
};
|
||||
|
||||
#define IDE_HOST_BUSY 0
|
||||
|
||||
/*
|
||||
* internal ide interrupt handler type
|
||||
*/
|
||||
|
|
@ -873,40 +885,6 @@ typedef int (ide_expiry_t)(ide_drive_t *);
|
|||
/* used by ide-cd, ide-floppy, etc. */
|
||||
typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned);
|
||||
|
||||
typedef struct hwgroup_s {
|
||||
/* irq handler, if active */
|
||||
ide_startstop_t (*handler)(ide_drive_t *);
|
||||
|
||||
/* BOOL: protects all fields below */
|
||||
volatile int busy;
|
||||
/* BOOL: wake us up on timer expiry */
|
||||
unsigned int sleeping : 1;
|
||||
/* BOOL: polling active & poll_timeout field valid */
|
||||
unsigned int polling : 1;
|
||||
|
||||
/* current drive */
|
||||
ide_drive_t *drive;
|
||||
/* ptr to current hwif in linked-list */
|
||||
ide_hwif_t *hwif;
|
||||
|
||||
/* current request */
|
||||
struct request *rq;
|
||||
|
||||
/* failsafe timer */
|
||||
struct timer_list timer;
|
||||
/* timeout value during long polls */
|
||||
unsigned long poll_timeout;
|
||||
/* queried upon timeouts */
|
||||
int (*expiry)(ide_drive_t *);
|
||||
|
||||
int req_gen;
|
||||
int req_gen_timer;
|
||||
|
||||
spinlock_t lock;
|
||||
} ide_hwgroup_t;
|
||||
|
||||
typedef struct ide_driver_s ide_driver_t;
|
||||
|
||||
extern struct mutex ide_setting_mtx;
|
||||
|
||||
/*
|
||||
|
|
@ -1032,8 +1010,8 @@ void ide_proc_register_port(ide_hwif_t *);
|
|||
void ide_proc_port_register_devices(ide_hwif_t *);
|
||||
void ide_proc_unregister_device(ide_drive_t *);
|
||||
void ide_proc_unregister_port(ide_hwif_t *);
|
||||
void ide_proc_register_driver(ide_drive_t *, ide_driver_t *);
|
||||
void ide_proc_unregister_driver(ide_drive_t *, ide_driver_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;
|
||||
|
|
@ -1060,8 +1038,10 @@ static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; }
|
|||
static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; }
|
||||
static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; }
|
||||
static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; }
|
||||
static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
|
||||
static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
|
||||
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
|
||||
|
||||
|
|
@ -1130,11 +1110,10 @@ void ide_check_pm_state(ide_drive_t *, struct request *);
|
|||
* The gendriver.owner field should be set to the module owner of this driver.
|
||||
* The gendriver.name field should be set to the name of this driver
|
||||
*/
|
||||
struct ide_driver_s {
|
||||
struct ide_driver {
|
||||
const char *version;
|
||||
ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
|
||||
int (*end_request)(ide_drive_t *, int, int);
|
||||
ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
|
||||
struct device_driver gen_driver;
|
||||
int (*probe)(ide_drive_t *);
|
||||
void (*remove)(ide_drive_t *);
|
||||
|
|
@ -1146,7 +1125,7 @@ struct ide_driver_s {
|
|||
#endif
|
||||
};
|
||||
|
||||
#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
|
||||
#define to_ide_driver(drv) container_of(drv, struct ide_driver, gen_driver)
|
||||
|
||||
int ide_device_get(ide_drive_t *);
|
||||
void ide_device_put(ide_drive_t *);
|
||||
|
|
@ -1178,9 +1157,7 @@ void ide_execute_pkt_cmd(ide_drive_t *);
|
|||
|
||||
void ide_pad_transfer(ide_drive_t *, int, int);
|
||||
|
||||
ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
|
||||
|
||||
ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
|
||||
ide_startstop_t ide_error(ide_drive_t *, const char *, u8);
|
||||
|
||||
void ide_fix_driveid(u16 *);
|
||||
|
||||
|
|
@ -1204,7 +1181,6 @@ void ide_tf_dump(const char *, struct ide_taskfile *);
|
|||
void ide_exec_command(ide_hwif_t *, u8);
|
||||
u8 ide_read_status(ide_hwif_t *);
|
||||
u8 ide_read_altstatus(ide_hwif_t *);
|
||||
u8 ide_read_sff_dma_status(ide_hwif_t *);
|
||||
|
||||
void ide_set_irq(ide_hwif_t *, int);
|
||||
|
||||
|
|
@ -1258,14 +1234,11 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
|
|||
void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
|
||||
void ide_retry_pc(ide_drive_t *, struct gendisk *);
|
||||
|
||||
static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc)
|
||||
{
|
||||
return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies);
|
||||
}
|
||||
int ide_cd_expiry(ide_drive_t *);
|
||||
|
||||
int ide_scsi_expiry(ide_drive_t *);
|
||||
int ide_cd_get_xferlen(struct request *);
|
||||
|
||||
ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *);
|
||||
ide_startstop_t ide_issue_pc(ide_drive_t *);
|
||||
|
||||
ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
|
||||
|
||||
|
|
@ -1322,11 +1295,11 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif,
|
|||
}
|
||||
#endif
|
||||
|
||||
typedef struct ide_pci_enablebit_s {
|
||||
struct ide_pci_enablebit {
|
||||
u8 reg; /* byte pci reg holding the enable-bit */
|
||||
u8 mask; /* mask to isolate the enable-bit */
|
||||
u8 val; /* value of masked reg when "enabled" */
|
||||
} ide_pci_enablebit_t;
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Uses ISA control ports not PCI ones. */
|
||||
|
|
@ -1415,7 +1388,8 @@ struct ide_port_info {
|
|||
const struct ide_port_ops *port_ops;
|
||||
const struct ide_dma_ops *dma_ops;
|
||||
|
||||
ide_pci_enablebit_t enablebits[2];
|
||||
struct ide_pci_enablebit enablebits[2];
|
||||
|
||||
hwif_chipset_t chipset;
|
||||
|
||||
u16 max_sectors; /* if < than the default one */
|
||||
|
|
@ -1487,6 +1461,7 @@ void ide_dma_exec_cmd(ide_drive_t *, u8);
|
|||
extern void ide_dma_start(ide_drive_t *);
|
||||
int ide_dma_end(ide_drive_t *);
|
||||
int ide_dma_test_irq(ide_drive_t *);
|
||||
u8 ide_dma_sff_read_status(ide_hwif_t *);
|
||||
extern const struct ide_dma_ops sff_dma_ops;
|
||||
#else
|
||||
static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
|
||||
|
|
@ -1524,15 +1499,13 @@ static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; }
|
|||
static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
|
||||
#endif
|
||||
|
||||
void ide_remove_port_from_hwgroup(ide_hwif_t *);
|
||||
void ide_unregister(ide_hwif_t *);
|
||||
|
||||
void ide_register_region(struct gendisk *);
|
||||
void ide_unregister_region(struct gendisk *);
|
||||
|
||||
void ide_undecoded_slave(ide_drive_t *);
|
||||
|
||||
void ide_port_apply_params(ide_hwif_t *);
|
||||
int ide_sysfs_register_port(ide_hwif_t *);
|
||||
|
||||
struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **);
|
||||
void ide_host_free(struct ide_host *);
|
||||
|
|
@ -1610,23 +1583,9 @@ static inline void ide_set_max_pio(ide_drive_t *drive)
|
|||
ide_set_pio(drive, 255);
|
||||
}
|
||||
|
||||
extern spinlock_t ide_lock;
|
||||
extern struct mutex ide_cfg_mtx;
|
||||
/*
|
||||
* Structure locking:
|
||||
*
|
||||
* ide_cfg_mtx and hwgroup->lock together protect changes to
|
||||
* ide_hwif_t->next
|
||||
* ide_drive_t->next
|
||||
*
|
||||
* ide_hwgroup_t->busy: hwgroup->lock
|
||||
* ide_hwgroup_t->hwif: hwgroup->lock
|
||||
* ide_hwif_t->{hwgroup,mate}: constant, no locking
|
||||
* ide_drive_t->hwif: constant, no locking
|
||||
*/
|
||||
|
||||
#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0)
|
||||
char *ide_media_string(ide_drive_t *);
|
||||
|
||||
extern struct device_attribute ide_dev_attrs[];
|
||||
extern struct bus_type ide_bus_type;
|
||||
extern struct class *ide_port_class;
|
||||
|
||||
|
|
@ -1642,8 +1601,15 @@ static inline int hwif_to_node(ide_hwif_t *hwif)
|
|||
|
||||
static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
|
||||
{
|
||||
ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1];
|
||||
ide_drive_t *peer = drive->hwif->devices[(drive->dn ^ 1) & 1];
|
||||
|
||||
return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL;
|
||||
}
|
||||
|
||||
#define ide_port_for_each_dev(i, dev, port) \
|
||||
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
|
||||
|
||||
#define ide_host_for_each_port(i, port, host) \
|
||||
for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)
|
||||
|
||||
#endif /* _IDE_H */
|
||||
|
|
|
|||
|
|
@ -115,6 +115,11 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
|
|||
extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
|
||||
u16 vlan_tci, int polling);
|
||||
extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
|
||||
extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
|
||||
unsigned int vlan_tci, struct sk_buff *skb);
|
||||
extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
|
||||
unsigned int vlan_tci,
|
||||
struct napi_gro_fraginfo *info);
|
||||
|
||||
#else
|
||||
static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
|
||||
|
|
@ -140,6 +145,20 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int vlan_gro_receive(struct napi_struct *napi,
|
||||
struct vlan_group *grp,
|
||||
unsigned int vlan_tci, struct sk_buff *skb)
|
||||
{
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
|
||||
static inline int vlan_gro_frags(struct napi_struct *napi,
|
||||
struct vlan_group *grp, unsigned int vlan_tci,
|
||||
struct napi_gro_fraginfo *info)
|
||||
{
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <net/net_namespace.h>
|
||||
|
||||
extern struct files_struct init_files;
|
||||
extern struct fs_struct init_fs;
|
||||
|
||||
#define INIT_KIOCTX(name, which_mm) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@
|
|||
#define _INTEL_IOMMU_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/msi.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/iova.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/dma_remapping.h>
|
||||
|
|
@ -289,10 +287,10 @@ struct intel_iommu {
|
|||
void __iomem *reg; /* Pointer to hardware regs, virtual addr */
|
||||
u64 cap;
|
||||
u64 ecap;
|
||||
int seg;
|
||||
u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
|
||||
spinlock_t register_lock; /* protect register handling */
|
||||
int seq_id; /* sequence id of the iommu */
|
||||
int agaw; /* agaw of this iommu */
|
||||
|
||||
#ifdef CONFIG_DMAR
|
||||
unsigned long *domain_ids; /* bitmap of domains */
|
||||
|
|
@ -302,8 +300,6 @@ struct intel_iommu {
|
|||
|
||||
unsigned int irq;
|
||||
unsigned char name[7]; /* Device Name */
|
||||
struct msi_msg saved_msg;
|
||||
struct sys_device sysdev;
|
||||
struct iommu_flush flush;
|
||||
#endif
|
||||
struct q_inval *qi; /* Queued invalidation info */
|
||||
|
|
@ -334,25 +330,6 @@ extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
|
|||
|
||||
extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
|
||||
|
||||
void intel_iommu_domain_exit(struct dmar_domain *domain);
|
||||
struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev);
|
||||
int intel_iommu_context_mapping(struct dmar_domain *domain,
|
||||
struct pci_dev *pdev);
|
||||
int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova,
|
||||
u64 hpa, size_t size, int prot);
|
||||
void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn);
|
||||
struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev);
|
||||
u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova);
|
||||
|
||||
#ifdef CONFIG_DMAR
|
||||
int intel_iommu_found(void);
|
||||
#else /* CONFIG_DMAR */
|
||||
static inline int intel_iommu_found(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_DMAR */
|
||||
|
||||
extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
|
||||
extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t);
|
||||
extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/irqflags.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/irqnr.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
|
@ -109,15 +108,15 @@ extern void enable_irq(unsigned int irq);
|
|||
|
||||
#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
|
||||
|
||||
extern cpumask_t irq_default_affinity;
|
||||
extern cpumask_var_t irq_default_affinity;
|
||||
|
||||
extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask);
|
||||
extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
|
||||
extern int irq_can_set_affinity(unsigned int irq);
|
||||
extern int irq_select_affinity(unsigned int irq);
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
|
||||
static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
|
||||
static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -253,7 +252,8 @@ enum
|
|||
BLOCK_SOFTIRQ,
|
||||
TASKLET_SOFTIRQ,
|
||||
SCHED_SOFTIRQ,
|
||||
RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
|
||||
HRTIMER_SOFTIRQ,
|
||||
RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
|
||||
|
||||
NR_SOFTIRQS
|
||||
};
|
||||
|
|
@ -464,4 +464,11 @@ static inline void init_irq_proc(void)
|
|||
|
||||
int show_interrupts(struct seq_file *p, void *v);
|
||||
|
||||
struct irq_desc;
|
||||
|
||||
extern int early_irq_init(void);
|
||||
extern int arch_probe_nr_irqs(void);
|
||||
extern int arch_early_irq_init(void);
|
||||
extern int arch_init_chip_data(struct irq_desc *desc, int cpu);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
112
include/linux/iommu.h
Normal file
112
include/linux/iommu.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
|
||||
* Author: Joerg Roedel <joerg.roedel@amd.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IOMMU_H
|
||||
#define __LINUX_IOMMU_H
|
||||
|
||||
#define IOMMU_READ (1)
|
||||
#define IOMMU_WRITE (2)
|
||||
|
||||
struct device;
|
||||
|
||||
struct iommu_domain {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
struct iommu_ops {
|
||||
int (*domain_init)(struct iommu_domain *domain);
|
||||
void (*domain_destroy)(struct iommu_domain *domain);
|
||||
int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
|
||||
void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
|
||||
int (*map)(struct iommu_domain *domain, unsigned long iova,
|
||||
phys_addr_t paddr, size_t size, int prot);
|
||||
void (*unmap)(struct iommu_domain *domain, unsigned long iova,
|
||||
size_t size);
|
||||
phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
|
||||
unsigned long iova);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_IOMMU_API
|
||||
|
||||
extern void register_iommu(struct iommu_ops *ops);
|
||||
extern bool iommu_found(void);
|
||||
extern struct iommu_domain *iommu_domain_alloc(void);
|
||||
extern void iommu_domain_free(struct iommu_domain *domain);
|
||||
extern int iommu_attach_device(struct iommu_domain *domain,
|
||||
struct device *dev);
|
||||
extern void iommu_detach_device(struct iommu_domain *domain,
|
||||
struct device *dev);
|
||||
extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova,
|
||||
phys_addr_t paddr, size_t size, int prot);
|
||||
extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova,
|
||||
size_t size);
|
||||
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
|
||||
unsigned long iova);
|
||||
|
||||
#else /* CONFIG_IOMMU_API */
|
||||
|
||||
static inline void register_iommu(struct iommu_ops *ops)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool iommu_found(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline struct iommu_domain *iommu_domain_alloc(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void iommu_domain_free(struct iommu_domain *domain)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int iommu_attach_device(struct iommu_domain *domain,
|
||||
struct device *dev)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void iommu_detach_device(struct iommu_domain *domain,
|
||||
struct device *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int iommu_map_range(struct iommu_domain *domain,
|
||||
unsigned long iova, phys_addr_t paddr,
|
||||
size_t size, int prot)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void iommu_unmap_range(struct iommu_domain *domain,
|
||||
unsigned long iova, size_t size)
|
||||
{
|
||||
}
|
||||
|
||||
static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
|
||||
unsigned long iova)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IOMMU_API */
|
||||
|
||||
#endif /* __LINUX_IOMMU_H */
|
||||
|
|
@ -49,6 +49,7 @@ struct resource_list {
|
|||
#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
|
||||
#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
|
||||
|
||||
#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
|
||||
#define IORESOURCE_DISABLED 0x10000000
|
||||
#define IORESOURCE_UNSET 0x20000000
|
||||
#define IORESOURCE_AUTO 0x40000000
|
||||
|
|
@ -133,13 +134,16 @@ static inline unsigned long resource_type(struct resource *res)
|
|||
}
|
||||
|
||||
/* Convenience shorthand with allocation */
|
||||
#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
|
||||
#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
|
||||
#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0)
|
||||
#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl)
|
||||
#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
|
||||
#define request_mem_region_exclusive(start,n,name) \
|
||||
__request_region(&iomem_resource, (start), (n), (name), IORESOURCE_EXCLUSIVE)
|
||||
#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
|
||||
|
||||
extern struct resource * __request_region(struct resource *,
|
||||
resource_size_t start,
|
||||
resource_size_t n, const char *name);
|
||||
resource_size_t n, const char *name, int relaxed);
|
||||
|
||||
/* Compatibility cruft */
|
||||
#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
|
||||
|
|
@ -175,6 +179,7 @@ extern struct resource * __devm_request_region(struct device *dev,
|
|||
extern void __devm_release_region(struct device *dev, struct resource *parent,
|
||||
resource_size_t start, resource_size_t n);
|
||||
extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
|
||||
extern int iomem_is_exclusive(u64 addr);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _LINUX_IOPORT_H */
|
||||
|
|
|
|||
|
|
@ -86,4 +86,6 @@ static inline int task_nice_ioclass(struct task_struct *task)
|
|||
*/
|
||||
extern int ioprio_best(unsigned short aprio, unsigned short bprio);
|
||||
|
||||
extern int set_task_ioprio(struct task_struct *task, int ioprio);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -113,7 +113,8 @@ struct irq_chip {
|
|||
void (*eoi)(unsigned int irq);
|
||||
|
||||
void (*end)(unsigned int irq);
|
||||
void (*set_affinity)(unsigned int irq, cpumask_t dest);
|
||||
void (*set_affinity)(unsigned int irq,
|
||||
const struct cpumask *dest);
|
||||
int (*retrigger)(unsigned int irq);
|
||||
int (*set_type)(unsigned int irq, unsigned int flow_type);
|
||||
int (*set_wake)(unsigned int irq, unsigned int on);
|
||||
|
|
@ -181,11 +182,11 @@ struct irq_desc {
|
|||
unsigned int irqs_unhandled;
|
||||
spinlock_t lock;
|
||||
#ifdef CONFIG_SMP
|
||||
cpumask_t affinity;
|
||||
cpumask_var_t affinity;
|
||||
unsigned int cpu;
|
||||
#endif
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_t pending_mask;
|
||||
cpumask_var_t pending_mask;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_PROC_FS
|
||||
struct proc_dir_entry *dir;
|
||||
|
|
@ -193,42 +194,23 @@ struct irq_desc {
|
|||
const char *name;
|
||||
} ____cacheline_internodealigned_in_smp;
|
||||
|
||||
extern void early_irq_init(void);
|
||||
extern void arch_early_irq_init(void);
|
||||
extern void arch_init_chip_data(struct irq_desc *desc, int cpu);
|
||||
extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
|
||||
struct irq_desc *desc, int cpu);
|
||||
extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
|
||||
|
||||
#ifndef CONFIG_SPARSE_IRQ
|
||||
extern struct irq_desc irq_desc[NR_IRQS];
|
||||
|
||||
static inline struct irq_desc *irq_to_desc(unsigned int irq)
|
||||
{
|
||||
return (irq < NR_IRQS) ? irq_desc + irq : NULL;
|
||||
}
|
||||
static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
|
||||
{
|
||||
return irq_to_desc(irq);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
extern struct irq_desc *irq_to_desc(unsigned int irq);
|
||||
extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
|
||||
#else /* CONFIG_SPARSE_IRQ */
|
||||
extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
|
||||
|
||||
# define for_each_irq_desc(irq, desc) \
|
||||
for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq))
|
||||
# define for_each_irq_desc_reverse(irq, desc) \
|
||||
for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq))
|
||||
|
||||
#define kstat_irqs_this_cpu(DESC) \
|
||||
((DESC)->kstat_irqs[smp_processor_id()])
|
||||
#define kstat_incr_irqs_this_cpu(irqno, DESC) \
|
||||
((DESC)->kstat_irqs[smp_processor_id()]++)
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_SPARSE_IRQ */
|
||||
|
||||
extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
|
||||
|
||||
static inline struct irq_desc *
|
||||
irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
|
||||
|
|
@ -440,4 +422,84 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
|
|||
|
||||
#endif /* !CONFIG_S390 */
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/**
|
||||
* init_alloc_desc_masks - allocate cpumasks for irq_desc
|
||||
* @desc: pointer to irq_desc struct
|
||||
* @cpu: cpu which will be handling the cpumasks
|
||||
* @boot: true if need bootmem
|
||||
*
|
||||
* Allocates affinity and pending_mask cpumask if required.
|
||||
* Returns true if successful (or not required).
|
||||
* Side effect: affinity has all bits set, pending_mask has all bits clear.
|
||||
*/
|
||||
static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
||||
bool boot)
|
||||
{
|
||||
int node;
|
||||
|
||||
if (boot) {
|
||||
alloc_bootmem_cpumask_var(&desc->affinity);
|
||||
cpumask_setall(desc->affinity);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
alloc_bootmem_cpumask_var(&desc->pending_mask);
|
||||
cpumask_clear(desc->pending_mask);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
node = cpu_to_node(cpu);
|
||||
|
||||
if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
|
||||
return false;
|
||||
cpumask_setall(desc->affinity);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
|
||||
free_cpumask_var(desc->affinity);
|
||||
return false;
|
||||
}
|
||||
cpumask_clear(desc->pending_mask);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* init_copy_desc_masks - copy cpumasks for irq_desc
|
||||
* @old_desc: pointer to old irq_desc struct
|
||||
* @new_desc: pointer to new irq_desc struct
|
||||
*
|
||||
* Insures affinity and pending_masks are copied to new irq_desc.
|
||||
* If !CONFIG_CPUMASKS_OFFSTACK the cpumasks are embedded in the
|
||||
* irq_desc struct so the copy is redundant.
|
||||
*/
|
||||
|
||||
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
||||
struct irq_desc *new_desc)
|
||||
{
|
||||
#ifdef CONFIG_CPUMASKS_OFFSTACK
|
||||
cpumask_copy(new_desc->affinity, old_desc->affinity);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_copy(new_desc->pending_mask, old_desc->pending_mask);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* !CONFIG_SMP */
|
||||
|
||||
static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
||||
bool boot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
||||
struct irq_desc *new_desc)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#endif /* _LINUX_IRQ_H */
|
||||
|
|
|
|||
|
|
@ -8,27 +8,36 @@
|
|||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS
|
||||
#include <asm/irq.h>
|
||||
# define nr_irqs NR_IRQS
|
||||
|
||||
/*
|
||||
* Wrappers for non-genirq architectures:
|
||||
*/
|
||||
#define nr_irqs NR_IRQS
|
||||
#define irq_to_desc(irq) (&irq_desc[irq])
|
||||
|
||||
# define for_each_irq_desc(irq, desc) \
|
||||
for (irq = 0; irq < nr_irqs; irq++)
|
||||
|
||||
# define for_each_irq_desc_reverse(irq, desc) \
|
||||
for (irq = nr_irqs - 1; irq >= 0; irq--)
|
||||
#else
|
||||
|
||||
#else /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
extern int nr_irqs;
|
||||
extern struct irq_desc *irq_to_desc(unsigned int irq);
|
||||
|
||||
#ifndef CONFIG_SPARSE_IRQ
|
||||
# define for_each_irq_desc(irq, desc) \
|
||||
for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
|
||||
irq++, desc = irq_to_desc(irq)) \
|
||||
if (desc)
|
||||
|
||||
struct irq_desc;
|
||||
# define for_each_irq_desc(irq, desc) \
|
||||
for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
|
||||
# define for_each_irq_desc_reverse(irq, desc) \
|
||||
for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \
|
||||
irq >= 0; irq--, desc--)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
# define for_each_irq_desc_reverse(irq, desc) \
|
||||
for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
|
||||
irq--, desc = irq_to_desc(irq)) \
|
||||
if (desc)
|
||||
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
#define for_each_irq_nr(irq) \
|
||||
for (irq = 0; irq < nr_irqs; irq++)
|
||||
|
|
|
|||
|
|
@ -59,9 +59,7 @@ struct stliport {
|
|||
unsigned int devnr;
|
||||
int baud_base;
|
||||
int custom_divisor;
|
||||
int close_delay;
|
||||
int closing_wait;
|
||||
int openwaitcnt;
|
||||
int rc;
|
||||
int argsize;
|
||||
void *argp;
|
||||
|
|
|
|||
|
|
@ -542,6 +542,11 @@ struct transaction_s
|
|||
*/
|
||||
unsigned long t_expires;
|
||||
|
||||
/*
|
||||
* When this transaction started, in nanoseconds [no locking]
|
||||
*/
|
||||
ktime_t t_start_time;
|
||||
|
||||
/*
|
||||
* How many handles used this transaction? [t_handle_lock]
|
||||
*/
|
||||
|
|
@ -798,8 +803,18 @@ struct journal_s
|
|||
struct buffer_head **j_wbuf;
|
||||
int j_wbufsize;
|
||||
|
||||
/*
|
||||
* this is the pid of the last person to run a synchronous operation
|
||||
* through the journal.
|
||||
*/
|
||||
pid_t j_last_sync_writer;
|
||||
|
||||
/*
|
||||
* the average amount of time in nanoseconds it takes to commit a
|
||||
* transaction to the disk. [j_state_lock]
|
||||
*/
|
||||
u64 j_average_commit_time;
|
||||
|
||||
/*
|
||||
* An opaque pointer to fs-private information. ext3 puts its
|
||||
* superblock pointer here
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ enum jbd_state_bits {
|
|||
BH_State, /* Pins most journal_head state */
|
||||
BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
|
||||
BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
|
||||
BH_JBDPrivateStart, /* First bit available for private use by FS */
|
||||
};
|
||||
|
||||
BUFFER_FNS(JBD, jbd)
|
||||
|
|
@ -636,6 +637,11 @@ struct transaction_s
|
|||
*/
|
||||
unsigned long t_expires;
|
||||
|
||||
/*
|
||||
* When this transaction started, in nanoseconds [no locking]
|
||||
*/
|
||||
ktime_t t_start_time;
|
||||
|
||||
/*
|
||||
* How many handles used this transaction? [t_handle_lock]
|
||||
*/
|
||||
|
|
@ -681,6 +687,8 @@ jbd2_time_diff(unsigned long start, unsigned long end)
|
|||
return end + (MAX_JIFFY_OFFSET - start);
|
||||
}
|
||||
|
||||
#define JBD2_NR_BATCH 64
|
||||
|
||||
/**
|
||||
* struct journal_s - The journal_s type is the concrete type associated with
|
||||
* journal_t.
|
||||
|
|
@ -824,6 +832,14 @@ struct journal_s
|
|||
/* Semaphore for locking against concurrent checkpoints */
|
||||
struct mutex j_checkpoint_mutex;
|
||||
|
||||
/*
|
||||
* List of buffer heads used by the checkpoint routine. This
|
||||
* was moved from jbd2_log_do_checkpoint() to reduce stack
|
||||
* usage. Access to this array is controlled by the
|
||||
* j_checkpoint_mutex. [j_checkpoint_mutex]
|
||||
*/
|
||||
struct buffer_head *j_chkpt_bhs[JBD2_NR_BATCH];
|
||||
|
||||
/*
|
||||
* Journal head: identifies the first unused block in the journal.
|
||||
* [j_state_lock]
|
||||
|
|
@ -938,8 +954,26 @@ struct journal_s
|
|||
struct buffer_head **j_wbuf;
|
||||
int j_wbufsize;
|
||||
|
||||
/*
|
||||
* this is the pid of hte last person to run a synchronous operation
|
||||
* through the journal
|
||||
*/
|
||||
pid_t j_last_sync_writer;
|
||||
|
||||
/*
|
||||
* the average amount of time in nanoseconds it takes to commit a
|
||||
* transaction to disk. [j_state_lock]
|
||||
*/
|
||||
u64 j_average_commit_time;
|
||||
|
||||
/*
|
||||
* minimum and maximum times that we should wait for
|
||||
* additional filesystem operations to get batched into a
|
||||
* synchronous handle in microseconds
|
||||
*/
|
||||
u32 j_min_batch_time;
|
||||
u32 j_max_batch_time;
|
||||
|
||||
/* This function is called when a transaction is closed */
|
||||
void (*j_commit_callback)(journal_t *,
|
||||
transaction_t *);
|
||||
|
|
@ -1007,6 +1041,35 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal);
|
|||
int __jbd2_journal_remove_checkpoint(struct journal_head *);
|
||||
void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *);
|
||||
|
||||
|
||||
/*
|
||||
* Triggers
|
||||
*/
|
||||
|
||||
struct jbd2_buffer_trigger_type {
|
||||
/*
|
||||
* Fired just before a buffer is written to the journal.
|
||||
* mapped_data is a mapped buffer that is the frozen data for
|
||||
* commit.
|
||||
*/
|
||||
void (*t_commit)(struct jbd2_buffer_trigger_type *type,
|
||||
struct buffer_head *bh, void *mapped_data,
|
||||
size_t size);
|
||||
|
||||
/*
|
||||
* Fired during journal abort for dirty buffers that will not be
|
||||
* committed.
|
||||
*/
|
||||
void (*t_abort)(struct jbd2_buffer_trigger_type *type,
|
||||
struct buffer_head *bh);
|
||||
};
|
||||
|
||||
extern void jbd2_buffer_commit_trigger(struct journal_head *jh,
|
||||
void *mapped_data,
|
||||
struct jbd2_buffer_trigger_type *triggers);
|
||||
extern void jbd2_buffer_abort_trigger(struct journal_head *jh,
|
||||
struct jbd2_buffer_trigger_type *triggers);
|
||||
|
||||
/* Buffer IO */
|
||||
extern int
|
||||
jbd2_journal_write_metadata_buffer(transaction_t *transaction,
|
||||
|
|
@ -1045,6 +1108,8 @@ extern int jbd2_journal_extend (handle_t *, int nblocks);
|
|||
extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
|
||||
extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *);
|
||||
extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *);
|
||||
void jbd2_journal_set_triggers(struct buffer_head *,
|
||||
struct jbd2_buffer_trigger_type *type);
|
||||
extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *);
|
||||
extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *);
|
||||
extern int jbd2_journal_forget (handle_t *, struct buffer_head *);
|
||||
|
|
@ -1070,7 +1135,6 @@ extern int jbd2_journal_set_features
|
|||
(journal_t *, unsigned long, unsigned long, unsigned long);
|
||||
extern void jbd2_journal_clear_features
|
||||
(journal_t *, unsigned long, unsigned long, unsigned long);
|
||||
extern int jbd2_journal_create (journal_t *);
|
||||
extern int jbd2_journal_load (journal_t *journal);
|
||||
extern int jbd2_journal_destroy (journal_t *);
|
||||
extern int jbd2_journal_recover (journal_t *journal);
|
||||
|
|
@ -1145,8 +1209,8 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid);
|
|||
int jbd2_log_do_checkpoint(journal_t *journal);
|
||||
|
||||
void __jbd2_log_wait_for_space(journal_t *journal);
|
||||
extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *);
|
||||
extern int jbd2_cleanup_journal_tail(journal_t *);
|
||||
extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *);
|
||||
extern int jbd2_cleanup_journal_tail(journal_t *);
|
||||
|
||||
/* Debugging code only: */
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
typedef unsigned int tid_t; /* Unique transaction ID */
|
||||
typedef struct transaction_s transaction_t; /* Compound transaction type */
|
||||
|
||||
|
||||
struct buffer_head;
|
||||
|
||||
struct journal_head {
|
||||
|
|
@ -87,6 +89,12 @@ struct journal_head {
|
|||
* [j_list_lock]
|
||||
*/
|
||||
struct journal_head *b_cpnext, *b_cpprev;
|
||||
|
||||
/* Trigger type */
|
||||
struct jbd2_buffer_trigger_type *b_triggers;
|
||||
|
||||
/* Trigger type for the committing transaction's frozen data */
|
||||
struct jbd2_buffer_trigger_type *b_frozen_triggers;
|
||||
};
|
||||
|
||||
#endif /* JOURNAL_HEAD_H_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@ extern const char linux_proc_banner[];
|
|||
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
#define DIV_ROUND_CLOSEST(x, divisor)( \
|
||||
{ \
|
||||
typeof(divisor) __divisor = divisor; \
|
||||
(((x) + ((__divisor) / 2)) / (__divisor)); \
|
||||
} \
|
||||
)
|
||||
|
||||
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
|
||||
#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
|
||||
|
|
@ -349,13 +355,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
|
|||
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
||||
|
||||
/* If you are writing a driver, please use dev_dbg instead */
|
||||
#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
|
||||
#if defined(DEBUG)
|
||||
#define pr_debug(fmt, ...) \
|
||||
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
||||
#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
|
||||
#define pr_debug(fmt, ...) do { \
|
||||
dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#elif defined(DEBUG)
|
||||
#define pr_debug(fmt, ...) \
|
||||
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
||||
#else
|
||||
#define pr_debug(fmt, ...) \
|
||||
({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
|
||||
|
|
@ -470,6 +476,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
|
|||
__val = __val < __min ? __min: __val; \
|
||||
__val > __max ? __max: __val; })
|
||||
|
||||
|
||||
/*
|
||||
* swap - swap value of @a and @b
|
||||
*/
|
||||
#define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; })
|
||||
|
||||
/**
|
||||
* container_of - cast a member of a structure out to the containing structure
|
||||
* @ptr: the pointer to the member.
|
||||
|
|
|
|||
|
|
@ -79,10 +79,13 @@ static inline unsigned int kstat_irqs(unsigned int irq)
|
|||
}
|
||||
|
||||
extern unsigned long long task_delta_exec(struct task_struct *);
|
||||
extern void account_user_time(struct task_struct *, cputime_t);
|
||||
extern void account_user_time_scaled(struct task_struct *, cputime_t);
|
||||
extern void account_system_time(struct task_struct *, int, cputime_t);
|
||||
extern void account_system_time_scaled(struct task_struct *, cputime_t);
|
||||
extern void account_steal_time(struct task_struct *, cputime_t);
|
||||
extern void account_user_time(struct task_struct *, cputime_t, cputime_t);
|
||||
extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t);
|
||||
extern void account_steal_time(cputime_t);
|
||||
extern void account_idle_time(cputime_t);
|
||||
|
||||
extern void account_process_tick(struct task_struct *, int user);
|
||||
extern void account_steal_ticks(unsigned long ticks);
|
||||
extern void account_idle_ticks(unsigned long ticks);
|
||||
|
||||
#endif /* _LINUX_KERNEL_STAT_H */
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#define _LINUX_KLIST_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
|
|
@ -41,7 +40,6 @@ struct klist_node {
|
|||
void *n_klist; /* never access directly */
|
||||
struct list_head n_node;
|
||||
struct kref n_ref;
|
||||
struct completion n_removed;
|
||||
};
|
||||
|
||||
extern void klist_add_tail(struct klist_node *n, struct klist *k);
|
||||
|
|
|
|||
|
|
@ -69,9 +69,6 @@ struct kprobe {
|
|||
/* list of kprobes for multi-handler support */
|
||||
struct list_head list;
|
||||
|
||||
/* Indicates that the corresponding module has been ref counted */
|
||||
unsigned int mod_refcounted;
|
||||
|
||||
/*count the number of times this probe was temporarily disarmed */
|
||||
unsigned long nmissed;
|
||||
|
||||
|
|
@ -103,8 +100,19 @@ struct kprobe {
|
|||
|
||||
/* copy of the original instruction */
|
||||
struct arch_specific_insn ainsn;
|
||||
|
||||
/* Indicates various status flags. Protected by kprobe_mutex. */
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
/* Kprobe status flags */
|
||||
#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */
|
||||
|
||||
static inline int kprobe_gone(struct kprobe *p)
|
||||
{
|
||||
return p->flags & KPROBE_FLAG_GONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special probe type that uses setjmp-longjmp type tricks to resume
|
||||
* execution at a specified entry with a matching prototype corresponding
|
||||
|
|
@ -201,7 +209,6 @@ static inline int init_test_probes(void)
|
|||
}
|
||||
#endif /* CONFIG_KPROBES_SANITY_TEST */
|
||||
|
||||
extern struct mutex kprobe_mutex;
|
||||
extern int arch_prepare_kprobe(struct kprobe *p);
|
||||
extern void arch_arm_kprobe(struct kprobe *p);
|
||||
extern void arch_disarm_kprobe(struct kprobe *p);
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ struct kvm_irqchip {
|
|||
#define KVM_EXIT_S390_SIEIC 13
|
||||
#define KVM_EXIT_S390_RESET 14
|
||||
#define KVM_EXIT_DCR 15
|
||||
#define KVM_EXIT_NMI 16
|
||||
|
||||
/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
|
||||
struct kvm_run {
|
||||
|
|
@ -387,6 +388,14 @@ struct kvm_trace_rec {
|
|||
#define KVM_CAP_DEVICE_ASSIGNMENT 17
|
||||
#endif
|
||||
#define KVM_CAP_IOMMU 18
|
||||
#if defined(CONFIG_X86)
|
||||
#define KVM_CAP_DEVICE_MSI 20
|
||||
#endif
|
||||
/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
|
||||
#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
|
||||
#if defined(CONFIG_X86)
|
||||
#define KVM_CAP_USER_NMI 22
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioctls for VM fds
|
||||
|
|
@ -458,6 +467,8 @@ struct kvm_trace_rec {
|
|||
#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
|
||||
#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
|
||||
#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
|
||||
/* Available with KVM_CAP_NMI */
|
||||
#define KVM_NMI _IO(KVMIO, 0x9a)
|
||||
|
||||
#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
|
||||
#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
|
||||
|
|
@ -500,10 +511,17 @@ struct kvm_assigned_irq {
|
|||
__u32 guest_irq;
|
||||
__u32 flags;
|
||||
union {
|
||||
struct {
|
||||
__u32 addr_lo;
|
||||
__u32 addr_hi;
|
||||
__u32 data;
|
||||
} guest_msi;
|
||||
__u32 reserved[12];
|
||||
};
|
||||
};
|
||||
|
||||
#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
|
||||
|
||||
#define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/marker.h>
|
||||
#include <linux/msi.h>
|
||||
#include <asm/signal.h>
|
||||
|
||||
#include <linux/kvm.h>
|
||||
|
|
@ -306,9 +307,16 @@ struct kvm_assigned_dev_kernel {
|
|||
int host_busnr;
|
||||
int host_devfn;
|
||||
int host_irq;
|
||||
bool host_irq_disabled;
|
||||
int guest_irq;
|
||||
int irq_requested;
|
||||
struct msi_msg guest_msi;
|
||||
#define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0)
|
||||
#define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1)
|
||||
#define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8)
|
||||
#define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9)
|
||||
unsigned long irq_requested_type;
|
||||
int irq_source_id;
|
||||
int flags;
|
||||
struct pci_dev *dev;
|
||||
struct kvm *kvm;
|
||||
};
|
||||
|
|
@ -316,18 +324,20 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
|
|||
void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
|
||||
void kvm_register_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(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);
|
||||
|
||||
#ifdef CONFIG_DMAR
|
||||
#ifdef CONFIG_IOMMU_API
|
||||
int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn,
|
||||
unsigned long npages);
|
||||
int kvm_iommu_map_guest(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel *assigned_dev);
|
||||
int kvm_iommu_map_guest(struct kvm *kvm);
|
||||
int kvm_iommu_unmap_guest(struct kvm *kvm);
|
||||
#else /* CONFIG_DMAR */
|
||||
int kvm_assign_device(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel *assigned_dev);
|
||||
int kvm_deassign_device(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel *assigned_dev);
|
||||
#else /* CONFIG_IOMMU_API */
|
||||
static inline int kvm_iommu_map_pages(struct kvm *kvm,
|
||||
gfn_t base_gfn,
|
||||
unsigned long npages)
|
||||
|
|
@ -335,9 +345,7 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int kvm_iommu_map_guest(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel
|
||||
*assigned_dev)
|
||||
static inline int kvm_iommu_map_guest(struct kvm *kvm)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
@ -346,7 +354,19 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_DMAR */
|
||||
|
||||
static inline int kvm_assign_device(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel *assigned_dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int kvm_deassign_device(struct kvm *kvm,
|
||||
struct kvm_assigned_dev_kernel *assigned_dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IOMMU_API */
|
||||
|
||||
static inline void kvm_guest_enter(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#define __LINUX_PCA9532_H
|
||||
|
||||
#include <linux/leds.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
enum pca9532_state {
|
||||
PCA9532_OFF = 0x0,
|
||||
|
|
@ -31,6 +32,7 @@ struct pca9532_led {
|
|||
struct i2c_client *client;
|
||||
char *name;
|
||||
struct led_classdev ldev;
|
||||
struct work_struct work;
|
||||
enum pca9532_type type;
|
||||
enum pca9532_state state;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,10 @@ struct led_classdev {
|
|||
int brightness;
|
||||
int flags;
|
||||
|
||||
/* Lower 16 bits reflect status */
|
||||
#define LED_SUSPENDED (1 << 0)
|
||||
/* Upper 16 bits reflect control information */
|
||||
#define LED_CORE_SUSPENDRESUME (1 << 16)
|
||||
|
||||
/* Set LED brightness level */
|
||||
/* Must not sleep, use a workqueue if needed */
|
||||
|
|
@ -62,7 +65,7 @@ struct led_classdev {
|
|||
|
||||
extern int led_classdev_register(struct device *parent,
|
||||
struct led_classdev *led_cdev);
|
||||
extern void led_classdev_unregister(struct led_classdev *lcd);
|
||||
extern void led_classdev_unregister(struct led_classdev *led_cdev);
|
||||
extern void led_classdev_suspend(struct led_classdev *led_cdev);
|
||||
extern void led_classdev_resume(struct led_classdev *led_cdev);
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ enum {
|
|||
/* host set flags */
|
||||
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
|
||||
ATA_HOST_STARTED = (1 << 1), /* Host started */
|
||||
ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */
|
||||
|
||||
/* bits 24:31 of host->flags are reserved for LLD specific flags */
|
||||
|
||||
|
|
@ -1518,6 +1519,7 @@ extern void sata_pmp_error_handler(struct ata_port *ap);
|
|||
|
||||
extern const struct ata_port_operations ata_sff_port_ops;
|
||||
extern const struct ata_port_operations ata_bmdma_port_ops;
|
||||
extern const struct ata_port_operations ata_bmdma32_port_ops;
|
||||
|
||||
/* PIO only, sg_tablesize and dma_boundary limits can be removed */
|
||||
#define ATA_PIO_SHT(drv_name) \
|
||||
|
|
@ -1545,6 +1547,8 @@ extern void ata_sff_exec_command(struct ata_port *ap,
|
|||
const struct ata_taskfile *tf);
|
||||
extern unsigned int ata_sff_data_xfer(struct ata_device *dev,
|
||||
unsigned char *buf, unsigned int buflen, int rw);
|
||||
extern unsigned int ata_sff_data_xfer32(struct ata_device *dev,
|
||||
unsigned char *buf, unsigned int buflen, int rw);
|
||||
extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev,
|
||||
unsigned char *buf, unsigned int buflen, int rw);
|
||||
extern u8 ata_sff_irq_on(struct ata_port *ap);
|
||||
|
|
|
|||
|
|
@ -18,11 +18,13 @@
|
|||
#define PS2_RET_ID 0x00
|
||||
#define PS2_RET_ACK 0xfa
|
||||
#define PS2_RET_NAK 0xfe
|
||||
#define PS2_RET_ERR 0xfc
|
||||
|
||||
#define PS2_FLAG_ACK 1 /* Waiting for ACK/NAK */
|
||||
#define PS2_FLAG_CMD 2 /* Waiting for command to finish */
|
||||
#define PS2_FLAG_CMD1 4 /* Waiting for the first byte of command response */
|
||||
#define PS2_FLAG_WAITID 8 /* Command execiting is GET ID */
|
||||
#define PS2_FLAG_NAK 16 /* Last transmission was NAKed */
|
||||
|
||||
struct ps2dev {
|
||||
struct serio *serio;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ struct nlm_host {
|
|||
struct sockaddr_storage h_addr; /* peer address */
|
||||
size_t h_addrlen;
|
||||
struct sockaddr_storage h_srcaddr; /* our address (optional) */
|
||||
struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
|
||||
char * h_name; /* remote hostname */
|
||||
struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */
|
||||
char *h_name; /* remote hostname */
|
||||
u32 h_version; /* interface version */
|
||||
unsigned short h_proto; /* transport proto */
|
||||
unsigned short h_reclaiming : 1,
|
||||
|
|
@ -64,21 +64,29 @@ struct nlm_host {
|
|||
spinlock_t h_lock;
|
||||
struct list_head h_granted; /* Locks in GRANTED state */
|
||||
struct list_head h_reclaim; /* Locks in RECLAIM state */
|
||||
struct nsm_handle * h_nsmhandle; /* NSM status handle */
|
||||
|
||||
char h_addrbuf[48], /* address eyecatchers */
|
||||
h_srcaddrbuf[48];
|
||||
struct nsm_handle *h_nsmhandle; /* NSM status handle */
|
||||
char *h_addrbuf; /* address eyecatcher */
|
||||
};
|
||||
|
||||
/*
|
||||
* The largest string sm_addrbuf should hold is a full-size IPv6 address
|
||||
* (no "::" anywhere) with a scope ID. The buffer size is computed to
|
||||
* hold eight groups of colon-separated four-hex-digit numbers, a
|
||||
* percent sign, a scope id (at most 32 bits, in decimal), and NUL.
|
||||
*/
|
||||
#define NSM_ADDRBUF ((8 * 4 + 7) + (1 + 10) + 1)
|
||||
|
||||
struct nsm_handle {
|
||||
struct list_head sm_link;
|
||||
atomic_t sm_count;
|
||||
char * sm_name;
|
||||
char *sm_mon_name;
|
||||
char *sm_name;
|
||||
struct sockaddr_storage sm_addr;
|
||||
size_t sm_addrlen;
|
||||
unsigned int sm_monitored : 1,
|
||||
sm_sticky : 1; /* don't unmonitor */
|
||||
char sm_addrbuf[48]; /* address eyecatcher */
|
||||
struct nsm_private sm_priv;
|
||||
char sm_addrbuf[NSM_ADDRBUF];
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -104,16 +112,6 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host)
|
|||
return (struct sockaddr *)&host->h_srcaddr;
|
||||
}
|
||||
|
||||
static inline struct sockaddr_in *nsm_addr_in(const struct nsm_handle *handle)
|
||||
{
|
||||
return (struct sockaddr_in *)&handle->sm_addr;
|
||||
}
|
||||
|
||||
static inline struct sockaddr *nsm_addr(const struct nsm_handle *handle)
|
||||
{
|
||||
return (struct sockaddr *)&handle->sm_addr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map an fl_owner_t into a unique 32-bit "pid"
|
||||
*/
|
||||
|
|
@ -197,6 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
|
|||
extern int nlmsvc_grace_period;
|
||||
extern unsigned long nlmsvc_timeout;
|
||||
extern int nsm_use_hostnames;
|
||||
extern int nsm_local_state;
|
||||
|
||||
/*
|
||||
* Lockd client functions
|
||||
|
|
@ -231,10 +230,20 @@ void nlm_rebind_host(struct nlm_host *);
|
|||
struct nlm_host * nlm_get_host(struct nlm_host *);
|
||||
void nlm_release_host(struct nlm_host *);
|
||||
void nlm_shutdown_hosts(void);
|
||||
extern void nlm_host_rebooted(const struct sockaddr_in *, const char *,
|
||||
unsigned int, u32);
|
||||
void nsm_release(struct nsm_handle *);
|
||||
void nlm_host_rebooted(const struct nlm_reboot *);
|
||||
|
||||
/*
|
||||
* Host monitoring
|
||||
*/
|
||||
int nsm_monitor(const struct nlm_host *host);
|
||||
void nsm_unmonitor(const struct nlm_host *host);
|
||||
|
||||
struct nsm_handle *nsm_get_handle(const struct sockaddr *sap,
|
||||
const size_t salen,
|
||||
const char *hostname,
|
||||
const size_t hostname_len);
|
||||
struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info);
|
||||
void nsm_release(struct nsm_handle *nsm);
|
||||
|
||||
/*
|
||||
* This is used in garbage collection and resource reclaim
|
||||
|
|
@ -282,16 +291,25 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
|
|||
static inline int __nlm_privileged_request4(const struct sockaddr *sap)
|
||||
{
|
||||
const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
|
||||
return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) &&
|
||||
(ntohs(sin->sin_port) < 1024);
|
||||
|
||||
if (ntohs(sin->sin_port) > 1023)
|
||||
return 0;
|
||||
|
||||
return ipv4_is_loopback(sin->sin_addr.s_addr);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
static inline int __nlm_privileged_request6(const struct sockaddr *sap)
|
||||
{
|
||||
const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
|
||||
return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) &&
|
||||
(ntohs(sin6->sin6_port) < 1024);
|
||||
|
||||
if (ntohs(sin6->sin6_port) > 1023)
|
||||
return 0;
|
||||
|
||||
if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_MAPPED)
|
||||
return ipv4_is_loopback(sin6->sin6_addr.s6_addr32[3]);
|
||||
|
||||
return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK;
|
||||
}
|
||||
#else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
|
||||
static inline int __nlm_privileged_request6(const struct sockaddr *sap)
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* linux/include/linux/lockd/sm_inter.h
|
||||
*
|
||||
* Declarations for the kernel statd client.
|
||||
*
|
||||
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
|
||||
*/
|
||||
|
||||
#ifndef LINUX_LOCKD_SM_INTER_H
|
||||
#define LINUX_LOCKD_SM_INTER_H
|
||||
|
||||
#define SM_PROGRAM 100024
|
||||
#define SM_VERSION 1
|
||||
#define SM_STAT 1
|
||||
#define SM_MON 2
|
||||
#define SM_UNMON 3
|
||||
#define SM_UNMON_ALL 4
|
||||
#define SM_SIMU_CRASH 5
|
||||
#define SM_NOTIFY 6
|
||||
|
||||
#define SM_MAXSTRLEN 1024
|
||||
#define SM_PRIV_SIZE 16
|
||||
|
||||
/*
|
||||
* Arguments for all calls to statd
|
||||
*/
|
||||
struct nsm_args {
|
||||
__be32 addr; /* remote address */
|
||||
u32 prog; /* RPC callback info */
|
||||
u32 vers;
|
||||
u32 proc;
|
||||
|
||||
char * mon_name;
|
||||
};
|
||||
|
||||
/*
|
||||
* Result returned by statd
|
||||
*/
|
||||
struct nsm_res {
|
||||
u32 status;
|
||||
u32 state;
|
||||
};
|
||||
|
||||
int nsm_monitor(struct nlm_host *);
|
||||
int nsm_unmonitor(struct nlm_host *);
|
||||
extern int nsm_local_state;
|
||||
|
||||
#endif /* LINUX_LOCKD_SM_INTER_H */
|
||||
|
|
@ -13,6 +13,13 @@
|
|||
#include <linux/nfs.h>
|
||||
#include <linux/sunrpc/xdr.h>
|
||||
|
||||
#define SM_MAXSTRLEN 1024
|
||||
#define SM_PRIV_SIZE 16
|
||||
|
||||
struct nsm_private {
|
||||
unsigned char data[SM_PRIV_SIZE];
|
||||
};
|
||||
|
||||
struct svc_rqst;
|
||||
|
||||
#define NLM_MAXCOOKIELEN 32
|
||||
|
|
@ -77,10 +84,10 @@ struct nlm_res {
|
|||
* statd callback when client has rebooted
|
||||
*/
|
||||
struct nlm_reboot {
|
||||
char * mon;
|
||||
unsigned int len;
|
||||
u32 state;
|
||||
__be32 addr;
|
||||
char *mon;
|
||||
unsigned int len;
|
||||
u32 state;
|
||||
struct nsm_private priv;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -57,20 +57,21 @@
|
|||
#define FLG_L2DATA 14 /* channel use L2 DATA primitivs */
|
||||
#define FLG_ORIGIN 15 /* channel is on origin site */
|
||||
/* channel specific stuff */
|
||||
#define FLG_FILLEMPTY 16 /* fill fifo on first frame (empty) */
|
||||
/* arcofi specific */
|
||||
#define FLG_ARCOFI_TIMER 16
|
||||
#define FLG_ARCOFI_ERROR 17
|
||||
#define FLG_ARCOFI_TIMER 17
|
||||
#define FLG_ARCOFI_ERROR 18
|
||||
/* isar specific */
|
||||
#define FLG_INITIALIZED 16
|
||||
#define FLG_DLEETX 17
|
||||
#define FLG_LASTDLE 18
|
||||
#define FLG_FIRST 19
|
||||
#define FLG_LASTDATA 20
|
||||
#define FLG_NMD_DATA 21
|
||||
#define FLG_FTI_RUN 22
|
||||
#define FLG_LL_OK 23
|
||||
#define FLG_LL_CONN 24
|
||||
#define FLG_DTMFSEND 25
|
||||
#define FLG_INITIALIZED 17
|
||||
#define FLG_DLEETX 18
|
||||
#define FLG_LASTDLE 19
|
||||
#define FLG_FIRST 20
|
||||
#define FLG_LASTDATA 21
|
||||
#define FLG_NMD_DATA 22
|
||||
#define FLG_FTI_RUN 23
|
||||
#define FLG_LL_OK 24
|
||||
#define FLG_LL_CONN 25
|
||||
#define FLG_DTMFSEND 26
|
||||
|
||||
/* workq events */
|
||||
#define FLG_RECVQUEUE 30
|
||||
|
|
@ -183,6 +184,7 @@ extern void queue_ch_frame(struct mISDNchannel *, u_int,
|
|||
extern int dchannel_senddata(struct dchannel *, struct sk_buff *);
|
||||
extern int bchannel_senddata(struct bchannel *, struct sk_buff *);
|
||||
extern void recv_Dchannel(struct dchannel *);
|
||||
extern void recv_Echannel(struct dchannel *, struct dchannel *);
|
||||
extern void recv_Bchannel(struct bchannel *);
|
||||
extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *);
|
||||
extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* - should be incremented on every checkin
|
||||
*/
|
||||
#define MISDN_MAJOR_VERSION 1
|
||||
#define MISDN_MINOR_VERSION 0
|
||||
#define MISDN_RELEASE 19
|
||||
#define MISDN_MINOR_VERSION 1
|
||||
#define MISDN_RELEASE 20
|
||||
|
||||
/* primitives for information exchange
|
||||
* generell format
|
||||
|
|
@ -80,6 +80,7 @@
|
|||
#define PH_DEACTIVATE_IND 0x0202
|
||||
#define PH_DEACTIVATE_CNF 0x4202
|
||||
#define PH_DATA_IND 0x2002
|
||||
#define PH_DATA_E_IND 0x3002
|
||||
#define MPH_ACTIVATE_IND 0x0502
|
||||
#define MPH_DEACTIVATE_IND 0x0602
|
||||
#define MPH_INFORMATION_IND 0x0702
|
||||
|
|
@ -199,6 +200,18 @@
|
|||
#define ISDN_P_NT_S0 0x02
|
||||
#define ISDN_P_TE_E1 0x03
|
||||
#define ISDN_P_NT_E1 0x04
|
||||
#define ISDN_P_TE_UP0 0x05
|
||||
#define ISDN_P_NT_UP0 0x06
|
||||
|
||||
#define IS_ISDN_P_TE(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_TE_E1) || \
|
||||
(p == ISDN_P_TE_UP0) || (p == ISDN_P_LAPD_TE))
|
||||
#define IS_ISDN_P_NT(p) ((p == ISDN_P_NT_S0) || (p == ISDN_P_NT_E1) || \
|
||||
(p == ISDN_P_NT_UP0) || (p == ISDN_P_LAPD_NT))
|
||||
#define IS_ISDN_P_S0(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_NT_S0))
|
||||
#define IS_ISDN_P_E1(p) ((p == ISDN_P_TE_E1) || (p == ISDN_P_NT_E1))
|
||||
#define IS_ISDN_P_UP0(p) ((p == ISDN_P_TE_UP0) || (p == ISDN_P_NT_UP0))
|
||||
|
||||
|
||||
#define ISDN_P_LAPD_TE 0x10
|
||||
#define ISDN_P_LAPD_NT 0x11
|
||||
|
||||
|
|
@ -255,16 +268,6 @@ struct sockaddr_mISDN {
|
|||
unsigned char tei;
|
||||
};
|
||||
|
||||
/* timer device ioctl */
|
||||
#define IMADDTIMER _IOR('I', 64, int)
|
||||
#define IMDELTIMER _IOR('I', 65, int)
|
||||
/* socket ioctls */
|
||||
#define IMGETVERSION _IOR('I', 66, int)
|
||||
#define IMGETCOUNT _IOR('I', 67, int)
|
||||
#define IMGETDEVINFO _IOR('I', 68, int)
|
||||
#define IMCTRLREQ _IOR('I', 69, int)
|
||||
#define IMCLEAR_L2 _IOR('I', 70, int)
|
||||
|
||||
struct mISDNversion {
|
||||
unsigned char major;
|
||||
unsigned char minor;
|
||||
|
|
@ -281,6 +284,40 @@ struct mISDN_devinfo {
|
|||
char name[MISDN_MAX_IDLEN];
|
||||
};
|
||||
|
||||
struct mISDN_devrename {
|
||||
u_int id;
|
||||
char name[MISDN_MAX_IDLEN]; /* new name */
|
||||
};
|
||||
|
||||
/* MPH_INFORMATION_REQ payload */
|
||||
struct ph_info_ch {
|
||||
__u32 protocol;
|
||||
__u64 Flags;
|
||||
};
|
||||
|
||||
struct ph_info_dch {
|
||||
struct ph_info_ch ch;
|
||||
__u16 state;
|
||||
__u16 num_bch;
|
||||
};
|
||||
|
||||
struct ph_info {
|
||||
struct ph_info_dch dch;
|
||||
struct ph_info_ch bch[];
|
||||
};
|
||||
|
||||
/* timer device ioctl */
|
||||
#define IMADDTIMER _IOR('I', 64, int)
|
||||
#define IMDELTIMER _IOR('I', 65, int)
|
||||
|
||||
/* socket ioctls */
|
||||
#define IMGETVERSION _IOR('I', 66, int)
|
||||
#define IMGETCOUNT _IOR('I', 67, int)
|
||||
#define IMGETDEVINFO _IOR('I', 68, int)
|
||||
#define IMCTRLREQ _IOR('I', 69, int)
|
||||
#define IMCLEAR_L2 _IOR('I', 70, int)
|
||||
#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename)
|
||||
|
||||
static inline int
|
||||
test_channelmap(u_int nr, u_char *map)
|
||||
{
|
||||
|
|
@ -312,6 +349,8 @@ clear_channelmap(u_int nr, u_char *map)
|
|||
#define MISDN_CTRL_SETPEER 0x0040
|
||||
#define MISDN_CTRL_UNSETPEER 0x0080
|
||||
#define MISDN_CTRL_RX_OFF 0x0100
|
||||
#define MISDN_CTRL_FILL_EMPTY 0x0200
|
||||
#define MISDN_CTRL_GETPEER 0x0400
|
||||
#define MISDN_CTRL_HW_FEATURES_OP 0x2000
|
||||
#define MISDN_CTRL_HW_FEATURES 0x2001
|
||||
#define MISDN_CTRL_HFC_OP 0x4000
|
||||
|
|
@ -362,6 +401,7 @@ struct mISDN_ctrl_req {
|
|||
#define DEBUG_L2_TEI 0x00100000
|
||||
#define DEBUG_L2_TEIFSM 0x00200000
|
||||
#define DEBUG_TIMER 0x01000000
|
||||
#define DEBUG_CLOCK 0x02000000
|
||||
|
||||
#define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0])
|
||||
#define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim)
|
||||
|
|
@ -375,6 +415,7 @@ struct mISDN_ctrl_req {
|
|||
struct mISDNchannel;
|
||||
struct mISDNdevice;
|
||||
struct mISDNstack;
|
||||
struct mISDNclock;
|
||||
|
||||
struct channel_req {
|
||||
u_int protocol;
|
||||
|
|
@ -423,7 +464,6 @@ struct mISDN_sock {
|
|||
struct mISDNdevice {
|
||||
struct mISDNchannel D;
|
||||
u_int id;
|
||||
char name[MISDN_MAX_IDLEN];
|
||||
u_int Dprotocols;
|
||||
u_int Bprotocols;
|
||||
u_int nrbchan;
|
||||
|
|
@ -452,6 +492,16 @@ struct mISDNstack {
|
|||
#endif
|
||||
};
|
||||
|
||||
typedef int (clockctl_func_t)(void *, int);
|
||||
|
||||
struct mISDNclock {
|
||||
struct list_head list;
|
||||
char name[64];
|
||||
int pri;
|
||||
clockctl_func_t *ctl;
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/* global alloc/queue functions */
|
||||
|
||||
static inline struct sk_buff *
|
||||
|
|
@ -498,12 +548,26 @@ _queue_data(struct mISDNchannel *ch, u_int prim,
|
|||
|
||||
/* global register/unregister functions */
|
||||
|
||||
extern int mISDN_register_device(struct mISDNdevice *, char *name);
|
||||
extern int mISDN_register_device(struct mISDNdevice *,
|
||||
struct device *parent, char *name);
|
||||
extern void mISDN_unregister_device(struct mISDNdevice *);
|
||||
extern int mISDN_register_Bprotocol(struct Bprotocol *);
|
||||
extern void mISDN_unregister_Bprotocol(struct Bprotocol *);
|
||||
extern struct mISDNclock *mISDN_register_clock(char *, int, clockctl_func_t *,
|
||||
void *);
|
||||
extern void mISDN_unregister_clock(struct mISDNclock *);
|
||||
|
||||
static inline struct mISDNdevice *dev_to_mISDN(struct device *dev)
|
||||
{
|
||||
if (dev)
|
||||
return dev_get_drvdata(dev);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern void set_channel_address(struct mISDNchannel *, u_int, u_int);
|
||||
extern void mISDN_clock_update(struct mISDNclock *, int, struct timeval *);
|
||||
extern unsigned short mISDN_clock_get(void);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* mISDNIF_H */
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
#define EXT2_SUPER_MAGIC 0xEF53
|
||||
#define EXT3_SUPER_MAGIC 0xEF53
|
||||
#define XENFS_SUPER_MAGIC 0xabba1974
|
||||
#define EXT4_SUPER_MAGIC 0xEF53
|
||||
#define HPFS_SUPER_MAGIC 0xf995e849
|
||||
#define ISOFS_SUPER_MAGIC 0x9660
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ struct seg7_conversion_map {
|
|||
unsigned char table[128];
|
||||
};
|
||||
|
||||
static inline int map_to_seg7(struct seg7_conversion_map *map, int c)
|
||||
static __inline__ int map_to_seg7(struct seg7_conversion_map *map, int c)
|
||||
{
|
||||
return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,22 +19,45 @@
|
|||
|
||||
#ifndef _LINUX_MEMCONTROL_H
|
||||
#define _LINUX_MEMCONTROL_H
|
||||
|
||||
#include <linux/cgroup.h>
|
||||
struct mem_cgroup;
|
||||
struct page_cgroup;
|
||||
struct page;
|
||||
struct mm_struct;
|
||||
|
||||
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
|
||||
/*
|
||||
* All "charge" functions with gfp_mask should use GFP_KERNEL or
|
||||
* (gfp_mask & GFP_RECLAIM_MASK). In current implementatin, memcg doesn't
|
||||
* alloc memory but reclaims memory from all available zones. So, "where I want
|
||||
* memory from" bits of gfp_mask has no meaning. So any bits of that field is
|
||||
* available but adding a rule is better. charge functions' gfp_mask should
|
||||
* be set to GFP_KERNEL or gfp_mask & GFP_RECLAIM_MASK for avoiding ambiguous
|
||||
* codes.
|
||||
* (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.)
|
||||
*/
|
||||
|
||||
extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
|
||||
extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm,
|
||||
gfp_t gfp_mask);
|
||||
/* for swap handling */
|
||||
extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
|
||||
struct page *page, gfp_t mask, struct mem_cgroup **ptr);
|
||||
extern void mem_cgroup_commit_charge_swapin(struct page *page,
|
||||
struct mem_cgroup *ptr);
|
||||
extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr);
|
||||
|
||||
extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
|
||||
gfp_t gfp_mask);
|
||||
extern void mem_cgroup_move_lists(struct page *page, enum lru_list lru);
|
||||
extern void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru);
|
||||
extern void mem_cgroup_del_lru_list(struct page *page, enum lru_list lru);
|
||||
extern void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru);
|
||||
extern void mem_cgroup_del_lru(struct page *page);
|
||||
extern void mem_cgroup_move_lists(struct page *page,
|
||||
enum lru_list from, enum lru_list to);
|
||||
extern void mem_cgroup_uncharge_page(struct page *page);
|
||||
extern void mem_cgroup_uncharge_cache_page(struct page *page);
|
||||
extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask);
|
||||
extern int mem_cgroup_shrink_usage(struct page *page,
|
||||
struct mm_struct *mm, gfp_t gfp_mask);
|
||||
|
||||
extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
|
||||
struct list_head *dst,
|
||||
|
|
@ -47,12 +70,20 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
|
|||
|
||||
extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
|
||||
|
||||
#define mm_match_cgroup(mm, cgroup) \
|
||||
((cgroup) == mem_cgroup_from_task((mm)->owner))
|
||||
static inline
|
||||
int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
|
||||
{
|
||||
struct mem_cgroup *mem;
|
||||
rcu_read_lock();
|
||||
mem = mem_cgroup_from_task((mm)->owner);
|
||||
rcu_read_unlock();
|
||||
return cgroup == mem;
|
||||
}
|
||||
|
||||
extern int
|
||||
mem_cgroup_prepare_migration(struct page *page, struct page *newpage);
|
||||
extern void mem_cgroup_end_migration(struct page *page);
|
||||
mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr);
|
||||
extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
|
||||
struct page *oldpage, struct page *newpage);
|
||||
|
||||
/*
|
||||
* For memory reclaim.
|
||||
|
|
@ -65,13 +96,32 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
|
|||
int priority);
|
||||
extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
|
||||
int priority);
|
||||
int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
|
||||
unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
|
||||
struct zone *zone,
|
||||
enum lru_list lru);
|
||||
struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
|
||||
struct zone *zone);
|
||||
struct zone_reclaim_stat*
|
||||
mem_cgroup_get_reclaim_stat_from_page(struct page *page);
|
||||
|
||||
extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone,
|
||||
int priority, enum lru_list lru);
|
||||
#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
|
||||
extern int do_swap_account;
|
||||
#endif
|
||||
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
{
|
||||
if (mem_cgroup_subsys.disabled)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
extern bool mem_cgroup_oom_called(struct task_struct *task);
|
||||
|
||||
#else /* CONFIG_CGROUP_MEM_RES_CTLR */
|
||||
static inline int mem_cgroup_charge(struct page *page,
|
||||
struct mem_cgroup;
|
||||
|
||||
static inline int mem_cgroup_newpage_charge(struct page *page,
|
||||
struct mm_struct *mm, gfp_t gfp_mask)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -83,6 +133,21 @@ static inline int mem_cgroup_cache_charge(struct page *page,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
|
||||
struct page *page, gfp_t gfp_mask, struct mem_cgroup **ptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_commit_charge_swapin(struct page *page,
|
||||
struct mem_cgroup *ptr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_uncharge_page(struct page *page)
|
||||
{
|
||||
}
|
||||
|
|
@ -91,12 +156,33 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page)
|
|||
{
|
||||
}
|
||||
|
||||
static inline int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask)
|
||||
static inline int mem_cgroup_shrink_usage(struct page *page,
|
||||
struct mm_struct *mm, gfp_t gfp_mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_move_lists(struct page *page, bool active)
|
||||
static inline void mem_cgroup_add_lru_list(struct page *page, int lru)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_del_lru_list(struct page *page, int lru)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_rotate_lru_list(struct page *page, int lru)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_del_lru(struct page *page)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -112,12 +198,14 @@ static inline int task_in_mem_cgroup(struct task_struct *task,
|
|||
}
|
||||
|
||||
static inline int
|
||||
mem_cgroup_prepare_migration(struct page *page, struct page *newpage)
|
||||
mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_end_migration(struct page *page)
|
||||
static inline void mem_cgroup_end_migration(struct mem_cgroup *mem,
|
||||
struct page *oldpage,
|
||||
struct page *newpage)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -146,12 +234,42 @@ static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
|
|||
{
|
||||
}
|
||||
|
||||
static inline long mem_cgroup_calc_reclaim(struct mem_cgroup *mem,
|
||||
struct zone *zone, int priority,
|
||||
enum lru_list lru)
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool mem_cgroup_oom_called(struct task_struct *task)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone,
|
||||
enum lru_list lru)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static inline struct zone_reclaim_stat*
|
||||
mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct zone_reclaim_stat*
|
||||
mem_cgroup_get_reclaim_stat_from_page(struct page *page)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CGROUP_MEM_CONT */
|
||||
|
||||
#endif /* _LINUX_MEMCONTROL_H */
|
||||
|
|
|
|||
|
|
@ -79,14 +79,14 @@ static inline int memory_notify(unsigned long val, void *v)
|
|||
#else
|
||||
extern int register_memory_notifier(struct notifier_block *nb);
|
||||
extern void unregister_memory_notifier(struct notifier_block *nb);
|
||||
extern int register_new_memory(struct mem_section *);
|
||||
extern int register_new_memory(int, struct mem_section *);
|
||||
extern int unregister_memory_section(struct mem_section *);
|
||||
extern int memory_dev_init(void);
|
||||
extern int remove_memory_block(unsigned long, struct mem_section *, int);
|
||||
extern int memory_notify(unsigned long val, void *v);
|
||||
extern struct memory_block *find_memory_block(struct mem_section *);
|
||||
#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
|
||||
|
||||
|
||||
enum mem_add_context { BOOT, HOTPLUG };
|
||||
#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ extern void __offline_isolated_pages(unsigned long, unsigned long);
|
|||
extern int offline_pages(unsigned long, unsigned long, unsigned long);
|
||||
|
||||
/* reasonably generic interface to expand the physical pages in a zone */
|
||||
extern int __add_pages(struct zone *zone, unsigned long start_pfn,
|
||||
extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
|
||||
unsigned long nr_pages);
|
||||
extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
|
||||
unsigned long nr_pages);
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ struct mspro_param_register {
|
|||
#define MEMSTICK_SYS_PAR8 0x40
|
||||
#define MEMSTICK_SYS_SERIAL 0x80
|
||||
|
||||
unsigned short data_count;
|
||||
unsigned int data_address;
|
||||
__be16 data_count;
|
||||
__be32 data_address;
|
||||
unsigned char tpc_param;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue