1 /*
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2026 Devin Teske <dteske@FreeBSD.org>
5 */
6
7 #include <sys/param.h>
8 #include <sys/systm.h>
9 #include <sys/imgact.h>
10 #include <sys/proc.h>
11
12 #include <compat/linux/linux_emul.h>
13 #include <compat/linux/linux_mmap.h>
14
15 /* No machine-dependent emuldata state yet. */
16
17 void
linux_pemuldata_init_md(struct thread * td,struct linux_pemuldata * pem)18 linux_pemuldata_init_md(struct thread *td, struct linux_pemuldata *pem)
19 {
20 }
21
22 void
linux_pemuldata_exec_md(struct linux_pemuldata * pem)23 linux_pemuldata_exec_md(struct linux_pemuldata *pem)
24 {
25 }
26
27 /*
28 * Protection key back ends: behave as Linux does on hardware without
29 * protection keys. pkey_alloc() reports no free keys and only the
30 * default key semantics remain.
31 */
32
33 int
linux_pkey_alloc_machdep(struct thread * td,uint64_t init_val)34 linux_pkey_alloc_machdep(struct thread *td, uint64_t init_val)
35 {
36
37 return (ENOSPC);
38 }
39
40 int
linux_pkey_free_machdep(struct thread * td,int pkey)41 linux_pkey_free_machdep(struct thread *td, int pkey)
42 {
43
44 return (EINVAL);
45 }
46
47 int
linux_pkey_mprotect_machdep(struct thread * td,uintptr_t addr,size_t len,int prot,int pkey)48 linux_pkey_mprotect_machdep(struct thread *td, uintptr_t addr, size_t len,
49 int prot, int pkey)
50 {
51
52 return (EINVAL);
53 }
54