Lines Matching +full:memory +full:- +full:mapped
2 * Copyright (c) 2013-2019, Intel Corporation
39 #include "intel-pt.h"
44 /* A section of contiguous memory loaded from a file. */
57 /* A pointer to OS-specific file status for detecting changes.
61 * is owned by the OS-specific mmap-based section implementation.
65 /* A pointer to implementation-specific mapping information - NULL if
66 * the section is currently not mapped.
98 /* A pointer to the unmap function - NULL if the section is currently
99 * not mapped.
106 /* A pointer to the read function - NULL if the section is currently
107 * not mapped.
115 /* A pointer to the memsize function - NULL if the section is currently
116 * not mapped.
162 * The returned section is not mapped and starts with a user count of one and
166 * Returns -pte_internal if @psection is NULL.
167 * Returns -pte_nomem when running out of memory.
168 * Returns -pte_bad_file if @filename cannot be opened.
169 * Returns -pte_invalid if @offset lies beyond @file.
170 * Returns -pte_invalid if @filename is too long.
180 * Returns -pte_bad_lock on any locking error.
189 * Returns -pte_bad_lock on any locking error.
198 * Returns -pte_internal if @section is NULL.
199 * Returns -pte_overflow if the user count would overflow.
200 * Returns -pte_bad_lock on any locking error.
210 * Returns -pte_internal if @section is NULL.
211 * Returns -pte_internal if the user count is already zero.
212 * Returns -pte_bad_lock on any locking error.
218 * Similar to pt_section_get() but sets @section->iscache to @iscache.
221 * Returns -pte_internal if @section or @iscache is NULL.
222 * Returns -pte_internal if a different cache is already attached.
223 * Returns -pte_overflow if the attach count would overflow.
224 * Returns -pte_bad_lock on any locking error.
231 * Similar to pt_section_put() but clears @section->iscache.
234 * Returns -pte_internal if @section or @iscache is NULL.
235 * Returns -pte_internal if the attach count is already zero.
236 * Returns -pte_internal if @section->iscache is not equal to @iscache.
237 * Returns -pte_bad_lock on any locking error.
251 /* Return the amount of memory currently used by the section in bytes.
253 * We only consider the amount of memory required for mapping @section; we
257 * If @section is currently not mapped, the size is zero.
260 * Returns -pte_internal if @size of @section is NULL.
267 * Returns -pte_internal if @section is NULL.
268 * Returns -pte_nomem if the block cache can't be allocated.
269 * Returns -pte_bad_lock on any locking error.
275 * The caller must ensure that @section is mapped.
280 return -pte_internal; in pt_section_request_bcache()
282 if (section->bcache) in pt_section_request_bcache()
290 * The caller must ensure that @section is mapped.
292 * The cache is not use-counted. It is only valid as long as the caller keeps
293 * @section mapped.
301 return section->bcache; in pt_section_bcache()
304 /* Create the OS-specific file status.
311 * This function is implemented in the OS-specific section implementation.
314 * Returns -pte_internal if @pstatus, @psize, or @filename is NULL.
315 * Returns -pte_bad_image if @filename can't be opened.
316 * Returns -pte_nomem if the status object can't be allocated.
321 /* Perform on-map maintenance work.
325 * This function is called by the OS-specific pt_section_map() implementation
326 * after @section has been successfully mapped and @section has been unlocked.
329 * Returns -pte_internal if @section is NULL.
330 * Returns -pte_bad_lock on any locking error.
336 if (section && !section->iscache) in pt_section_on_map()
344 * Maps @section into memory. Mappings are use-counted. The number of
348 * This function is implemented in the OS-specific section implementation.
351 * Returns -pte_internal if @section is NULL.
352 * Returns -pte_bad_image if @section changed or can't be opened.
353 * Returns -pte_bad_lock on any locking error.
354 * Returns -pte_nomem if @section can't be mapped into memory.
355 * Returns -pte_overflow if the map count would overflow.
368 * Returns -pte_internal if @section is NULL.
369 * Returns -pte_internal if @section->mcount is zero.
370 * Returns -pte_bad_lock on any locking error.
376 * Unmaps @section from memory.
379 * Returns -pte_internal if @section is NULL.
380 * Returns -pte_bad_lock on any locking error.
381 * Returns -pte_internal if @section has not been mapped.
385 /* Read memory from a section.
388 * must be mapped.
391 * Returns -pte_internal if @section or @buffer are NULL.
392 * Returns -pte_nomap if @offset is beyond the end of the section.