ddk: update
git-svn-id: svn://kolibrios.org@6293 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -153,6 +153,36 @@ struct dma_buf_attachment {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dma_buf_export_info - holds information needed to export a dma_buf
|
||||
* @exp_name: name of the exporter - useful for debugging.
|
||||
* @owner: pointer to exporter module - used for refcounting kernel module
|
||||
* @ops: Attach allocator-defined dma buf ops to the new buffer
|
||||
* @size: Size of the buffer
|
||||
* @flags: mode flags for the file
|
||||
* @resv: reservation-object, NULL to allocate default one
|
||||
* @priv: Attach private data of allocator to this buffer
|
||||
*
|
||||
* This structure holds the information required to export the buffer. Used
|
||||
* with dma_buf_export() only.
|
||||
*/
|
||||
struct dma_buf_export_info {
|
||||
const char *exp_name;
|
||||
struct module *owner;
|
||||
const struct dma_buf_ops *ops;
|
||||
size_t size;
|
||||
int flags;
|
||||
struct reservation_object *resv;
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* helper macro for exporters; zeros and fills in most common values
|
||||
*/
|
||||
#define DEFINE_DMA_BUF_EXPORT_INFO(a) \
|
||||
struct dma_buf_export_info a = { .exp_name = KBUILD_MODNAME, \
|
||||
.owner = THIS_MODULE }
|
||||
|
||||
/**
|
||||
* get_dma_buf - convenience wrapper for get_file.
|
||||
* @dmabuf: [in] pointer to dma_buf
|
||||
|
@@ -4,5 +4,12 @@
|
||||
|
||||
#ifndef __LINUX_FILE_H
|
||||
#define __LINUX_FILE_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/posix_types.h>
|
||||
|
||||
struct file;
|
||||
extern void fput(struct file *);
|
||||
extern struct file *fget(unsigned int fd);
|
||||
#endif /* __LINUX_FILE_H */
|
||||
|
@@ -1,3 +1,97 @@
|
||||
#ifndef _LINUX_FS_H
|
||||
#define _LINUX_FS_H
|
||||
#include <linux/list.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/rwsem.h>
|
||||
#define MAY_EXEC 0x00000001
|
||||
#define MAY_WRITE 0x00000002
|
||||
#define MAY_READ 0x00000004
|
||||
#define MAY_APPEND 0x00000008
|
||||
#define MAY_ACCESS 0x00000010
|
||||
#define MAY_OPEN 0x00000020
|
||||
#define MAY_CHDIR 0x00000040
|
||||
/* called from RCU mode, don't block */
|
||||
#define MAY_NOT_BLOCK 0x00000080
|
||||
/*
|
||||
* Attribute flags. These should be or-ed together to figure out what
|
||||
* has been changed!
|
||||
*/
|
||||
#define ATTR_MODE (1 << 0)
|
||||
#define ATTR_UID (1 << 1)
|
||||
#define ATTR_GID (1 << 2)
|
||||
#define ATTR_SIZE (1 << 3)
|
||||
#define ATTR_ATIME (1 << 4)
|
||||
#define ATTR_MTIME (1 << 5)
|
||||
#define ATTR_CTIME (1 << 6)
|
||||
#define ATTR_ATIME_SET (1 << 7)
|
||||
#define ATTR_MTIME_SET (1 << 8)
|
||||
#define ATTR_FORCE (1 << 9) /* Not a change, but a change it */
|
||||
#define ATTR_ATTR_FLAG (1 << 10)
|
||||
#define ATTR_KILL_SUID (1 << 11)
|
||||
#define ATTR_KILL_SGID (1 << 12)
|
||||
#define ATTR_FILE (1 << 13)
|
||||
#define ATTR_KILL_PRIV (1 << 14)
|
||||
#define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */
|
||||
#define ATTR_TIMES_SET (1 << 16)
|
||||
/*
|
||||
* inode->i_mutex nesting subclasses for the lock validator:
|
||||
*
|
||||
* 0: the object of the current VFS operation
|
||||
* 1: parent
|
||||
* 2: child/target
|
||||
* 3: xattr
|
||||
* 4: second non-directory
|
||||
* 5: second parent (when locking independent directories in rename)
|
||||
*
|
||||
* I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two
|
||||
* non-directories at once.
|
||||
*
|
||||
* The locking order between these classes is
|
||||
* parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory
|
||||
*/
|
||||
enum inode_i_mutex_lock_class
|
||||
{
|
||||
I_MUTEX_NORMAL,
|
||||
I_MUTEX_PARENT,
|
||||
I_MUTEX_CHILD,
|
||||
I_MUTEX_XATTR,
|
||||
I_MUTEX_NONDIR2,
|
||||
I_MUTEX_PARENT2,
|
||||
};
|
||||
struct file {
|
||||
|
||||
/*
|
||||
* Protects f_ep_links, f_flags.
|
||||
* Must not be taken from IRQ context.
|
||||
*/
|
||||
spinlock_t f_lock;
|
||||
atomic_long_t f_count;
|
||||
unsigned int f_flags;
|
||||
fmode_t f_mode;
|
||||
|
||||
/* needed for tty driver, and maybe others */
|
||||
void *private_data;
|
||||
|
||||
struct page **pages; /* physical memory backend */
|
||||
unsigned int count;
|
||||
unsigned int allocated;
|
||||
void *vma;
|
||||
|
||||
} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
|
||||
#define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count)
|
||||
#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
|
||||
#define file_count(x) atomic_long_read(&(x)->f_count)
|
||||
#define FL_POSIX 1
|
||||
#define FL_FLOCK 2
|
||||
#define FL_DELEG 4 /* NFSv4 delegation */
|
||||
#define FL_ACCESS 8 /* not trying to lock, just looking */
|
||||
#define FL_EXISTS 16 /* when unlocking, test for existence */
|
||||
#define FL_LEASE 32 /* lease held on this file */
|
||||
#define FL_CLOSE 64 /* unlock on close */
|
||||
#define FL_SLEEP 128 /* A blocking lock */
|
||||
#define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */
|
||||
#define FL_UNLOCK_PENDING 512 /* Lease is being broken */
|
||||
#define FL_OFDLCK 1024 /* lock is "owned" by struct file */
|
||||
#define FL_LAYOUT 2048 /* outstanding pNFS layout */
|
||||
#endif /* _LINUX_FS_H */
|
||||
|
@@ -684,14 +684,6 @@ typedef union
|
||||
u64 raw;
|
||||
}evhandle_t;
|
||||
|
||||
struct file
|
||||
{
|
||||
struct page **pages; /* physical memory backend */
|
||||
unsigned int count;
|
||||
unsigned int allocated;
|
||||
void *vma;
|
||||
};
|
||||
|
||||
struct vm_area_struct {};
|
||||
struct address_space {};
|
||||
|
||||
@@ -836,11 +828,6 @@ static inline __must_check long __copy_to_user(void __user *to,
|
||||
case 4:
|
||||
*(u32 __force *)to = *(u32 *)from;
|
||||
return 0;
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
*(u64 __force *)to = *(u64 *)from;
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -850,6 +837,41 @@ static inline __must_check long __copy_to_user(void __user *to,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __always_inline unsigned long
|
||||
__copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||
{
|
||||
if (__builtin_constant_p(n)) {
|
||||
unsigned long ret;
|
||||
|
||||
switch (n) {
|
||||
case 1:
|
||||
*(u8 __force *)to = *(u8 *)from;
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 __force *)to = *(u16 *)from;
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 __force *)to = *(u32 *)from;
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
__builtin_memcpy((void __force *)to, from, n);
|
||||
}
|
||||
|
||||
static inline long copy_from_user(void *to,
|
||||
const void __user * from, unsigned long n)
|
||||
{
|
||||
return __copy_from_user(to, from, n);
|
||||
}
|
||||
|
||||
static inline long copy_to_user(void __user *to,
|
||||
const void *from, unsigned long n)
|
||||
{
|
||||
return __copy_to_user(to, from, n);
|
||||
}
|
||||
|
||||
void *kmap(struct page *page);
|
||||
void *kmap_atomic(struct page *page);
|
||||
void kunmap(struct page *page);
|
||||
|
@@ -218,6 +218,9 @@ void run_workqueue(struct workqueue_struct *cwq);
|
||||
|
||||
struct workqueue_struct *alloc_workqueue_key(const char *fmt,
|
||||
unsigned int flags, int max_active);
|
||||
struct workqueue_struct *alloc_workqueue(const char *fmt,
|
||||
unsigned int flags,
|
||||
int max_active);
|
||||
|
||||
/**
|
||||
* alloc_ordered_workqueue - allocate an ordered workqueue
|
||||
|
Reference in New Issue
Block a user