diff options
| author | Karolina Drobnik <karolinadrobnik@gmail.com> | 2022-02-02 12:03:09 +0100 |
|---|---|---|
| committer | Mike Rapoport <rppt@linux.ibm.com> | 2022-02-20 08:44:37 +0200 |
| commit | 16802e55dea9534c18a30bd8eeefea8a06337916 (patch) | |
| tree | 3baa119284c22435f524bf65c86e0ef00968dae0 /tools/testing/memblock/linux/init.h | |
| parent | 62183279ad2f52d36b40365eb3a27c7a4a2284f8 (diff) | |
memblock tests: Add skeleton of the memblock simulator
Add basic project files, together with local stubs of required headers.
Update tools/include/slab.h to include definitions used by memblock.
Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/d296fceb023a04b316a31fbff9acf1e76ac684e4.1643796665.git.karolinadrobnik@gmail.com
Diffstat (limited to 'tools/testing/memblock/linux/init.h')
| -rw-r--r-- | tools/testing/memblock/linux/init.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/testing/memblock/linux/init.h b/tools/testing/memblock/linux/init.h new file mode 100644 index 000000000000..828e0ee0bc6c --- /dev/null +++ b/tools/testing/memblock/linux/init.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_INIT_H +#define _LINUX_INIT_H + +#include <linux/compiler.h> +#include <asm/export.h> +#include <linux/memory_hotplug.h> + +#define __section(section) __attribute__((__section__(section))) + +#define __initconst +#define __meminit +#define __meminitdata +#define __refdata +#define __initdata + +struct obs_kernel_param { + const char *str; + int (*setup_func)(char *st); + int early; +}; + +#define __setup_param(str, unique_id, fn, early) \ + static const char __setup_str_##unique_id[] __initconst \ + __aligned(1) = str; \ + static struct obs_kernel_param __setup_##unique_id \ + __used __section(".init.setup") \ + __aligned(__alignof__(struct obs_kernel_param)) = \ + { __setup_str_##unique_id, fn, early } + +#define early_param(str, fn) \ + __setup_param(str, fn, fn, 1) + +#endif |
