pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/memtestplus memtestplus: replace macro insani...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a56b21c5952a
branches: trunk
changeset: 375251:a56b21c5952a
user: maya <maya%pkgsrc.org@localhost>
date: Wed Feb 07 00:59:18 2018 +0000
description:
memtestplus: replace macro insanity with expanded definitions
...from current linux.
PR pkg/52983: sysutils/memtestplus w/-O0 build fails on netbsd-7
PKGREVISION++
diffstat:
sysutils/memtestplus/Makefile | 7 +++-
sysutils/memtestplus/files/io.h | 68 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 2 deletions(-)
diffs (100 lines):
diff -r ee007b9ff37e -r a56b21c5952a sysutils/memtestplus/Makefile
--- a/sysutils/memtestplus/Makefile Tue Feb 06 20:35:47 2018 +0000
+++ b/sysutils/memtestplus/Makefile Wed Feb 07 00:59:18 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2018/01/29 14:23:26 maya Exp $
+# $NetBSD: Makefile,v 1.26 2018/02/07 00:59:18 maya Exp $
#
# Note -- version number also in the do-install rule
@@ -7,7 +7,7 @@
DISTNAME= memtest86+-${MAJVER}.${MINVER}
PKGNAME= memtestplus-${MAJVER}.${MINVER}
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= sysutils
MASTER_SITES= http://www.memtest.org/download/${MAJVER}.${MINVER}/
@@ -47,6 +47,9 @@
BROKEN+= ${PKGNAME} does not produce a working binary with clang
.endif
+pre-configure:
+ ${CP} ${FILESDIR}/io.h ${WRKSRC}
+
do-install:
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/mdec
${INSTALL_DATA} ${WRKSRC}/memtest.bin \
diff -r ee007b9ff37e -r a56b21c5952a sysutils/memtestplus/files/io.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/memtestplus/files/io.h Wed Feb 07 00:59:18 2018 +0000
@@ -0,0 +1,68 @@
+#ifndef _ASM_X86_IO_H
+#define _ASM_X86_IO_H
+
+#ifdef SLOW_IO_BY_JUMPING
+#define native_io_delay() __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:")
+#else
+#define native_io_delay() __asm__ __volatile__("outb %al,$0x80")
+#endif
+
+static inline void slow_down_io(void)
+{
+ native_io_delay();
+#ifdef REALLY_SLOW_IO
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+#endif
+}
+
+
+void __outb(char value, int port) {
+ asm volatile("outb" " %b" "0, %w1"
+ : : "a"(value), "Nd"(port));
+}
+
+unsigned char __inb(int port)
+{
+ unsigned char value;
+ asm volatile("inb" " %w1, %b" "0"
+ : "=a"(value) : "Nd"(port));
+ return value;
+}
+
+void __outw(short value, int port) {
+ asm volatile("outw" " %w" "0, %w1"
+ : : "a"(value), "Nd"(port));
+}
+
+unsigned short __inw(int port)
+{
+ unsigned short value;
+ asm volatile("inw" " %w1, %w" "0"
+ : "=a"(value) : "Nd"(port));
+ return value;
+}
+
+void __outl(int value, int port) {
+ asm volatile("outl" " %" "0, %w1"
+ : : "a"(value), "Nd"(port));
+}
+
+unsigned int __inl(int port)
+{
+ unsigned int value;
+ asm volatile("inl" " %w1, %" "0"
+ : "=a"(value) : "Nd"(port));
+ return value;
+}
+
+#define outb __outb
+#define outw __outw
+#define outl __outl
+
+#define inb __inb
+#define inw __inw
+#define inl __inl
+
+#endif /* _ASM_X86_IO_H */
Home |
Main Index |
Thread Index |
Old Index