init.h (3eb66e91a25497065c5322b1268cbc3953642227) | init.h (33def8498fdde180023444b08e12b72a9efed41d) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _LINUX_UML_INIT_H 3#define _LINUX_UML_INIT_H 4 5/* These macros are used to mark some functions or 6 * initialized data (doesn't apply to uninitialized data) 7 * as `initialization' functions. The kernel can take this 8 * as hint that the function is used only during the initialization --- 31 unchanged lines hidden (view full) --- 40#ifndef _LINUX_INIT_H 41typedef int (*initcall_t)(void); 42typedef void (*exitcall_t)(void); 43 44#include <linux/compiler_types.h> 45 46/* These are for everybody (although not all archs will actually 47 discard it in modules) */ | 1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _LINUX_UML_INIT_H 3#define _LINUX_UML_INIT_H 4 5/* These macros are used to mark some functions or 6 * initialized data (doesn't apply to uninitialized data) 7 * as `initialization' functions. The kernel can take this 8 * as hint that the function is used only during the initialization --- 31 unchanged lines hidden (view full) --- 40#ifndef _LINUX_INIT_H 41typedef int (*initcall_t)(void); 42typedef void (*exitcall_t)(void); 43 44#include <linux/compiler_types.h> 45 46/* These are for everybody (although not all archs will actually 47 discard it in modules) */ |
48#define __init __section(.init.text) 49#define __initdata __section(.init.data) 50#define __exitdata __section(.exit.data) 51#define __exit_call __used __section(.exitcall.exit) | 48#define __init __section(".init.text") 49#define __initdata __section(".init.data") 50#define __exitdata __section(".exit.data") 51#define __exit_call __used __section(".exitcall.exit") |
52 53#ifdef MODULE | 52 53#ifdef MODULE |
54#define __exit __section(.exit.text) | 54#define __exit __section(".exit.text") |
55#else | 55#else |
56#define __exit __used __section(.exit.text) | 56#define __exit __used __section(".exit.text") |
57#endif 58 59#endif 60 61#ifndef MODULE 62struct uml_param { 63 const char *str; 64 int (*setup_func)(char *, int *); --- 32 unchanged lines hidden (view full) --- 97 __non_empty_string(fn ##__help, help); \ 98 static char __uml_help_str_##fn[] __initdata = help; \ 99 static const char *__uml_help_##fn __uml_setup_help = __uml_help_str_##fn 100 101/* 102 * Mark functions and data as being only used at initialization 103 * or exit time. 104 */ | 57#endif 58 59#endif 60 61#ifndef MODULE 62struct uml_param { 63 const char *str; 64 int (*setup_func)(char *, int *); --- 32 unchanged lines hidden (view full) --- 97 __non_empty_string(fn ##__help, help); \ 98 static char __uml_help_str_##fn[] __initdata = help; \ 99 static const char *__uml_help_##fn __uml_setup_help = __uml_help_str_##fn 100 101/* 102 * Mark functions and data as being only used at initialization 103 * or exit time. 104 */ |
105#define __uml_init_setup __used __section(.uml.setup.init) 106#define __uml_setup_help __used __section(.uml.help.init) 107#define __uml_postsetup_call __used __section(.uml.postsetup.init) 108#define __uml_exit_call __used __section(.uml.exitcall.exit) | 105#define __uml_init_setup __used __section(".uml.setup.init") 106#define __uml_setup_help __used __section(".uml.help.init") 107#define __uml_postsetup_call __used __section(".uml.postsetup.init") 108#define __uml_exit_call __used __section(".uml.exitcall.exit") |
109 110#ifdef __UM_HOST__ 111 112#define __define_initcall(level,fn) \ 113 static initcall_t __initcall_##fn __used \ 114 __attribute__((__section__(".initcall" level ".init"))) = fn 115 116/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll 117 * make them run first. 118 */ 119#define __initcall(fn) __define_initcall("1", fn) 120 121#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn 122 | 109 110#ifdef __UM_HOST__ 111 112#define __define_initcall(level,fn) \ 113 static initcall_t __initcall_##fn __used \ 114 __attribute__((__section__(".initcall" level ".init"))) = fn 115 116/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll 117 * make them run first. 118 */ 119#define __initcall(fn) __define_initcall("1", fn) 120 121#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn 122 |
123#define __init_call __used __section(.initcall.init) | 123#define __init_call __used __section(".initcall.init") |
124 125#endif 126 127#endif /* _LINUX_UML_INIT_H */ | 124 125#endif 126 127#endif /* _LINUX_UML_INIT_H */ |