Lines Matching refs:section
73 static int check_file_status(struct pt_section *section, int fd) in check_file_status() argument
79 if (!section) in check_file_status()
86 status = section->status; in check_file_status()
99 int pt_sec_posix_map(struct pt_section *section, int fd) in pt_sec_posix_map() argument
106 if (!section) in pt_sec_posix_map()
109 offset = section->offset; in pt_sec_posix_map()
110 size = section->size; in pt_sec_posix_map()
120 if (size < section->size) in pt_sec_posix_map()
145 section->mapping = mapping; in pt_sec_posix_map()
146 section->unmap = pt_sec_posix_unmap; in pt_sec_posix_map()
147 section->read = pt_sec_posix_read; in pt_sec_posix_map()
148 section->memsize = pt_sec_posix_memsize; in pt_sec_posix_map()
157 static int pt_sec_posix_map_success(struct pt_section *section) in pt_sec_posix_map_success() argument
162 if (!section) in pt_sec_posix_map_success()
165 mcount = section->mcount + 1; in pt_sec_posix_map_success()
167 (void) pt_section_unlock(section); in pt_sec_posix_map_success()
171 section->mcount = mcount; in pt_sec_posix_map_success()
173 errcode = pt_section_unlock(section); in pt_sec_posix_map_success()
177 status = pt_section_on_map(section); in pt_sec_posix_map_success()
186 (void) pt_section_unmap(section); in pt_sec_posix_map_success()
193 int pt_section_map(struct pt_section *section) in pt_section_map() argument
199 if (!section) in pt_section_map()
202 errcode = pt_section_lock(section); in pt_section_map()
206 if (section->mcount) in pt_section_map()
207 return pt_sec_posix_map_success(section); in pt_section_map()
209 if (section->mapping) in pt_section_map()
212 filename = section->filename; in pt_section_map()
221 errcode = check_file_status(section, fd); in pt_section_map()
226 errcode = pt_sec_posix_map(section, fd); in pt_section_map()
230 return pt_sec_posix_map_success(section); in pt_section_map()
243 errcode = pt_sec_file_map(section, file); in pt_section_map()
245 return pt_sec_posix_map_success(section); in pt_section_map()
254 (void) pt_section_unlock(section); in pt_section_map()
258 int pt_sec_posix_unmap(struct pt_section *section) in pt_sec_posix_unmap() argument
262 if (!section) in pt_sec_posix_unmap()
265 mapping = section->mapping; in pt_sec_posix_unmap()
266 if (!mapping || !section->unmap || !section->read || !section->memsize) in pt_sec_posix_unmap()
269 section->mapping = NULL; in pt_sec_posix_unmap()
270 section->unmap = NULL; in pt_sec_posix_unmap()
271 section->read = NULL; in pt_sec_posix_unmap()
272 section->memsize = NULL; in pt_sec_posix_unmap()
280 int pt_sec_posix_read(const struct pt_section *section, uint8_t *buffer, in pt_sec_posix_read() argument
286 if (!buffer || !section) in pt_sec_posix_read()
289 mapping = section->mapping; in pt_sec_posix_read()
305 int pt_sec_posix_memsize(const struct pt_section *section, uint64_t *size) in pt_sec_posix_memsize() argument
310 if (!section || !size) in pt_sec_posix_memsize()
313 mapping = section->mapping; in pt_sec_posix_memsize()