| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: subr_kobj.c,v 1.76 2023/01/29 17:20:48 skrll Exp $ */ | | 1 | /* $NetBSD: subr_kobj.c,v 1.77 2023/04/17 08:14:51 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software developed for The NetBSD Foundation | | 7 | * This code is derived from software developed for The NetBSD Foundation |
8 | * by Andrew Doran. | | 8 | * by Andrew Doran. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -53,42 +53,43 @@ | | | @@ -53,42 +53,43 @@ |
53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
56 | * SUCH DAMAGE. | | 56 | * SUCH DAMAGE. |
57 | */ | | 57 | */ |
58 | | | 58 | |
59 | /* | | 59 | /* |
60 | * Kernel loader for ELF objects. | | 60 | * Kernel loader for ELF objects. |
61 | * | | 61 | * |
62 | * TODO: adjust kmem_alloc() calls to avoid needless fragmentation. | | 62 | * TODO: adjust kmem_alloc() calls to avoid needless fragmentation. |
63 | */ | | 63 | */ |
64 | | | 64 | |
65 | #include <sys/cdefs.h> | | 65 | #include <sys/cdefs.h> |
66 | __KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.76 2023/01/29 17:20:48 skrll Exp $"); | | 66 | __KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.77 2023/04/17 08:14:51 skrll Exp $"); |
67 | | | 67 | |
68 | #ifdef _KERNEL_OPT | | 68 | #ifdef _KERNEL_OPT |
69 | #include "opt_modular.h" | | 69 | #include "opt_modular.h" |
70 | #endif | | 70 | #endif |
71 | | | 71 | |
72 | #include <sys/kobj_impl.h> | | 72 | #include <sys/kobj_impl.h> |
73 | | | 73 | |
74 | #ifdef MODULAR | | 74 | #ifdef MODULAR |
75 | | | 75 | |
76 | #include <sys/param.h> | | 76 | #include <sys/param.h> |
| | | 77 | |
77 | #include <sys/kernel.h> | | 78 | #include <sys/kernel.h> |
78 | #include <sys/kmem.h> | | 79 | #include <sys/kmem.h> |
79 | #include <sys/proc.h> | | | |
80 | #include <sys/ksyms.h> | | 80 | #include <sys/ksyms.h> |
81 | #include <sys/module.h> | | 81 | #include <sys/module.h> |
| | | 82 | #include <sys/proc.h> |
82 | | | 83 | |
83 | #include <uvm/uvm_extern.h> | | 84 | #include <uvm/uvm_extern.h> |
84 | | | 85 | |
85 | #define kobj_error(_kobj, ...) \ | | 86 | #define kobj_error(_kobj, ...) \ |
86 | kobj_out(__func__, __LINE__, _kobj, __VA_ARGS__) | | 87 | kobj_out(__func__, __LINE__, _kobj, __VA_ARGS__) |
87 | | | 88 | |
88 | static int kobj_relocate(kobj_t, bool); | | 89 | static int kobj_relocate(kobj_t, bool); |
89 | static int kobj_checksyms(kobj_t, bool); | | 90 | static int kobj_checksyms(kobj_t, bool); |
90 | static void kobj_out(const char *, int, kobj_t, const char *, ...) | | 91 | static void kobj_out(const char *, int, kobj_t, const char *, ...) |
91 | __printflike(4, 5); | | 92 | __printflike(4, 5); |
92 | static void kobj_jettison(kobj_t); | | 93 | static void kobj_jettison(kobj_t); |
93 | static void kobj_free(kobj_t, void *, size_t); | | 94 | static void kobj_free(kobj_t, void *, size_t); |
94 | static void kobj_close(kobj_t); | | 95 | static void kobj_close(kobj_t); |