#include <linux/prime_numbers.h>
#include <linux/random.h>
#include "i915_selftest.h"
#include "i915_utils.h"
#define PFN_BIAS …
struct pfn_table { … };
npages_fn_t;
static noinline int expect_pfn_sg(struct pfn_table *pt,
npages_fn_t npages_fn,
struct rnd_state *rnd,
const char *who,
unsigned long timeout)
{ … }
static noinline int expect_pfn_sg_page_iter(struct pfn_table *pt,
const char *who,
unsigned long timeout)
{ … }
static noinline int expect_pfn_sgtiter(struct pfn_table *pt,
const char *who,
unsigned long timeout)
{ … }
static int expect_pfn_sgtable(struct pfn_table *pt,
npages_fn_t npages_fn,
struct rnd_state *rnd,
const char *who,
unsigned long timeout)
{ … }
static unsigned int one(unsigned long n,
unsigned long count,
struct rnd_state *rnd)
{ … }
static unsigned int grow(unsigned long n,
unsigned long count,
struct rnd_state *rnd)
{ … }
static unsigned int shrink(unsigned long n,
unsigned long count,
struct rnd_state *rnd)
{ … }
static unsigned int random(unsigned long n,
unsigned long count,
struct rnd_state *rnd)
{ … }
static unsigned int random_page_size_pages(unsigned long n,
unsigned long count,
struct rnd_state *rnd)
{ … }
static inline bool page_contiguous(struct page *first,
struct page *last,
unsigned long npages)
{ … }
static int alloc_table(struct pfn_table *pt,
unsigned long count, unsigned long max,
npages_fn_t npages_fn,
struct rnd_state *rnd,
int alloc_error)
{ … }
static const npages_fn_t npages_funcs[] = …;
static int igt_sg_alloc(void *ignored)
{ … }
static int igt_sg_trim(void *ignored)
{ … }
int scatterlist_mock_selftests(void)
{ … }