2017-11-08 05:30:10 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* xarray.c: Userspace shim for XArray test-suite
|
|
|
|
* Copyright (c) 2018 Matthew Wilcox <willy@infradead.org>
|
|
|
|
*/
|
|
|
|
|
2017-11-08 03:57:46 +08:00
|
|
|
#define XA_DEBUG
|
|
|
|
#include "test.h"
|
|
|
|
|
|
|
|
#define module_init(x)
|
|
|
|
#define module_exit(x)
|
|
|
|
#define MODULE_AUTHOR(x)
|
|
|
|
#define MODULE_LICENSE(x)
|
|
|
|
#define dump_stack() assert(0)
|
|
|
|
|
2017-11-08 05:30:10 +08:00
|
|
|
#include "../../../lib/xarray.c"
|
2017-11-08 03:57:46 +08:00
|
|
|
#undef XA_DEBUG
|
|
|
|
#include "../../../lib/test_xarray.c"
|
|
|
|
|
|
|
|
void xarray_tests(void)
|
|
|
|
{
|
|
|
|
xarray_checks();
|
|
|
|
xarray_exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
int __weak main(void)
|
|
|
|
{
|
2021-04-01 02:59:19 +08:00
|
|
|
rcu_register_thread();
|
2017-11-08 03:57:46 +08:00
|
|
|
radix_tree_init();
|
|
|
|
xarray_tests();
|
|
|
|
radix_tree_cpu_dead(1);
|
|
|
|
rcu_barrier();
|
|
|
|
if (nr_allocated)
|
|
|
|
printf("nr_allocated = %d\n", nr_allocated);
|
2021-04-01 02:59:19 +08:00
|
|
|
rcu_unregister_thread();
|
2017-11-08 03:57:46 +08:00
|
|
|
return 0;
|
|
|
|
}
|