Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
[linux-block.git] / kernel / module-internal.h
CommitLineData
b4d0d230 1/* SPDX-License-Identifier: GPL-2.0-or-later */
106a4ee2
RR
2/* Module internals
3 *
4 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
106a4ee2
RR
6 */
7
f314dfea
JY
8#include <linux/elf.h>
9#include <asm/module.h>
10
11struct load_info {
12 const char *name;
13 /* pointer to module in temporary copy, freed at end of load_module() */
14 struct module *mod;
15 Elf_Ehdr *hdr;
16 unsigned long len;
17 Elf_Shdr *sechdrs;
18 char *secstrings, *strtab;
1c7651f4 19 unsigned long symoffs, stroffs, init_typeoffs, core_typeoffs;
f314dfea
JY
20 struct _ddebug *debug;
21 unsigned int num_debug;
22 bool sig_ok;
23#ifdef CONFIG_KALLSYMS
24 unsigned long mod_kallsyms_init_off;
b1ae6dc4
DT
25#endif
26#ifdef CONFIG_MODULE_DECOMPRESS
27 struct page **pages;
28 unsigned int max_pages;
29 unsigned int used_pages;
f314dfea
JY
30#endif
31 struct {
32 unsigned int sym, str, mod, vers, info, pcpu;
33 } index;
34};
35
36extern int mod_verify_sig(const void *mod, struct load_info *info);
b1ae6dc4
DT
37
38#ifdef CONFIG_MODULE_DECOMPRESS
39int module_decompress(struct load_info *info, const void *buf, size_t size);
40void module_decompress_cleanup(struct load_info *info);
41#else
42static inline int module_decompress(struct load_info *info,
43 const void *buf, size_t size)
44{
45 return -EOPNOTSUPP;
46}
47static inline void module_decompress_cleanup(struct load_info *info)
48{
49}
50#endif