}
seq_printf(s, "%s: ", name);
- seq_printf(s, " flags = 0x%08lx, refs = %d\n",
+ seq_printf(s, " flags = 0x%08x, refs = %d\n",
handle->flags, atomic_read(&handle->ref));
seq_printf(s, " device = %s\n",
int nvmap_ioctl_getid(struct file *filp, void __user *arg)
{
- struct nvmap_client *client = filp->private_data;
struct nvmap_create_handle op;
struct nvmap_handle *h = NULL;
return -EPERM;
op.id = marshal_id(h);
- if (client == h->owner)
- h->global = true;
-
nvmap_handle_put(h);
return copy_to_user(arg, &op, sizeof(op)) ? -EFAULT : 0;
#include <linux/atomic.h>
#include <linux/dma-buf.h>
#include <linux/syscalls.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
#include <linux/nvmap.h>
#include <linux/workqueue.h>
#include <linux/dma-mapping.h>
struct rb_node node; /* entry on global handle tree */
atomic_t ref; /* reference count (i.e., # of duplications) */
atomic_t pin; /* pin count */
- unsigned long flags; /* caching flags */
+ u32 flags; /* caching flags */
size_t size; /* padded (as-allocated) size */
size_t orig_size; /* original (as-requested) size */
size_t align;
struct nvmap_pgalloc pgalloc;
struct nvmap_heap_block *carveout;
};
- bool global; /* handle may be duplicated by other clients */
bool heap_pgalloc; /* handle is page allocated (sysmem / iovmm) */
bool alloc; /* handle has memory allocated */
- unsigned int userflags; /* flags passed from userspace */
+ u32 userflags; /* flags passed from userspace */
void *vaddr; /* mapping used inside kernel */
struct mutex lock;
void *nvhost_priv; /* nvhost private data */
atomic_t count; /* number of processes cloning the VMA */
};
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-
struct nvmap_device {
struct rb_root handles;
spinlock_t handle_lock;