#ifndef __DRM_BUDDY_H__
#define __DRM_BUDDY_H__
#include <linux/bitops.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <drm/drm_print.h>
#define range_overflows(start, size, max) …
#define DRM_BUDDY_RANGE_ALLOCATION …
#define DRM_BUDDY_TOPDOWN_ALLOCATION …
#define DRM_BUDDY_CONTIGUOUS_ALLOCATION …
#define DRM_BUDDY_CLEAR_ALLOCATION …
#define DRM_BUDDY_CLEARED …
struct drm_buddy_block { … };
#define DRM_BUDDY_MAX_ORDER …
struct drm_buddy { … };
static inline u64
drm_buddy_block_offset(struct drm_buddy_block *block)
{ … }
static inline unsigned int
drm_buddy_block_order(struct drm_buddy_block *block)
{ … }
static inline unsigned int
drm_buddy_block_state(struct drm_buddy_block *block)
{ … }
static inline bool
drm_buddy_block_is_allocated(struct drm_buddy_block *block)
{ … }
static inline bool
drm_buddy_block_is_clear(struct drm_buddy_block *block)
{ … }
static inline bool
drm_buddy_block_is_free(struct drm_buddy_block *block)
{ … }
static inline bool
drm_buddy_block_is_split(struct drm_buddy_block *block)
{ … }
static inline u64
drm_buddy_block_size(struct drm_buddy *mm,
struct drm_buddy_block *block)
{ … }
int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size);
void drm_buddy_fini(struct drm_buddy *mm);
struct drm_buddy_block *
drm_get_buddy(struct drm_buddy_block *block);
int drm_buddy_alloc_blocks(struct drm_buddy *mm,
u64 start, u64 end, u64 size,
u64 min_page_size,
struct list_head *blocks,
unsigned long flags);
int drm_buddy_block_trim(struct drm_buddy *mm,
u64 new_size,
struct list_head *blocks);
void drm_buddy_free_block(struct drm_buddy *mm, struct drm_buddy_block *block);
void drm_buddy_free_list(struct drm_buddy *mm,
struct list_head *objects,
unsigned int flags);
void drm_buddy_print(struct drm_buddy *mm, struct drm_printer *p);
void drm_buddy_block_print(struct drm_buddy *mm,
struct drm_buddy_block *block,
struct drm_printer *p);
#endif