void-packages/srcpkgs/libsmbios/patches/fix-musl.patch

37 lines
1.1 KiB
Diff

--- src/libsmbios_c/smi/smi_linux.c.orig 2019-02-07 22:09:34.240465062 +0100
+++ src/libsmbios_c/smi/smi_linux.c 2019-02-07 22:09:41.937466022 +0100
@@ -28,6 +28,7 @@
#include <string.h>
#include <sys/file.h> // flock
#include <sys/ioctl.h> // ioctl
+#include <fcntl.h> // open
#include <errno.h>
// public
--- src/libsmbios_c/common/platform/linux.h.orig 2019-02-07 22:17:16.671522730 +0100
+++ src/libsmbios_c/common/platform/linux.h 2019-02-07 22:17:36.932525256 +0100
@@ -1,3 +1,23 @@
+#if !defined(__GLIBC__) && !defined(LL_IO)
+#define LL_IO
+// inb_p and outb_p: imported from glibc
+static __inline unsigned char
+inb_p (unsigned short int __port)
+{
+ unsigned char _v;
+
+ __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
+ return _v;
+}
+
+static __inline void
+outb_p (unsigned char __value, unsigned short int __port)
+{
+ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value),
+ "Nd" (__port));
+}
+#endif
+
// If we are on IA64 we will need to macro define inb_p and outb_p
#if defined(__ia64__)
# define outb_p outb