mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-06 10:00:30 +01:00
pan/cs: Return exception handler size/address
Will be useful when we start allocating exception handlers from a memory pool that grows over time without having to fix a maximum handler size. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32353>
This commit is contained in:
parent
d0cff9e4c1
commit
7a32fac596
1 changed files with 7 additions and 0 deletions
|
|
@ -1683,6 +1683,8 @@ struct cs_exception_handler {
|
|||
struct cs_dirty_tracker dirty;
|
||||
struct cs_exception_handler_ctx ctx;
|
||||
unsigned dump_size;
|
||||
uint64_t address;
|
||||
uint32_t length;
|
||||
};
|
||||
|
||||
static inline struct cs_exception_handler *
|
||||
|
|
@ -1770,6 +1772,9 @@ cs_exception_handler_end(struct cs_builder *b,
|
|||
if (!cs_reserve_instrs(b, padded_num_instrs))
|
||||
return;
|
||||
|
||||
handler->address =
|
||||
b->cur_chunk.buffer.gpu + (b->cur_chunk.pos * sizeof(uint64_t));
|
||||
|
||||
/* Preamble: backup modified registers */
|
||||
if (num_ranges > 0) {
|
||||
unsigned offset = 0;
|
||||
|
|
@ -1813,6 +1818,8 @@ cs_exception_handler_end(struct cs_builder *b,
|
|||
/* Fill the rest of the buffer with NOPs. */
|
||||
for (; num_instrs < padded_num_instrs; num_instrs++)
|
||||
cs_nop(b);
|
||||
|
||||
handler->length = padded_num_instrs;
|
||||
}
|
||||
|
||||
#define cs_exception_handler_def(__b, __handler, __ctx) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue