aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ion.h15
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/mm_types.h15
-rw-r--r--include/linux/platform_data/android_battery.h47
4 files changed, 26 insertions, 53 deletions
diff --git a/include/linux/ion.h b/include/linux/ion.h
index 8414a6d9c39..5771f8c3d3a 100644
--- a/include/linux/ion.h
+++ b/include/linux/ion.h
@@ -19,7 +19,8 @@
#include <linux/types.h>
-struct ion_handle;
+typedef int ion_user_handle_t;
+
/**
* enum ion_heap_types - list of all possible types of heaps
* @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc
@@ -27,6 +28,7 @@ struct ion_handle;
* @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved
* carveout heap, allocations are physically
* contiguous
+ * @ION_HEAP_TYPE_DMA: memory allocated via DMA API
* @ION_NUM_HEAPS: helper for iterating over heaps, a bit mask
* is used to identify the heaps, so only 32
* total heap types are supported
@@ -36,6 +38,7 @@ enum ion_heap_type {
ION_HEAP_TYPE_SYSTEM_CONTIG,
ION_HEAP_TYPE_CARVEOUT,
ION_HEAP_TYPE_CHUNK,
+ ION_HEAP_TYPE_DMA,
ION_HEAP_TYPE_CUSTOM, /* must be last so device specific heaps always
are at the end of this enum */
ION_NUM_HEAPS = 16,
@@ -44,6 +47,7 @@ enum ion_heap_type {
#define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM)
#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
+#define ION_HEAP_TYPE_DMA_MASK (1 << ION_HEAP_TYPE_DMA)
#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8
@@ -60,6 +64,7 @@ enum ion_heap_type {
caches must be managed manually */
#ifdef __KERNEL__
+struct ion_handle;
struct ion_device;
struct ion_heap;
struct ion_mapper;
@@ -105,7 +110,7 @@ struct ion_platform_heap {
*/
struct ion_platform_data {
int nr;
- struct ion_platform_heap heaps[];
+ struct ion_platform_heap *heaps;
};
/**
@@ -265,7 +270,7 @@ struct ion_allocation_data {
size_t align;
unsigned int heap_id_mask;
unsigned int flags;
- struct ion_handle *handle;
+ ion_user_handle_t handle;
};
/**
@@ -279,7 +284,7 @@ struct ion_allocation_data {
* provides the file descriptor and the kernel returns the handle.
*/
struct ion_fd_data {
- struct ion_handle *handle;
+ ion_user_handle_t handle;
int fd;
};
@@ -288,7 +293,7 @@ struct ion_fd_data {
* @handle: a handle
*/
struct ion_handle_data {
- struct ion_handle *handle;
+ ion_user_handle_t handle;
};
/**
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bd5679ddcd3..01eb01df922 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1486,7 +1486,7 @@ extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
extern struct vm_area_struct *vma_merge(struct mm_struct *,
struct vm_area_struct *prev, unsigned long addr, unsigned long end,
unsigned long vm_flags, struct anon_vma *, struct file *, pgoff_t,
- struct mempolicy *);
+ struct mempolicy *, const char __user *);
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
extern int split_vma(struct mm_struct *,
struct vm_area_struct *, unsigned long addr, int new_below);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index ace9a5f01c6..875ba48dd72 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -255,6 +255,10 @@ struct vm_area_struct {
* For areas with an address space and backing store,
* linkage into the address_space->i_mmap interval tree, or
* linkage of vma in the address_space->i_mmap_nonlinear list.
+ *
+ * For private anonymous mappings, a pointer to a null terminated string
+ * in the user process containing the name given to the vma, or NULL
+ * if unnamed.
*/
union {
struct {
@@ -262,6 +266,7 @@ struct vm_area_struct {
unsigned long rb_subtree_last;
} linear;
struct list_head nonlinear;
+ const char __user *anon_name;
} shared;
/*
@@ -456,4 +461,14 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm)
return mm->cpu_vm_mask_var;
}
+
+/* Return the name for an anonymous mapping or NULL for a file-backed mapping */
+static inline const char __user *vma_get_anon_name(struct vm_area_struct *vma)
+{
+ if (vma->vm_file)
+ return NULL;
+
+ return vma->shared.anon_name;
+}
+
#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/linux/platform_data/android_battery.h b/include/linux/platform_data/android_battery.h
deleted file mode 100644
index f6c8298fd88..00000000000
--- a/include/linux/platform_data/android_battery.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * android_battery.h
- *
- * Copyright (C) 2012 Samsung Electronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _LINUX_ANDROID_BATTERY_H
-#define _LINUX_ANDROID_BATTERY_H
-
-enum {
- CHARGE_SOURCE_NONE = 0,
- CHARGE_SOURCE_AC,
- CHARGE_SOURCE_USB,
-};
-
-struct android_bat_callbacks {
- void (*charge_source_changed)
- (struct android_bat_callbacks *, int);
- void (*battery_set_full)(struct android_bat_callbacks *);
-};
-
-struct android_bat_platform_data {
- void (*register_callbacks)(struct android_bat_callbacks *);
- void (*unregister_callbacks)(void);
- void (*set_charging_current) (int);
- void (*set_charging_enable) (int);
- int (*poll_charge_source) (void);
- int (*get_capacity) (void);
- int (*get_temperature) (int *);
- int (*get_voltage_now)(void);
- int (*get_current_now)(int *);
-
- int temp_high_threshold;
- int temp_high_recovery;
- int temp_low_recovery;
- int temp_low_threshold;
-
- unsigned long full_charging_time;
- unsigned long recharging_time;
- unsigned int recharging_voltage;
-};
-
-#endif