xref: /freebsd/sys/compat/linux/linux_mib.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1c6dfea0eSMarcel Moolenaar /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
37f2d13d6SPedro F. Giffuni  *
4c6dfea0eSMarcel Moolenaar  * Copyright (c) 1999 Marcel Moolenaar
5c6dfea0eSMarcel Moolenaar  * All rights reserved.
6c6dfea0eSMarcel Moolenaar  *
7c6dfea0eSMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
8c6dfea0eSMarcel Moolenaar  * modification, are permitted provided that the following conditions
9c6dfea0eSMarcel Moolenaar  * are met:
10c6dfea0eSMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
11b1ed95fdSEd Maste  *    notice, this list of conditions and the following disclaimer.
12c6dfea0eSMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
13c6dfea0eSMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
14c6dfea0eSMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
15c6dfea0eSMarcel Moolenaar  *
16b1ed95fdSEd Maste  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17b1ed95fdSEd Maste  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18b1ed95fdSEd Maste  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19b1ed95fdSEd Maste  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20b1ed95fdSEd Maste  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21b1ed95fdSEd Maste  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22b1ed95fdSEd Maste  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23b1ed95fdSEd Maste  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24b1ed95fdSEd Maste  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25b1ed95fdSEd Maste  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26b1ed95fdSEd Maste  * SUCH DAMAGE.
27c6dfea0eSMarcel Moolenaar  */
28c6dfea0eSMarcel Moolenaar 
29c6dfea0eSMarcel Moolenaar #ifndef _LINUX_MIB_H_
30c6dfea0eSMarcel Moolenaar #define _LINUX_MIB_H_
31c6dfea0eSMarcel Moolenaar 
3267d39748SDmitry Chagin #ifdef SYSCTL_DECL
3367d39748SDmitry Chagin SYSCTL_DECL(_compat_linux);
3467d39748SDmitry Chagin #endif
3567d39748SDmitry Chagin 
367ae27ff4SJamie Gritton void	linux_osd_jail_register(void);
377ae27ff4SJamie Gritton void	linux_osd_jail_deregister(void);
387ae27ff4SJamie Gritton 
39b62f75cfSJohn Baldwin void	linux_get_osname(struct thread *td, char *dst);
40c6dfea0eSMarcel Moolenaar 
41b62f75cfSJohn Baldwin void	linux_get_osrelease(struct thread *td, char *dst);
42c6dfea0eSMarcel Moolenaar 
43b62f75cfSJohn Baldwin int	linux_get_oss_version(struct thread *td);
44c6dfea0eSMarcel Moolenaar 
45580dd797SDmitry Chagin int	linux_kernver(struct thread *td);
46580dd797SDmitry Chagin 
470ef30b5dSDmitry Chagin #define	LINUX_KVERSION		5
480ef30b5dSDmitry Chagin #define	LINUX_KPATCHLEVEL	15
491d3a302bSEdward Tomasz Napierala #define	LINUX_KSUBLEVEL		0
50a6326909SDmitry Chagin 
51a6326909SDmitry Chagin #define	LINUX_KERNVER(a,b,c)	(((a) << 16) + ((b) << 8) + (c))
52a6326909SDmitry Chagin #define	LINUX_VERSION_CODE	LINUX_KERNVER(LINUX_KVERSION,		\
53a6326909SDmitry Chagin 				    LINUX_KPATCHLEVEL, LINUX_KSUBLEVEL)
54a6326909SDmitry Chagin #define	LINUX_KERNVERSTR(x)	#x
55a6326909SDmitry Chagin #define	LINUX_XKERNVERSTR(x)	LINUX_KERNVERSTR(x)
56a6326909SDmitry Chagin #define	LINUX_VERSION_STR	LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL)
57a6326909SDmitry Chagin 
588c5059e9SEdward Tomasz Napierala extern int linux_default_openfiles;
591c34dcb5SEdward Tomasz Napierala extern int linux_default_stacksize;
6054669eb7SEdward Tomasz Napierala extern int linux_dummy_rlimits;
61da6d8ae6SEdward Tomasz Napierala extern int linux_ignore_ip_recverr;
622cf9eb6cSEdward Tomasz Napierala extern int linux_preserve_vstatus;
63b4147bf6STijl Coosemans extern bool linux_map_sched_prio;
642cf9eb6cSEdward Tomasz Napierala 
65598f6fb4SKonstantin Belousov struct image_params;
6662b8258aSKonstantin Belousov int linux_setid_allowed_query(struct thread *td, struct image_params *imgp);
67598f6fb4SKonstantin Belousov 
68c6dfea0eSMarcel Moolenaar #endif /* _LINUX_MIB_H_ */
69