Sat Jul 24 11:39:19 2021 UTC ()
smbios: Add character device for accessing SMBIOS tables

The /dev/smbios character device gives an aperture into physical memory
that allows read-only access to the SMBIOS header and tables.


(jmcneill)
diff -r1.223 -r1.224 src/etc/MAKEDEV.tmpl
diff -r1.8 -r1.9 src/etc/etc.aarch64/MAKEDEV.conf
diff -r1.32 -r1.33 src/etc/etc.amd64/MAKEDEV.conf
diff -r1.33 -r1.34 src/etc/etc.i386/MAKEDEV.conf
diff -r1.21 -r1.22 src/sys/arch/arm/fdt/acpi_fdt.c
diff -r1.5 -r1.6 src/sys/arch/x86/x86/bios32.c
diff -r1.97 -r1.98 src/sys/conf/majors
diff -r1.1 -r1.2 src/sys/dev/smbios.c
diff -r1.1 -r1.2 src/sys/dev/smbiosvar.h

cvs diff -r1.223 -r1.224 src/etc/MAKEDEV.tmpl (expand / switch to unified diff)

--- src/etc/MAKEDEV.tmpl 2021/06/29 10:22:33 1.223
+++ src/etc/MAKEDEV.tmpl 2021/07/24 11:39:18 1.224
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#!/bin/sh - 1#!/bin/sh -
2# $NetBSD: MAKEDEV.tmpl,v 1.223 2021/06/29 10:22:33 nia Exp $ 2# $NetBSD: MAKEDEV.tmpl,v 1.224 2021/07/24 11:39:18 jmcneill Exp $
3# 3#
4# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc. 4# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
5# All rights reserved. 5# All rights reserved.
6# 6#
7# Redistribution and use in source and binary forms, with or without 7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 8# modification, are permitted provided that the following conditions
9# are met: 9# are met:
10# 1. Redistributions of source code must retain the above copyright 10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 14# documentation and/or other materials provided with the distribution.
15# 15#
@@ -2230,26 +2230,30 @@ ipmi[0-9]*) @@ -2230,26 +2230,30 @@ ipmi[0-9]*)
2230 2230
2231xmm[0-9]) 2231xmm[0-9])
2232 unit=${i#xmm} 2232 unit=${i#xmm}
2233 makedir xmm${unit} 755 2233 makedir xmm${unit} 755
2234 mkdev xmm${unit}/rpc c %wwanc_chr% $(($unit * 65536 + 1)) 2234 mkdev xmm${unit}/rpc c %wwanc_chr% $(($unit * 65536 + 1))
2235 mkdev ttyXMM${unit}0 c %wwanc_chr% $(($unit * 65536 + 2)) 2235 mkdev ttyXMM${unit}0 c %wwanc_chr% $(($unit * 65536 + 2))
2236 mkdev ttyXMM${unit}1 c %wwanc_chr% $(($unit * 65536 + 4)) 2236 mkdev ttyXMM${unit}1 c %wwanc_chr% $(($unit * 65536 + 4))
2237 ;; 2237 ;;
2238 2238
2239acpi) 2239acpi)
2240 mkdev acpi c %acpi_chr% 0 2240 mkdev acpi c %acpi_chr% 0
2241 ;; 2241 ;;
2242 2242
 2243smbios)
 2244 mkdev smbios c %smbios_chr% 0
 2245 ;;
 2246
2243midevend) 2247midevend)
2244%MI_DEVICES_END% 2248%MI_DEVICES_END%
2245local) 2249local)
2246 if [ -f "$0.local" ]; then 2250 if [ -f "$0.local" ]; then
2247 umask 0 2251 umask 0
2248 if [ -n "$count_nodes" ]; then 2252 if [ -n "$count_nodes" ]; then
2249 count_nodes=$((count_nodes + \ 2253 count_nodes=$((count_nodes + \
2250 $(linecount "$("$HOST_SH" "$0.local" $opts -s all)") )) 2254 $(linecount "$("$HOST_SH" "$0.local" $opts -s all)") ))
2251 else 2255 else
2252 "$HOST_SH" "$0.local" $opts all 2256 "$HOST_SH" "$0.local" $opts all
2253 fi 2257 fi
2254 umask 077 2258 umask 077
2255 fi 2259 fi

cvs diff -r1.8 -r1.9 src/etc/etc.aarch64/MAKEDEV.conf (expand / switch to unified diff)

--- src/etc/etc.aarch64/MAKEDEV.conf 2020/12/06 02:57:30 1.8
+++ src/etc/etc.aarch64/MAKEDEV.conf 2021/07/24 11:39:18 1.9
@@ -1,33 +1,34 @@ @@ -1,33 +1,34 @@
1# $NetBSD: MAKEDEV.conf,v 1.8 2020/12/06 02:57:30 jmcneill Exp $ 1# $NetBSD: MAKEDEV.conf,v 1.9 2021/07/24 11:39:18 jmcneill Exp $
2 2
3all_md) 3all_md)
4 makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 4 makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3
5 makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7 dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7 5 makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7 dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
6 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7 6 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
7 makedev tty0 tty1 plcom0 st0 st1 ch0 cd0 cd1 7 makedev tty0 tty1 plcom0 st0 st1 ch0 cd0 cd1
8 makedev uk0 uk1 ss0 8 makedev uk0 uk1 ss0
9 makedev lpa0 lpt0 9 makedev lpa0 lpt0
10 makedev usbs 10 makedev usbs
11 makedev music rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7 11 makedev music rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7
12 makedev scsibus0 scsibus1 scsibus2 scsibus3 12 makedev scsibus0 scsibus1 scsibus2 scsibus3
13 makedev sysmon 13 makedev sysmon
14 makedev dmoverio 14 makedev dmoverio
15 makedev pci0 pci1 pci2 pci3 15 makedev pci0 pci1 pci2 pci3
16 makedev tprof 16 makedev tprof
17 makedev kttcp 17 makedev kttcp
18 makedev cfs 18 makedev cfs
19 makedev audio speaker 19 makedev audio speaker
20 makedev spiflash0 20 makedev spiflash0
21 makedev bpf 21 makedev bpf
22 makedev openfirm 22 makedev openfirm
23 makedev acpi 23 makedev acpi
 24 makedev smbios
24 ;; 25 ;;
25 26
26ramdisk|floppy) 27ramdisk|floppy)
27 makedev std bpf fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3 28 makedev std bpf fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3
28 makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7 dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7 29 makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7 dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
29 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7 30 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
30 makedev tty0 tty1 opty 31 makedev tty0 tty1 opty
31 makedev st0 st1 cd0 cd1 32 makedev st0 st1 cd0 cd1
32 makedev drvctl random 33 makedev drvctl random
33 ;; 34 ;;

cvs diff -r1.32 -r1.33 src/etc/etc.amd64/MAKEDEV.conf (expand / switch to unified diff)

--- src/etc/etc.amd64/MAKEDEV.conf 2020/12/06 02:57:30 1.32
+++ src/etc/etc.amd64/MAKEDEV.conf 2021/07/24 11:39:18 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: MAKEDEV.conf,v 1.32 2020/12/06 02:57:30 jmcneill Exp $ 1# $NetBSD: MAKEDEV.conf,v 1.33 2021/07/24 11:39:18 jmcneill Exp $
2 2
3# As of 2003-04-17, the "init" case must not create more than 890 entries. 3# As of 2003-04-17, the "init" case must not create more than 890 entries.
4all_md) 4all_md)
5 makedev std wscons wt0 fd0 fd1 5 makedev std wscons wt0 fd0 fd1
6 makedev wd0 wd1 wd2 wd3 wd4 wd5 wd6 wd7 6 makedev wd0 wd1 wd2 wd3 wd4 wd5 wd6 wd7
7 makedev sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 7 makedev sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7
8 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7 8 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
9 makedev tty0 tty1 tty2 tty3 9 makedev tty0 tty1 tty2 tty3
10 makedev st0 st1 ch0 cd0 cd1 mcd0 vnd0 10 makedev st0 st1 ch0 cd0 cd1 mcd0 vnd0
11 makedev bpf 11 makedev bpf
12 makedev ccd0 md0 random 12 makedev ccd0 md0 random
13 makedev cgd0 cgd1 13 makedev cgd0 cgd1
14 makedev amr0 iop0 mfi0 mlx0 mly0 dpti0 dpt0 twe0 14 makedev amr0 iop0 mfi0 mlx0 mly0 dpti0 dpt0 twe0
@@ -36,18 +36,19 @@ all_md) @@ -36,18 +36,19 @@ all_md)
36 makedev tprof 36 makedev tprof
37 makedev nvmm 37 makedev nvmm
38 makedev ttyCZ0 ttyCY0 38 makedev ttyCZ0 ttyCY0
39 makedev agp0 39 makedev agp0
40 makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7 40 makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7
41 makedev pci8 pci9 pci10 pci11 pci12 pci13 pci14 41 makedev pci8 pci9 pci10 pci11 pci12 pci13 pci14
42 makedev pci15 pci16 pci18 pci19 42 makedev pci15 pci16 pci18 pci19
43 makedev altq 43 makedev altq
44 makedev cir0 cir1 irframe0 irframe1 44 makedev cir0 cir1 irframe0 irframe1
45 makedev kttcp 45 makedev kttcp
46 makedev bio 46 makedev bio
47 makedev xmm0 47 makedev xmm0
48 makedev acpi 48 makedev acpi
 49 makedev smbios
49 ;; 50 ;;
50 51
51xen) 52xen)
52 makedev xenevt xencons xsd_kva 53 makedev xenevt xencons xsd_kva
53 ;; 54 ;;

cvs diff -r1.33 -r1.34 src/etc/etc.i386/MAKEDEV.conf (expand / switch to unified diff)

--- src/etc/etc.i386/MAKEDEV.conf 2020/12/06 02:57:30 1.33
+++ src/etc/etc.i386/MAKEDEV.conf 2021/07/24 11:39:19 1.34
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: MAKEDEV.conf,v 1.33 2020/12/06 02:57:30 jmcneill Exp $ 1# $NetBSD: MAKEDEV.conf,v 1.34 2021/07/24 11:39:19 jmcneill Exp $
2 2
3# As of 2005-03-15, the "init" case must not create more than 1024 entries. 3# As of 2005-03-15, the "init" case must not create more than 1024 entries.
4all_md) 4all_md)
5 makedev std wscons wt0 fd0 fd1 5 makedev std wscons wt0 fd0 fd1
6 makedev wd0 wd1 wd2 wd3 wd4 wd5 wd6 wd7 6 makedev wd0 wd1 wd2 wd3 wd4 wd5 wd6 wd7
7 makedev sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 7 makedev sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7
8 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7 8 makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
9 makedev tty0 tty1 tty2 tty3 9 makedev tty0 tty1 tty2 tty3
10 makedev st0 st1 ch0 cd0 cd1 mcd0 vnd0 10 makedev st0 st1 ch0 cd0 cd1 mcd0 vnd0
11 makedev bpf 11 makedev bpf
12 makedev ccd0 md0 random 12 makedev ccd0 md0 random
13 makedev cgd0 cgd1 13 makedev cgd0 cgd1
14 makedev amr0 iop0 mfi0 mlx0 mly0 dpti0 dpt0 twe0 icp0 14 makedev amr0 iop0 mfi0 mlx0 mly0 dpti0 dpt0 twe0 icp0
@@ -40,26 +40,27 @@ all_md) @@ -40,26 +40,27 @@ all_md)
40 makedev ttyCZ0 ttyCY0 40 makedev ttyCZ0 ttyCY0
41 makedev agp0 41 makedev agp0
42 makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7 42 makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7
43 makedev pci8 pci9 pci10 pci11 pci12 pci13 pci14 43 makedev pci8 pci9 pci10 pci11 pci12 pci13 pci14
44 makedev pci15 pci16 pci17 pci18 pci19 44 makedev pci15 pci16 pci17 pci18 pci19
45 makedev altq 45 makedev altq
46 makedev cir0 cir1 irframe0 irframe1 46 makedev cir0 cir1 irframe0 irframe1
47 makedev dmoverio 47 makedev dmoverio
48 makedev kttcp 48 makedev kttcp
49 makedev io 49 makedev io
50 makedev bio 50 makedev bio
51 makedev cfs 51 makedev cfs
52 makedev acpi 52 makedev acpi
 53 makedev smbios
53 ;; 54 ;;
54 55
55xen) 56xen)
56 makedev xenevt xencons xsd_kva 57 makedev xenevt xencons xsd_kva
57 ;; 58 ;;
58 59
59floppy) 60floppy)
60 makedev std bpf wt0 fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 sd4 st0 st1 61 makedev std bpf wt0 fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 sd4 st0 st1
61 makedev tty0 tty1 tty2 cd0 cd1 mcd0 ttyv0 opty ld0 ld1 ld2 ld3 ed0 ed1 62 makedev tty0 tty1 tty2 cd0 cd1 mcd0 ttyv0 opty ld0 ld1 ld2 ld3 ed0 ed1
62 ;; 63 ;;
63 64
64ramdisk) 65ramdisk)
65 makedev floppy md0 66 makedev floppy md0

cvs diff -r1.21 -r1.22 src/sys/arch/arm/fdt/acpi_fdt.c (expand / switch to unified diff)

--- src/sys/arch/arm/fdt/acpi_fdt.c 2021/07/23 21:33:35 1.21
+++ src/sys/arch/arm/fdt/acpi_fdt.c 2021/07/24 11:39:19 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: acpi_fdt.c,v 1.21 2021/07/23 21:33:35 jmcneill Exp $ */ 1/* $NetBSD: acpi_fdt.c,v 1.22 2021/07/24 11:39:19 jmcneill Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include "pci.h" 29#include "pci.h"
30#include "opt_efi.h" 30#include "opt_efi.h"
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.21 2021/07/23 21:33:35 jmcneill Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.22 2021/07/24 11:39:19 jmcneill Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/bus.h> 36#include <sys/bus.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/intr.h> 38#include <sys/intr.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/lwp.h> 41#include <sys/lwp.h>
42#include <sys/kmem.h> 42#include <sys/kmem.h>
43#include <sys/queue.h> 43#include <sys/queue.h>
44#include <sys/sysctl.h> 44#include <sys/sysctl.h>
45 45
46#include <dev/fdt/fdtvar.h> 46#include <dev/fdt/fdtvar.h>
@@ -169,55 +169,59 @@ static void @@ -169,55 +169,59 @@ static void
169acpi_fdt_smbios_init(device_t dev) 169acpi_fdt_smbios_init(device_t dev)
170{ 170{
171 uint8_t *ptr; 171 uint8_t *ptr;
172 int smbver; 172 int smbver;
173 173
174 const int chosen = OF_finddevice("/chosen"); 174 const int chosen = OF_finddevice("/chosen");
175 if (chosen >= 0) { 175 if (chosen >= 0) {
176 of_getprop_uint64(chosen, "netbsd,smbios-table", &smbios_table); 176 of_getprop_uint64(chosen, "netbsd,smbios-table", &smbios_table);
177 } 177 }
178 if (smbios_table == 0) { 178 if (smbios_table == 0) {
179 return; 179 return;
180 } 180 }
181 181
 182 smbios_entry.hdrphys = smbios_table;
 183
182 smbver = acpi_fdt_smbios_version(); 184 smbver = acpi_fdt_smbios_version();
183 if (smbver == 3) { 185 if (smbver == 3) {
184 struct smb3hdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh)); 186 struct smb3hdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh));
185 if (sh == NULL) { 187 if (sh == NULL) {
186 return; 188 return;
187 } 189 }
188 190
189 ptr = AcpiOsMapMemory(sh->addr, sh->size); 191 ptr = AcpiOsMapMemory(sh->addr, sh->size);
190 if (ptr != NULL) { 192 if (ptr != NULL) {
 193 smbios_entry.tabphys = sh->addr;
191 smbios_entry.addr = ptr; 194 smbios_entry.addr = ptr;
192 smbios_entry.len = sh->size; 195 smbios_entry.len = sh->size;
193 smbios_entry.rev = sh->eprev; 196 smbios_entry.rev = sh->eprev;
194 smbios_entry.mjr = sh->majrev; 197 smbios_entry.mjr = sh->majrev;
195 smbios_entry.min = sh->minrev; 198 smbios_entry.min = sh->minrev;
196 smbios_entry.doc = sh->docrev; 199 smbios_entry.doc = sh->docrev;
197 smbios_entry.count = UINT16_MAX; 200 smbios_entry.count = UINT16_MAX;
198 } 201 }
199 202
200 aprint_normal_dev(dev, "SMBIOS rev. %d.%d.%d @ 0x%lx\n", 203 aprint_normal_dev(dev, "SMBIOS rev. %d.%d.%d @ 0x%lx\n",
201 sh->majrev, sh->minrev, sh->docrev, (u_long)sh->addr); 204 sh->majrev, sh->minrev, sh->docrev, (u_long)sh->addr);
202 AcpiOsUnmapMemory(sh, sizeof(*sh)); 205 AcpiOsUnmapMemory(sh, sizeof(*sh));
203 } else if (smbver == 2) { 206 } else if (smbver == 2) {
204 struct smbhdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh)); 207 struct smbhdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh));
205 if (sh == NULL) { 208 if (sh == NULL) {
206 return; 209 return;
207 } 210 }
208 211
209 ptr = AcpiOsMapMemory(sh->addr, sh->size); 212 ptr = AcpiOsMapMemory(sh->addr, sh->size);
210 if (ptr != NULL) { 213 if (ptr != NULL) {
 214 smbios_entry.tabphys = sh->addr;
211 smbios_entry.addr = ptr; 215 smbios_entry.addr = ptr;
212 smbios_entry.len = sh->size; 216 smbios_entry.len = sh->size;
213 smbios_entry.rev = 0; 217 smbios_entry.rev = 0;
214 smbios_entry.mjr = sh->majrev; 218 smbios_entry.mjr = sh->majrev;
215 smbios_entry.min = sh->minrev; 219 smbios_entry.min = sh->minrev;
216 smbios_entry.doc = 0; 220 smbios_entry.doc = 0;
217 smbios_entry.count = sh->count; 221 smbios_entry.count = sh->count;
218 } 222 }
219 223
220 aprint_normal_dev(dev, "SMBIOS rev. %d.%d @ 0x%lx (%d entries)\n", 224 aprint_normal_dev(dev, "SMBIOS rev. %d.%d @ 0x%lx (%d entries)\n",
221 sh->majrev, sh->minrev, (u_long)sh->addr, sh->count); 225 sh->majrev, sh->minrev, (u_long)sh->addr, sh->count);
222 AcpiOsUnmapMemory(sh, sizeof(*sh)); 226 AcpiOsUnmapMemory(sh, sizeof(*sh));
223 } 227 }

cvs diff -r1.5 -r1.6 src/sys/arch/x86/x86/bios32.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/bios32.c 2021/07/21 23:16:09 1.5
+++ src/sys/arch/x86/x86/bios32.c 2021/07/24 11:39:19 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bios32.c,v 1.5 2021/07/21 23:16:09 jmcneill Exp $ */ 1/* $NetBSD: bios32.c,v 1.6 2021/07/24 11:39:19 jmcneill Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -76,27 +76,27 @@ @@ -76,27 +76,27 @@
76 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 76 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
77 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 77 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
78 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 78 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
79 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 79 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
80 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 80 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
81 * THE POSSIBILITY OF SUCH DAMAGE. 81 * THE POSSIBILITY OF SUCH DAMAGE.
82 */ 82 */
83 83
84/* 84/*
85 * Basic interface to BIOS32 services. 85 * Basic interface to BIOS32 services.
86 */ 86 */
87 87
88#include <sys/cdefs.h> 88#include <sys/cdefs.h>
89__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.5 2021/07/21 23:16:09 jmcneill Exp $"); 89__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.6 2021/07/24 11:39:19 jmcneill Exp $");
90 90
91#include <sys/param.h> 91#include <sys/param.h>
92#include <sys/systm.h> 92#include <sys/systm.h>
93#include <sys/device.h> 93#include <sys/device.h>
94 94
95#include <dev/isa/isareg.h> 95#include <dev/isa/isareg.h>
96#include <machine/isa_machdep.h> 96#include <machine/isa_machdep.h>
97 97
98#include <machine/segments.h> 98#include <machine/segments.h>
99#include <machine/bios32.h> 99#include <machine/bios32.h>
100#include <dev/smbiosvar.h> 100#include <dev/smbiosvar.h>
101#include <x86/smbios_machdep.h> 101#include <x86/smbios_machdep.h>
102#include <x86/efi.h> 102#include <x86/efi.h>
@@ -242,26 +242,28 @@ bios32_service(uint32_t service, bios32_ @@ -242,26 +242,28 @@ bios32_service(uint32_t service, bios32_
242static void 242static void
243smbios2_map_kva(const uint8_t *p) 243smbios2_map_kva(const uint8_t *p)
244{ 244{
245 const struct smbhdr *sh = (const struct smbhdr *)p; 245 const struct smbhdr *sh = (const struct smbhdr *)p;
246 paddr_t pa, end; 246 paddr_t pa, end;
247 vaddr_t eva; 247 vaddr_t eva;
248 248
249 pa = trunc_page(sh->addr); 249 pa = trunc_page(sh->addr);
250 end = round_page(sh->addr + sh->size); 250 end = round_page(sh->addr + sh->size);
251 eva = uvm_km_alloc(kernel_map, end - pa, 0, UVM_KMF_VAONLY); 251 eva = uvm_km_alloc(kernel_map, end - pa, 0, UVM_KMF_VAONLY);
252 if (eva == 0) 252 if (eva == 0)
253 return; 253 return;
254 254
 255 smbios_entry.hdrphys = vtophys(p);
 256 smbios_entry.tabphys = sh->addr;
255 smbios_entry.addr = (uint8_t *)(eva + (sh->addr & PGOFSET)); 257 smbios_entry.addr = (uint8_t *)(eva + (sh->addr & PGOFSET));
256 smbios_entry.len = sh->size; 258 smbios_entry.len = sh->size;
257 smbios_entry.rev = 0; 259 smbios_entry.rev = 0;
258 smbios_entry.mjr = sh->majrev; 260 smbios_entry.mjr = sh->majrev;
259 smbios_entry.min = sh->minrev; 261 smbios_entry.min = sh->minrev;
260 smbios_entry.doc = 0; 262 smbios_entry.doc = 0;
261 smbios_entry.count = sh->count; 263 smbios_entry.count = sh->count;
262 264
263 for (; pa < end; pa+= NBPG, eva+= NBPG) 265 for (; pa < end; pa+= NBPG, eva+= NBPG)
264#ifdef XENPV 266#ifdef XENPV
265 pmap_kenter_ma(eva, pa, VM_PROT_READ, 0); 267 pmap_kenter_ma(eva, pa, VM_PROT_READ, 0);
266#else 268#else
267 pmap_kenter_pa(eva, pa, VM_PROT_READ, 0); 269 pmap_kenter_pa(eva, pa, VM_PROT_READ, 0);
@@ -275,26 +277,28 @@ smbios2_map_kva(const uint8_t *p) @@ -275,26 +277,28 @@ smbios2_map_kva(const uint8_t *p)
275static void 277static void
276smbios3_map_kva(const uint8_t *p) 278smbios3_map_kva(const uint8_t *p)
277{ 279{
278 const struct smb3hdr *sh = (const struct smb3hdr *)p; 280 const struct smb3hdr *sh = (const struct smb3hdr *)p;
279 paddr_t pa, end; 281 paddr_t pa, end;
280 vaddr_t eva; 282 vaddr_t eva;
281 283
282 pa = trunc_page(sh->addr); 284 pa = trunc_page(sh->addr);
283 end = round_page(sh->addr + sh->size); 285 end = round_page(sh->addr + sh->size);
284 eva = uvm_km_alloc(kernel_map, end - pa, 0, UVM_KMF_VAONLY); 286 eva = uvm_km_alloc(kernel_map, end - pa, 0, UVM_KMF_VAONLY);
285 if (eva == 0) 287 if (eva == 0)
286 return; 288 return;
287 289
 290 smbios_entry.hdrphys = vtophys(p);
 291 smbios_entry.tabphys = sh->addr;
288 smbios_entry.addr = (uint8_t *)(eva + ((vaddr_t)sh->addr & PGOFSET)); 292 smbios_entry.addr = (uint8_t *)(eva + ((vaddr_t)sh->addr & PGOFSET));
289 smbios_entry.len = sh->size; 293 smbios_entry.len = sh->size;
290 smbios_entry.rev = sh->eprev; 294 smbios_entry.rev = sh->eprev;
291 smbios_entry.mjr = sh->majrev; 295 smbios_entry.mjr = sh->majrev;
292 smbios_entry.min = sh->minrev; 296 smbios_entry.min = sh->minrev;
293 smbios_entry.doc = sh->docrev; 297 smbios_entry.doc = sh->docrev;
294 smbios_entry.count = UINT16_MAX; 298 smbios_entry.count = UINT16_MAX;
295 299
296 for (; pa < end; pa += NBPG, eva += NBPG) 300 for (; pa < end; pa += NBPG, eva += NBPG)
297#ifdef XENPV 301#ifdef XENPV
298 pmap_kenter_ma(eva, pa, VM_PROT_READ, 0); 302 pmap_kenter_ma(eva, pa, VM_PROT_READ, 0);
299#else 303#else
300 pmap_kenter_pa(eva, pa, VM_PROT_READ, 0); 304 pmap_kenter_pa(eva, pa, VM_PROT_READ, 0);

cvs diff -r1.97 -r1.98 src/sys/conf/majors (expand / switch to unified diff)

--- src/sys/conf/majors 2020/12/06 02:57:30 1.97
+++ src/sys/conf/majors 2021/07/24 11:39:19 1.98
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: majors,v 1.97 2020/12/06 02:57:30 jmcneill Exp $ 1# $NetBSD: majors,v 1.98 2021/07/24 11:39:19 jmcneill Exp $
2# 2#
3# Device majors for Machine-Independent drivers. 3# Device majors for Machine-Independent drivers.
4# 4#
5# Majors 0-143 are reserved for machine-dependent drivers and 5# Majors 0-143 are reserved for machine-dependent drivers and
6# for traditional machine-specific MI driver major mapping. 6# for traditional machine-specific MI driver major mapping.
7# 7#
8# Majors 144-159 are reserved for local/vendor use. 8# Majors 144-159 are reserved for local/vendor use.
9# 9#
10# Majors 160-511 are used for the MI drivers. 10# Majors 160-511 are used for the MI drivers.
11 11
12device-major crypto char 160 crypto single 12device-major crypto char 160 crypto single
13device-major pf char 161 pf single 13device-major pf char 161 pf single
14#obsolete vinum char 162 vinum 14#obsolete vinum char 162 vinum
@@ -81,13 +81,14 @@ device-major gpiopps char 344  @@ -81,13 +81,14 @@ device-major gpiopps char 344
81device-major nvmm char 345 nvmm 81device-major nvmm char 345 nvmm
82device-major kcov char 346 kcov 82device-major kcov char 346 kcov
83device-major spi char 347 spi 83device-major spi char 347 spi
84# Majors 348-350 are reserved for HAXM (pkgsrc/emulators/haxm) 84# Majors 348-350 are reserved for HAXM (pkgsrc/emulators/haxm)
85# Major 351 is reserved for sys/modules/examples 85# Major 351 is reserved for sys/modules/examples
86# Major 352 is reserved for external/cddl/osnet/dev/fbt/fbt.c 86# Major 352 is reserved for external/cddl/osnet/dev/fbt/fbt.c
87# Major 353 is reserved for external/cddl/osnet/dev/sdt/sdt.c 87# Major 353 is reserved for external/cddl/osnet/dev/sdt/sdt.c
88device-major ipmi char 354 ipmi 88device-major ipmi char 354 ipmi
89device-major vhci char 355 vhci 89device-major vhci char 355 vhci
90device-major vio9p char 356 vio9p 90device-major vio9p char 356 vio9p
91device-major fault char 357 fault 91device-major fault char 357 fault
92device-major wwanc char 358 wwanc 92device-major wwanc char 358 wwanc
93device-major acpi char 359 acpi 93device-major acpi char 359 acpi
 94device-major smbios char 360 smbios

cvs diff -r1.1 -r1.2 src/sys/dev/smbios.c (expand / switch to unified diff)

--- src/sys/dev/smbios.c 2021/07/21 23:16:09 1.1
+++ src/sys/dev/smbios.c 2021/07/24 11:39:19 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: smbios.c,v 1.1 2021/07/21 23:16:09 jmcneill Exp $ */ 1/* $NetBSD: smbios.c,v 1.2 2021/07/24 11:39:19 jmcneill Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -76,39 +76,140 @@ @@ -76,39 +76,140 @@
76 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 76 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
77 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 77 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
78 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 78 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
79 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 79 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
80 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 80 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
81 * THE POSSIBILITY OF SUCH DAMAGE. 81 * THE POSSIBILITY OF SUCH DAMAGE.
82 */ 82 */
83 83
84/* 84/*
85 * Basic interface to System Management BIOS (SMBIOS) tables. 85 * Basic interface to System Management BIOS (SMBIOS) tables.
86 */ 86 */
87 87
88#include <sys/cdefs.h> 88#include <sys/cdefs.h>
89__KERNEL_RCSID(0, "$NetBSD: smbios.c,v 1.1 2021/07/21 23:16:09 jmcneill Exp $"); 89__KERNEL_RCSID(0, "$NetBSD: smbios.c,v 1.2 2021/07/24 11:39:19 jmcneill Exp $");
90 90
91#include <sys/param.h> 91#include <sys/param.h>
 92#include <sys/conf.h>
92#include <sys/systm.h> 93#include <sys/systm.h>
93#include <sys/device.h> 94#include <sys/device.h>
94 95
 96#include <uvm/uvm_extern.h>
 97
95#include <dev/smbiosvar.h> 98#include <dev/smbiosvar.h>
96 99
97#define SMBIOS_MAKESIG(a, b, c, d) \ 100#define SMBIOS_MAKESIG(a, b, c, d) \
98 ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) 101 ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
99 102
100struct smbios_entry smbios_entry; 103struct smbios_entry smbios_entry;
101 104
 105static dev_type_read(smbios_read);
 106
 107const struct cdevsw smbios_cdevsw = {
 108 .d_open = nullopen,
 109 .d_close = nullclose,
 110 .d_read = smbios_read,
 111 .d_write = nowrite,
 112 .d_ioctl = noioctl,
 113 .d_stop = nostop,
 114 .d_tty = notty,
 115 .d_poll = nopoll,
 116 .d_mmap = nommap,
 117 .d_kqfilter = nokqfilter,
 118 .d_discard = nodiscard,
 119 .d_flag = D_OTHER | D_MPSAFE,
 120};
 121
 122static void *
 123smbios_map_memory(paddr_t pa, size_t size)
 124{
 125 paddr_t spa, epa, curpa;
 126 vaddr_t va, curva;
 127
 128 spa = trunc_page(pa);
 129 epa = round_page(pa + size);
 130
 131 va = uvm_km_alloc(kernel_map, epa - spa, 0, UVM_KMF_VAONLY);
 132 if (va == 0) {
 133 return NULL;
 134 }
 135
 136 for (curpa = spa, curva = va; curpa < epa; curpa += PAGE_SIZE, curva += PAGE_SIZE) {
 137 pmap_kenter_pa(curva, curpa, VM_PROT_READ, PMAP_WRITE_BACK);
 138 }
 139 pmap_update(pmap_kernel());
 140
 141 return (void *)(va + (pa - spa));
 142}
 143
 144static void
 145smbios_unmap_memory(void *va, size_t size)
 146{
 147 vaddr_t ova;
 148 vsize_t osz;
 149
 150 ova = trunc_page((vaddr_t)va);
 151 osz = round_page((vaddr_t)va + size) - ova;
 152
 153 pmap_kremove(ova, osz);
 154 pmap_update(pmap_kernel());
 155 uvm_km_free(kernel_map, ova, osz, UVM_KMF_VAONLY);
 156}
 157
 158/*
 159 * smbios_read --
 160 *
 161 * Read data from an SMBIOS table that resides in physical memory.
 162 */
 163static int
 164smbios_read(dev_t dev, struct uio *uio, int flag)
 165{
 166 paddr_t pa;
 167 uint8_t *data;
 168 size_t len;
 169 int error;
 170
 171 if (smbios_entry.addr == NULL) {
 172 return EIO;
 173 }
 174 if (uio->uio_rw != UIO_READ) {
 175 return EPERM;
 176 }
 177
 178 pa = uio->uio_offset;
 179 if (pa == smbios_entry.hdrphys) {
 180 /* SMBIOS header */
 181 len = uimin(0x20, uio->uio_resid);
 182
 183 } else {
 184 /* Table data */
 185 if (pa < smbios_entry.tabphys ||
 186 pa >= smbios_entry.tabphys + smbios_entry.len) {
 187 return EFAULT;
 188 }
 189 len = uimin(smbios_entry.len - (pa - smbios_entry.tabphys),
 190 uio->uio_resid);
 191 }
 192
 193 data = smbios_map_memory(pa, len);
 194 if (data == NULL) {
 195 return ENOMEM;
 196 }
 197 error = uiomove(data, len, uio);
 198 smbios_unmap_memory(data, len);
 199
 200 return error;
 201}
 202
102int 203int
103smbios2_check_header(const uint8_t *p) 204smbios2_check_header(const uint8_t *p)
104{ 205{
105 const struct smbhdr *sh = (const struct smbhdr *)p; 206 const struct smbhdr *sh = (const struct smbhdr *)p;
106 uint8_t chksum; 207 uint8_t chksum;
107 int i; 208 int i;
108 209
109 if (sh->sig != SMBIOS_MAKESIG('_', 'S', 'M', '_')) 210 if (sh->sig != SMBIOS_MAKESIG('_', 'S', 'M', '_'))
110 return 0; 211 return 0;
111 i = sh->len; 212 i = sh->len;
112 for (chksum = 0; i--; ) 213 for (chksum = 0; i--; )
113 chksum += p[i]; 214 chksum += p[i];
114 if (chksum != 0) 215 if (chksum != 0)

cvs diff -r1.1 -r1.2 src/sys/dev/smbiosvar.h (expand / switch to unified diff)

--- src/sys/dev/smbiosvar.h 2021/07/21 23:16:09 1.1
+++ src/sys/dev/smbiosvar.h 2021/07/24 11:39:19 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: smbiosvar.h,v 1.1 2021/07/21 23:16:09 jmcneill Exp $ */ 1/* $NetBSD: smbiosvar.h,v 1.2 2021/07/24 11:39:19 jmcneill Exp $ */
2/* 2/*
3 * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca> 3 * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca>
4 * Copyright (c) 2005 Jordan Hargrave 4 * Copyright (c) 2005 Jordan Hargrave
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -31,26 +31,28 @@ @@ -31,26 +31,28 @@
31 31
32#define SMBIOS_UUID_NPRESENT 0x1 32#define SMBIOS_UUID_NPRESENT 0x1
33#define SMBIOS_UUID_NSET 0x2 33#define SMBIOS_UUID_NSET 0x2
34 34
35/* 35/*
36 * Section 3.5 of "UUIDs and GUIDs" found at 36 * Section 3.5 of "UUIDs and GUIDs" found at
37 * http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt 37 * http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt
38 * specifies the string repersentation of a UUID. 38 * specifies the string repersentation of a UUID.
39 */ 39 */
40#define SMBIOS_UUID_REP "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" 40#define SMBIOS_UUID_REP "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
41#define SMBIOS_UUID_REPLEN 37 /* 16 zero padded values, 4 hyphens, 1 null */ 41#define SMBIOS_UUID_REPLEN 37 /* 16 zero padded values, 4 hyphens, 1 null */
42 42
43struct smbios_entry { 43struct smbios_entry {
 44 paddr_t hdrphys;
 45 paddr_t tabphys;
44 uint8_t rev; 46 uint8_t rev;
45 uint8_t mjr; 47 uint8_t mjr;
46 uint8_t min; 48 uint8_t min;
47 uint8_t doc; 49 uint8_t doc;
48 uint8_t *addr; 50 uint8_t *addr;
49 uint32_t len; 51 uint32_t len;
50 uint16_t count; 52 uint16_t count;
51}; 53};
52 54
53struct smbhdr { 55struct smbhdr {
54 uint32_t sig; /* "_SM_" */ 56 uint32_t sig; /* "_SM_" */
55 uint8_t checksum; /* Entry point checksum */ 57 uint8_t checksum; /* Entry point checksum */
56 uint8_t len; /* Entry point structure length */ 58 uint8_t len; /* Entry point structure length */