Lines Matching +full:- +full:section

2  * Copyright (c) 2017-2019, Intel Corporation
33 #include "intel-pt.h"
36 int pt_section_get(struct pt_section *section) in pt_section_get() argument
40 if (!section) in pt_section_get()
41 return -pte_internal; in pt_section_get()
43 ucount = section->ucount + 1; in pt_section_get()
45 return -pte_overflow; in pt_section_get()
47 section->ucount = ucount; in pt_section_get()
51 int pt_section_put(struct pt_section *section) in pt_section_put() argument
55 if (!section) in pt_section_put()
56 return -pte_internal; in pt_section_put()
58 ucount = section->ucount; in pt_section_put()
60 return -pte_overflow; in pt_section_put()
62 section->ucount = ucount - 1; in pt_section_put()
66 int pt_section_map(struct pt_section *section) in pt_section_map() argument
70 if (!section) in pt_section_map()
71 return -pte_internal; in pt_section_map()
73 ucount = section->ucount; in pt_section_map()
75 return -pte_internal; in pt_section_map()
77 mcount = section->mcount + 1; in pt_section_map()
79 return -pte_overflow; in pt_section_map()
81 section->mcount = mcount; in pt_section_map()
85 int pt_section_unmap(struct pt_section *section) in pt_section_unmap() argument
89 if (!section) in pt_section_unmap()
90 return -pte_internal; in pt_section_unmap()
92 ucount = section->ucount; in pt_section_unmap()
94 return -pte_internal; in pt_section_unmap()
96 mcount = section->mcount; in pt_section_unmap()
98 return -pte_overflow; in pt_section_unmap()
100 section->mcount = mcount - 1; in pt_section_unmap()
106 /* The section stored in the image.
108 * This is either the fixture's section or NULL.
110 struct pt_section *section; member
121 struct pt_section *section; in pt_image_validate() local
127 return -pte_internal; in pt_image_validate()
129 section = image->section; in pt_image_validate()
130 if (!section) in pt_image_validate()
131 return -pte_nomap; in pt_image_validate()
133 if (section != msec->section) in pt_image_validate()
134 return -pte_nomap; in pt_image_validate()
142 struct pt_section *section; in pt_image_find() local
147 return -pte_internal; in pt_image_find()
149 section = image->section; in pt_image_find()
150 if (!section) in pt_image_find()
151 return -pte_nomap; in pt_image_find()
153 if (msec->section) in pt_image_find()
154 return -pte_internal; in pt_image_find()
156 msec->section = section; in pt_image_find()
158 return pt_section_get(section); in pt_image_find()
161 /* A test fixture providing a section and checking the use and map count. */
163 /* A test section. */
164 struct pt_section section; member
182 ptu_int_eq(status, -pte_internal); in init_null()
199 ptu_int_eq(status, -pte_internal); in invalidate_null()
212 ptu_int_eq(status, -pte_internal); in read_null()
215 ptu_int_eq(status, -pte_internal); in read_null()
218 ptu_int_eq(status, -pte_internal); in read_null()
234 ptu_int_eq(status, -pte_internal); in fill_null()
237 ptu_int_eq(status, -pte_internal); in fill_null()
240 ptu_int_eq(status, -pte_internal); in fill_null()
243 ptu_int_eq(status, -pte_internal); in fill_null()
250 struct pt_section *section; in invalidate() local
253 status = pt_msec_cache_invalidate(&tfix->mcache); in invalidate()
256 section = pt_msec_section(&tfix->mcache.msec); in invalidate()
257 ptu_null(section); in invalidate()
259 ptu_uint_eq(tfix->section.mcount, 0); in invalidate()
260 ptu_uint_eq(tfix->section.ucount, 0); in invalidate()
272 status = pt_msec_cache_read(&tfix->mcache, &msec, &tfix->image, 0ull); in read_nomap()
273 ptu_int_eq(status, -pte_nomap); in read_nomap()
282 struct pt_section *section; in read() local
285 status = pt_msec_cache_read(&tfix->mcache, &msec, &tfix->image, 0ull); in read()
288 ptu_ptr_eq(msec, &tfix->mcache.msec); in read()
290 section = pt_msec_section(msec); in read()
291 ptu_ptr_eq(section, &tfix->section); in read()
300 struct pt_section *section; in fill_nomap() local
305 status = pt_msec_cache_fill(&tfix->mcache, &msec, &tfix->image, &asid, in fill_nomap()
307 ptu_int_eq(status, -pte_nomap); in fill_nomap()
309 section = pt_msec_section(&tfix->mcache.msec); in fill_nomap()
310 ptu_null(section); in fill_nomap()
313 ptu_uint_eq(tfix->section.mcount, 0); in fill_nomap()
314 ptu_uint_eq(tfix->section.ucount, 0); in fill_nomap()
322 struct pt_section *section; in fill() local
326 status = pt_msec_cache_fill(&tfix->mcache, &msec, &tfix->image, &asid, in fill()
330 ptu_ptr_eq(msec, &tfix->mcache.msec); in fill()
332 section = pt_msec_section(msec); in fill()
333 ptu_ptr_eq(section, &tfix->section); in fill()
335 ptu_uint_eq(section->mcount, 1); in fill()
336 ptu_uint_eq(section->ucount, 1); in fill()
343 memset(&tfix->section, 0, sizeof(tfix->section)); in sfix_init()
344 memset(&tfix->mcache, 0, sizeof(tfix->mcache)); in sfix_init()
345 memset(&tfix->image, 0, sizeof(tfix->image)); in sfix_init()
354 tfix->image.section = &tfix->section; in ifix_init()
363 tfix->mcache.msec.section = &tfix->section; in cfix_init()
365 tfix->section.ucount = 1; in cfix_init()
366 tfix->section.mcount = 1; in cfix_init()
375 tfix->image.section = &tfix->section; in cifix_init()