#define pr_fmt(fmt) …
#include <linux/mm_types.h>
#include <linux/err.h>
#include "binder_alloc.h"
#define BUFFER_NUM …
#define BUFFER_MIN_SIZE …
static bool binder_selftest_run = …;
static int binder_selftest_failures;
static DEFINE_MUTEX(binder_selftest_lock);
enum buf_end_align_type { … };
static void pr_err_size_seq(size_t *sizes, int *seq)
{ … }
static bool check_buffer_pages_allocated(struct binder_alloc *alloc,
struct binder_buffer *buffer,
size_t size)
{ … }
static void binder_selftest_alloc_buf(struct binder_alloc *alloc,
struct binder_buffer *buffers[],
size_t *sizes, int *seq)
{ … }
static void binder_selftest_free_buf(struct binder_alloc *alloc,
struct binder_buffer *buffers[],
size_t *sizes, int *seq, size_t end)
{ … }
static void binder_selftest_free_page(struct binder_alloc *alloc)
{ … }
static void binder_selftest_alloc_free(struct binder_alloc *alloc,
size_t *sizes, int *seq, size_t end)
{ … }
static bool is_dup(int *seq, int index, int val)
{ … }
static void binder_selftest_free_seq(struct binder_alloc *alloc,
size_t *sizes, int *seq,
int index, size_t end)
{ … }
static void binder_selftest_alloc_size(struct binder_alloc *alloc,
size_t *end_offset)
{ … }
static void binder_selftest_alloc_offset(struct binder_alloc *alloc,
size_t *end_offset, int index)
{ … }
void binder_selftest_alloc(struct binder_alloc *alloc)
{ … }