1 /* 2 * Copyright © 2012 Rob Clark <[email protected]> 3 * SPDX-License-Identifier: MIT 4 */ 5 6 #ifndef __BUFFERS_H__ 7 #define __BUFFERS_H__ 8 9 #include <stdbool.h> 10 #include <stdint.h> 11 12 uint64_t gpuaddr(void *hostptr); 13 uint64_t gpubaseaddr(uint64_t gpuaddr); 14 void *hostptr(uint64_t gpuaddr); 15 unsigned hostlen(uint64_t gpuaddr); 16 bool has_dumped(uint64_t gpuaddr, unsigned enable_mask); 17 18 void reset_buffers(void); 19 void add_buffer(uint64_t gpuaddr, unsigned int len, void *hostptr); 20 21 #ifndef ARRAY_SIZE 22 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 23 #endif 24 25 #endif /* __BUFFERS_H__ */ 26