1 /* $NetBSD: irix_sysctl.c,v 1.6 2008/04/28 20:23:42 martin Exp $ */
4 * Copyright (c) 2003, 2008 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: irix_sysctl.c,v 1.6 2008/04/28 20:23:42 martin Exp $");
35 #include <sys/param.h>
36 #include <sys/signal.h>
37 #include <sys/sysctl.h>
39 #include <compat/irix/irix_sysctl.h>
41 static struct sysctllog
*irix_clog
;
44 irix_sysctl_fini(void)
47 sysctl_teardown(&irix_clog
);
51 irix_sysctl_init(void)
54 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
56 CTLTYPE_NODE
, "emul", NULL
,
59 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
62 SYSCTL_DESCR("IRIX emulation settings"),
64 CTL_EMUL
, EMUL_IRIX
, CTL_EOL
);
65 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
68 SYSCTL_DESCR("IRIX kernel emulation settings"),
70 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
, CTL_EOL
);
72 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
73 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
74 CTLTYPE_STRING
, "vendor",
75 SYSCTL_DESCR("Emulated IRIX vendor name"),
76 NULL
, 0, irix_si_vendor
, 128,
77 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
78 EMUL_IRIX_KERN_VENDOR
, CTL_EOL
);
79 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
80 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
81 CTLTYPE_STRING
, "osprovider",
82 SYSCTL_DESCR("Emulated IRIX system manufacturer"),
83 NULL
, 0, irix_si_os_provider
, 128,
84 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
85 EMUL_IRIX_KERN_OSPROVIDER
, CTL_EOL
);
86 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
87 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
88 CTLTYPE_STRING
, "osname",
89 SYSCTL_DESCR("Emulated IRIX operating system name"),
90 NULL
, 0, irix_si_os_name
, 128,
91 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
92 EMUL_IRIX_KERN_OSNAME
, CTL_EOL
);
93 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
94 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
95 CTLTYPE_STRING
, "hwname",
96 SYSCTL_DESCR("Emulated IRIX system type"),
97 NULL
, 0, irix_si_hw_name
, 128,
98 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
99 EMUL_IRIX_KERN_HWNAME
, CTL_EOL
);
100 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
101 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
102 CTLTYPE_STRING
, "osrelmaj",
103 SYSCTL_DESCR("Emulated IRIX major release number"),
104 NULL
, 0, irix_si_osrel_maj
, 128,
105 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
106 EMUL_IRIX_KERN_OSRELMAJ
, CTL_EOL
);
107 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
108 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
109 CTLTYPE_STRING
, "osrelmin",
110 SYSCTL_DESCR("Emulated IRIX minor release number"),
111 NULL
, 0, irix_si_osrel_min
, 128,
112 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
113 EMUL_IRIX_KERN_OSRELMIN
, CTL_EOL
);
114 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
115 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
116 CTLTYPE_STRING
, "osrelpatch",
117 SYSCTL_DESCR("Emulated IRIX patch level"),
118 NULL
, 0, irix_si_osrel_patch
, 128,
119 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
120 EMUL_IRIX_KERN_OSRELPATCH
, CTL_EOL
);
121 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
122 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
123 CTLTYPE_STRING
, "processor",
124 SYSCTL_DESCR("Emulated IRIX processor type"),
125 NULL
, 0, irix_si_processors
, 128,
126 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
127 EMUL_IRIX_KERN_PROCESSOR
, CTL_EOL
);
128 sysctl_createv(&irix_clog
, 0, NULL
, NULL
,
129 CTLFLAG_PERMANENT
|CTLFLAG_READWRITE
,
130 CTLTYPE_STRING
, "version",
131 SYSCTL_DESCR("Emulated IRIX version number"),
132 NULL
, 0, irix_si_version
, 128,
133 CTL_EMUL
, EMUL_IRIX
, EMUL_IRIX_KERN
,
134 EMUL_IRIX_KERN_VERSION
, CTL_EOL
);