Page MenuHomeFreeBSD

D40266.diff
No OneTemporary

D40266.diff

diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c
--- a/sys/cddl/dev/kinst/trampoline.c
+++ b/sys/cddl/dev/kinst/trampoline.c
@@ -68,15 +68,22 @@
sx_assert(&kinst_tramp_sx, SX_XLOCKED);
+#ifdef __amd64__
/*
- * Allocate virtual memory for the trampoline chunk. The returned
- * address is saved in "trampaddr". To simplify population of
- * trampolines, we follow the amd64 kernel's code model and allocate
- * them above KERNBASE, i.e., in the top 2GB of the kernel's virtual
- * address space. Trampolines must be executable so max_prot must
- * include VM_PROT_EXECUTE.
+ * To simplify population of trampolines, we follow the amd64 kernel's
+ * code model and allocate them above KERNBASE, i.e., in the top 2GB of
+ * the kernel's virtual address space (not the case for other
+ * platforms).
*/
trampaddr = KERNBASE;
+#else
+ trampaddr = VM_MIN_KERNEL_ADDRESS;
+#endif
+ /*
+ * Allocate virtual memory for the trampoline chunk. The returned
+ * address is saved in "trampaddr". Trampolines must be executable so
+ * max_prot must include VM_PROT_EXECUTE.
+ */
error = vm_map_find(kernel_map, NULL, 0, &trampaddr,
KINST_TRAMPCHUNK_SIZE, 0, VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL,
0);

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 4:53 PM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16058888
Default Alt Text
D40266.diff (1 KB)

Event Timeline