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