Преглед изворни кода

[linux] Add empty smbios

There exists an smbios userspace library so implementing this is
probably possible, but doesn't seem really important to have in
userspace.  Hence provide a dummy implementation returning an error.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Piotr Jaroszyński пре 14 година
родитељ
комит
aacd1d62fb

+ 1
- 0
src/config/defaults/linux.h Прегледај датотеку

@@ -12,6 +12,7 @@
12 12
 #define UACCESS_LINUX
13 13
 #define UMALLOC_LINUX
14 14
 #define NAP_LINUX
15
+#define SMBIOS_LINUX
15 16
 
16 17
 #define IMAGE_SCRIPT
17 18
 

+ 1
- 0
src/include/ipxe/errfile.h Прегледај датотеку

@@ -213,6 +213,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
213 213
 #define ERRFILE_login_ui	      ( ERRFILE_OTHER | 0x00170000 )
214 214
 #define ERRFILE_ib_srpboot	      ( ERRFILE_OTHER | 0x00180000 )
215 215
 #define ERRFILE_iwmgmt		      ( ERRFILE_OTHER | 0x00190000 )
216
+#define ERRFILE_linux_smbios	      ( ERRFILE_OTHER | 0x001a0000 )
216 217
 
217 218
 /** @} */
218 219
 

+ 18
- 0
src/include/ipxe/linux/linux_smbios.h Прегледај датотеку

@@ -0,0 +1,18 @@
1
+#ifndef _IPXE_LINUX_SMBIOS_H
2
+#define _IPXE_LINUX_SMBIOS_H
3
+
4
+/** @file
5
+ *
6
+ * iPXE SMBIOS API for linux
7
+ *
8
+ */
9
+
10
+FILE_LICENCE(GPL2_OR_LATER);
11
+
12
+#ifdef SMBIOS_LINUX
13
+#define SMBIOS_PREFIX_linux
14
+#else
15
+#define SMBIOS_PREFIX_linux __linux_
16
+#endif
17
+
18
+#endif /* _IPXE_LINUX_SMBIOS_H */

+ 1
- 0
src/include/ipxe/smbios.h Прегледај датотеку

@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
26 26
 
27 27
 /* Include all architecture-independent SMBIOS API headers */
28 28
 #include <ipxe/efi/efi_smbios.h>
29
+#include <ipxe/linux/linux_smbios.h>
29 30
 
30 31
 /* Include all architecture-dependent SMBIOS API headers */
31 32
 #include <bits/smbios.h>

+ 37
- 0
src/interface/linux/linux_smbios.c Прегледај датотеку

@@ -0,0 +1,37 @@
1
+/*
2
+ * Copyright (C) 2010 Piotr Jaroszyński <p.jaroszynski@gmail.com>
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
+ */
18
+
19
+FILE_LICENCE(GPL2_OR_LATER);
20
+
21
+#include <errno.h>
22
+#include <ipxe/smbios.h>
23
+
24
+/**
25
+ * Find SMBIOS
26
+ *
27
+ * Not implemented currently.
28
+ *
29
+ * @v smbios		SMBIOS entry point descriptor structure to fill in
30
+ * @ret rc		Return status code
31
+ */
32
+static int linux_find_smbios(struct smbios *smbios __unused)
33
+{
34
+	return -ENODEV;
35
+}
36
+
37
+PROVIDE_SMBIOS(linux, find_smbios, linux_find_smbios);

Loading…
Откажи
Сачувај