[gPXE-devel] [PATCH 13/33] [linux] Add empty smbios

Piotr Jaroszyński p.jaroszynski at gmail.com
Sun Aug 15 18:59:18 EDT 2010


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 at gmail.com>
---
 src/config/defaults/linux.h           |    1 +
 src/include/gpxe/errfile.h            |    1 +
 src/include/gpxe/linux/linux_smbios.h |   18 ++++++++++++++++
 src/include/gpxe/smbios.h             |    1 +
 src/interface/linux/linux_smbios.c    |   37 +++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+), 0 deletions(-)
 create mode 100644 src/include/gpxe/linux/linux_smbios.h
 create mode 100644 src/interface/linux/linux_smbios.c

diff --git a/src/config/defaults/linux.h b/src/config/defaults/linux.h
index 8a587ba..a678aa4 100644
--- a/src/config/defaults/linux.h
+++ b/src/config/defaults/linux.h
@@ -12,6 +12,7 @@
 #define UACCESS_LINUX
 #define UMALLOC_LINUX
 #define NAP_LINUX
+#define SMBIOS_LINUX
 
 #define IMAGE_SCRIPT
 
diff --git a/src/include/gpxe/errfile.h b/src/include/gpxe/errfile.h
index de990b0..cc1d956 100644
--- a/src/include/gpxe/errfile.h
+++ b/src/include/gpxe/errfile.h
@@ -213,6 +213,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #define ERRFILE_login_ui	      ( ERRFILE_OTHER | 0x00170000 )
 #define ERRFILE_ib_srpboot	      ( ERRFILE_OTHER | 0x00180000 )
 #define ERRFILE_iwmgmt		      ( ERRFILE_OTHER | 0x00190000 )
+#define ERRFILE_linux_smbios	      ( ERRFILE_OTHER | 0x001a0000 )
 
 /** @} */
 
diff --git a/src/include/gpxe/linux/linux_smbios.h b/src/include/gpxe/linux/linux_smbios.h
new file mode 100644
index 0000000..90774b2
--- /dev/null
+++ b/src/include/gpxe/linux/linux_smbios.h
@@ -0,0 +1,18 @@
+#ifndef _GPXE_LINUX_SMBIOS_H
+#define _GPXE_LINUX_SMBIOS_H
+
+/** @file
+ *
+ * gPXE SMBIOS API for linux
+ *
+ */
+
+FILE_LICENCE(GPL2_OR_LATER);
+
+#ifdef SMBIOS_LINUX
+#define SMBIOS_PREFIX_linux
+#else
+#define SMBIOS_PREFIX_linux __linux_
+#endif
+
+#endif /* _GPXE_LINUX_SMBIOS_H */
diff --git a/src/include/gpxe/smbios.h b/src/include/gpxe/smbios.h
index 4df25c3..4c56e33 100644
--- a/src/include/gpxe/smbios.h
+++ b/src/include/gpxe/smbios.h
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 /* Include all architecture-independent SMBIOS API headers */
 #include <gpxe/efi/efi_smbios.h>
+#include <gpxe/linux/linux_smbios.h>
 
 /* Include all architecture-dependent SMBIOS API headers */
 #include <bits/smbios.h>
diff --git a/src/interface/linux/linux_smbios.c b/src/interface/linux/linux_smbios.c
new file mode 100644
index 0000000..495d7d3
--- /dev/null
+++ b/src/interface/linux/linux_smbios.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Piotr Jaroszyński <p.jaroszynski at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+FILE_LICENCE(GPL2_OR_LATER);
+
+#include <errno.h>
+#include <gpxe/smbios.h>
+
+/**
+ * Find SMBIOS
+ *
+ * Not implemented currently.
+ *
+ * @v smbios		SMBIOS entry point descriptor structure to fill in
+ * @ret rc		Return status code
+ */
+static int linux_find_smbios(struct smbios *smbios __unused)
+{
+	return -ENODEV;
+}
+
+PROVIDE_SMBIOS(linux, find_smbios, linux_find_smbios);
-- 
1.7.1



More information about the gPXE-devel mailing list