udebug: add inline helper function to test if a buffer is allocated

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2023-11-29 22:00:19 +01:00
parent 325fea5c57
commit e84c000c47

View file

@ -166,6 +166,10 @@ int udebug_buf_add(struct udebug *ctx, struct udebug_buf *buf,
const struct udebug_buf_meta *meta); const struct udebug_buf_meta *meta);
uint64_t udebug_buf_flags(struct udebug_buf *buf); uint64_t udebug_buf_flags(struct udebug_buf *buf);
void udebug_buf_free(struct udebug_buf *buf); void udebug_buf_free(struct udebug_buf *buf);
static inline bool udebug_buf_valid(struct udebug_buf *buf)
{
return buf->hdr;
}
struct udebug_remote_buf *udebug_remote_buf_get(struct udebug *ctx, uint32_t id); struct udebug_remote_buf *udebug_remote_buf_get(struct udebug *ctx, uint32_t id);
int udebug_remote_buf_map(struct udebug *ctx, struct udebug_remote_buf *rb, uint32_t id); int udebug_remote_buf_map(struct udebug *ctx, struct udebug_remote_buf *rb, uint32_t id);