Lines Matching defs:Ashmem
19 * @brief Provides the <b>Ashmem</b> class implemented in c_utils to operate the
20 * Anonymous Shared Memory (Ashmem).
35 class Ashmem;
41 std::shared_ptr<Ashmem> CreateAshmemStd(const char *name, int32_t size);
45 * @brief Creates an <b>Ashmem</b> region in the kernel.
48 * copied and assigned to the <b>Ashmem</b> region in the kernel.
49 * @param size Indicates the size of the <b>Ashmem</b> region to create.
50 * @return Returns the file descriptor of the <b>Ashmem</b> region.
55 * @brief Sets the protection flag of an <b>Ashmem</b> region in the kernel.
57 * @param fd Indicates the file descriptor of an <b>Ashmem</b> region.
65 * @brief Obtains the size of a specific <b>Ashmem</b> region in the kernel.
67 * @param fd Indicates the file descriptor of an <b>Ashmem</b> region.
68 * @return Returns the size of the <b>Ashmem</b> region.
73 * @brief Provides the <b>Ashmem</b> class implemented in c_utils to
74 * operate the Anonymous Shared Memory (Ashmem).
76 * You can use the interfaces in this class to create <b>Ashmem</b> regions
79 * @note <b>Ashmem</b> regions should be unmapped and closed manually,
82 class Ashmem : public virtual RefBase {
85 * @brief Creates an <b>Ashmem</b> region in the kernel.
88 * descriptor will be held by the created <b>Ashmem</b> region.
91 * copied and assigned to the <b>Ashmem</b> region in the kernel.
92 * @param size Indicates the size of the <b>Ashmem</b> region.
93 * @return Returns the created <b>Ashmem</b> region referenced by a
98 static sptr<Ashmem> CreateAshmem(const char *name, int32_t size);
101 * @brief Construct a new Ashmem object.
106 Ashmem(int fd, int32_t size);
107 ~Ashmem() override;
112 * @return Corresponding file descriptor of this Ashmem object. It will be
152 * @brief Closes this <b>Ashmem</b> region (through the file descriptor).
156 * @note An <b>Ashmem</b> region will be unmapped by `UnmapAshmem()`
162 * @brief Maps this <b>Ashmem</b> region in the kernel to user space.
171 * @brief Maps this <b>Ashmem</b> region in read/write mode.
180 * @brief Maps this <b>Ashmem</b> region in read-only mode.
189 * @brief Unmaps this <b>Ashmem</b> region.
191 * Unmapping works only when the <b>Ashmem</b> region has been mapped.
197 * @brief Writes data to the `offset` position of this <b>Ashmem</b> region.
204 * <b>Ashmem</b> region.
208 * <b>Ashmem</b> region in the kernel and the mapped region in user space.
213 * @brief Reads data from the `offset` position of this <b>Ashmem</b> region.
219 * the <b>Ashmem</b> region.
223 * <b>Ashmem</b> region in the kernel and the mapped region in user space.
229 mutable int memoryFd_; // File descriptor of the Ashmem region.
230 mutable int32_t memorySize_; // Size of the Ashmem region.
231 mutable int flag_; // Protection flag of the Ashmem region in user space.
232 mutable void *startAddr_; // Start address of the Ashmem region.
234 int memoryFd_; // File descriptor of the Ashmem region.
235 int32_t memorySize_; // Size of the Ashmem region.
236 int flag_; // Protection flag of the Ashmem region in user space.
237 void *startAddr_; // Start address of the Ashmem region.