SHA256
1
0
forked from pool/memtest86_

Accepting request 22270 from Base:System

Copy from Base:System/memtest86+ based on submit request 22270 from user coolo

OBS-URL: https://build.opensuse.org/request/show/22270
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/memtest86+?expand=0&rev=9
This commit is contained in:
OBS User autobuild 2009-10-12 14:42:17 +00:00 committed by Git OBS Bridge
parent 5d75b732af
commit 7b84a8b3a8
10 changed files with 211 additions and 494 deletions

39
declare-static.diff Normal file
View File

@ -0,0 +1,39 @@
Declare functions static not extern they are only used inside this file
---
io.h | 6 +++---
test.c | 51 ++++++++++++++++++++++++++++++---------------------
2 files changed, 33 insertions(+), 24 deletions(-)
Index: memtest86+-4.00/io.h
===================================================================
--- memtest86+-4.00.orig/io.h
+++ memtest86+-4.00/io.h
@@ -31,7 +31,7 @@
*/
#define __OUT1(s,x) \
-extern inline void __out##s(unsigned x value, unsigned short port) {
+static inline void __out##s(unsigned x value, unsigned short port) {
#define __OUT2(s,s1,s2) \
__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
@@ -43,7 +43,7 @@ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a"
__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
#define __IN1(s) \
-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
#define __IN2(s,s1,s2) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
@@ -55,7 +55,7 @@ __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v)
__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; }
#define __OUTS(s) \
-extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
+static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }

View File

@ -1,17 +1,22 @@
diff -ur memtest86+-1.70.orig/Makefile memtest86+-1.70/Makefile
--- memtest86+-1.70.orig/Makefile 2006-12-27 02:34:57.000000000 +0100
+++ memtest86+-1.70/Makefile 2007-01-25 16:34:01.000000000 +0100
---
Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: memtest86+-4.00/Makefile
===================================================================
--- memtest86+-4.00.orig/Makefile
+++ memtest86+-4.00/Makefile
@@ -7,6 +7,7 @@
# Path for the floppy disk device
#
FDISK=/dev/fd0
+TARGETDIR=/boot
AS=as -32
CC=gcc
#
@@ -116,7 +117,10 @@
wormkill:
rm -f *~
@@ -63,7 +64,10 @@ iso:
./makeiso.sh
rm -f *.o *.s memtest.bin memtest memtest_shared memtest_shared.bin
-install: all
+install:
@ -20,5 +25,4 @@ diff -ur memtest86+-1.70.orig/Makefile memtest86+-1.70/Makefile
+install-floppy: all
dd <memtest.bin >$(FDISK) bs=8192
install-bin:
Only in memtest86+-1.70: Makefile.orig
install-precomp:

View File

@ -1,341 +0,0 @@
diff -urp memtest86+-2.01.mm/io.h memtest86+-2.01/io.h
--- memtest86+-2.01.mm/io.h 2008-02-21 12:26:05.000000000 +0100
+++ memtest86+-2.01/io.h 2008-04-30 12:32:34.787275000 +0200
@@ -31,7 +31,7 @@
*/
#define __OUT1(s,x) \
-extern inline void __out##s(unsigned x value, unsigned short port) {
+static inline void __out##s(unsigned x value, unsigned short port) {
#define __OUT2(s,s1,s2) \
__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
@@ -43,7 +43,7 @@ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a"
__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
#define __IN1(s) \
-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
#define __IN2(s,s1,s2) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
@@ -55,7 +55,7 @@ __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v)
__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; }
#define __OUTS(s) \
-extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
+static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
diff -urp memtest86+-2.01.mm/test.c memtest86+-2.01/test.c
--- memtest86+-2.01.mm/test.c 2008-02-21 12:26:05.000000000 +0100
+++ memtest86+-2.01/test.c 2008-04-30 14:15:56.666389000 +0200
@@ -25,6 +25,22 @@ void poll_errors();
int ecount = 0;
+static inline volatile ulong * sat_add(volatile ulong *ptr, ulong i, volatile ulong *end)
+{
+ if ((ulong)ptr + i * sizeof(*ptr) > (ulong)ptr)
+ return ptr + i;
+ else
+ return end;
+}
+
+static inline volatile ulong * sat_sub(volatile ulong *ptr, ulong i, volatile ulong *start)
+{
+ if ((ulong)ptr > i * sizeof(*ptr))
+ return ptr - i;
+ else
+ return start;
+}
+
static inline ulong roundup(ulong value, ulong mask)
{
return (value + mask) & ~mask;
@@ -150,11 +166,7 @@ void addr_tst2()
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -194,11 +206,7 @@ void addr_tst2()
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -280,11 +288,7 @@ void movinvr()
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -331,11 +335,7 @@ void movinvr()
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -419,7 +419,8 @@ void movinv1(int iter, ulong p1, ulong p
hprint(LINE_PAT, COL_PAT, p1);
/* Initialize memory with the initial pattern. */
- for (j=0; j<segs; j++) {
+ for (j=0; j<segs; j++)
+ {
start = v->map[j].start;
end = v->map[j].end;
pe = start;
@@ -427,11 +428,7 @@ void movinv1(int iter, ulong p1, ulong p
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -440,17 +437,19 @@ void movinv1(int iter, ulong p1, ulong p
if (p == pe ) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * for (; p < pe; p++) {
- * *p = p1;
- * }
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ for (; p < pe; p++) {
+ *p = p1;
+ }
+#else
asm __volatile__ (
"rep\n\t" \
"stosl\n\t"
: "=D" (p)
: "c" (len), "0" (p), "a" (p1)
);
+#endif
do_tick();
BAILR
} while (!done);
@@ -460,7 +459,8 @@ void movinv1(int iter, ulong p1, ulong p
* write the complement for each memory location. Test from bottom
* up and then from the top down. */
for (i=0; i<iter; i++) {
- for (j=0; j<segs; j++) {
+ for (j=0; j<segs; j++)
+ {
start = v->map[j].start;
end = v->map[j].end;
pe = start;
@@ -468,11 +468,7 @@ void movinv1(int iter, ulong p1, ulong p
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -480,14 +476,16 @@ void movinv1(int iter, ulong p1, ulong p
if (p == pe ) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * for (; p < pe; p++) {
- * if ((bad=*p) != p1) {
- * error((ulong*)p, p1, bad);
- * }
- * *p = p2;
- * }
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ for (; p < pe; p++) {
+ ulong bad;
+ if ((bad=*p) != p1) {
+ error((ulong*)p, p1, bad);
+ }
+ *p = p2;
+ }
+#else
asm __volatile__ (
"jmp L2\n\t" \
@@ -522,10 +520,12 @@ void movinv1(int iter, ulong p1, ulong p
: "a" (p1), "0" (p), "d" (pe), "b" (p2)
: "ecx"
);
+#endif
do_tick();
BAILR
} while (!done);
}
+
for (j=segs-1; j>=0; j--) {
start = v->map[j].start;
end = v->map[j].end;
@@ -534,11 +534,7 @@ void movinv1(int iter, ulong p1, ulong p
done = 0;
do {
/* Check for underflow */
- if (pe - SPINSZ < pe) {
- pe -= SPINSZ;
- } else {
- pe = start;
- }
+ pe = sat_sub(pe, SPINSZ, start);
if (pe <= start) {
pe = start;
done++;
@@ -546,14 +542,16 @@ void movinv1(int iter, ulong p1, ulong p
if (p == pe ) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * do {
- * if ((bad=*p) != p2) {
- * error((ulong*)p, p2, bad);
- * }
- * *p = p1;
- * } while (p-- > pe);
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ do {
+ ulong bad;
+ if ((bad=*p) != p2) {
+ error((ulong*)p, p2, bad);
+ }
+ *p = p1;
+ } while (p-- > pe);
+#else
asm __volatile__ (
"addl $4, %%edi\n\t"
"jmp L9\n\t"
@@ -590,6 +588,7 @@ void movinv1(int iter, ulong p1, ulong p
: "a" (p1), "0" (p), "d" (pe), "b" (p2)
: "ecx"
);
+#endif
do_tick();
BAILR
} while (!done);
@@ -623,11 +622,7 @@ void movinv32(int iter, ulong p1, ulong
pat = p1;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -685,11 +680,7 @@ void movinv32(int iter, ulong p1, ulong
pat = p1;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -798,11 +789,7 @@ void movinv32(int iter, ulong p1, ulong
done = 0;
do {
/* Check for underflow */
- if (pe - SPINSZ < pe) {
- pe -= SPINSZ;
- } else {
- pe = start;
- }
+ pe = sat_sub(pe, SPINSZ, start);
if (pe <= start) {
pe = start;
done++;
@@ -906,11 +893,7 @@ void modtst(int offset, int iter, ulong
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -951,11 +934,7 @@ void modtst(int offset, int iter, ulong
k = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;
@@ -1009,11 +988,7 @@ void modtst(int offset, int iter, ulong
done = 0;
do {
/* Check for overflow */
- if (pe + SPINSZ > pe) {
- pe += SPINSZ;
- } else {
- pe = end;
- }
+ pe = sat_add(pe, SPINSZ, end);
if (pe >= end) {
pe = end;
done++;

View File

@ -1,10 +0,0 @@
--- memtest86+-1.70/memtest_shared.lds 2007-02-19 16:00:35.000000000 +0100
+++ memtest86+-1.70/memtest_shared.lds.fixed 2007-02-19 15:55:24.000000000 +0100
@@ -19,6 +19,7 @@
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynamic : { *(.dynamic) }
.rel.text : { *(.rel.text .rel.text.*) }

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:35ad452f4fd12f07756abccccf1bce70d42596c2c5e9c29247ffc8e0b76bd1ae
size 165984

3
memtest86+-4.00.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ec42f549da81b715bfc5c55b93b74774fb5c35f7578c7eecebab3ca37866ca4
size 270327

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Mon Sep 28 15:18:24 CEST 2009 - trenn@suse.de
- Update to latest 4.00 version.
Changes from mainline changelog:
Features:
* Major Architectural changes
* First pass twice faster (reduced iterations)
* Detect DDR2/3 brands and part numbers on Intel DDR2/3 chipsets
* Added detection for Intel "Clarkdale" CPU
* Added detection for Intel "Gulftown" CPU
* Added detection for AMD "Magny-Cours" CPU
* Added detection for Intel XMP Memory
* Added for CPU w/ 0.5/1.5/3/6/12/16/18/24MB L3
* Added "clean" DMI detection for DDR3/FBDIMM2
* Better detection of Integrated Memory Controllers
Bug Fixes
* Corrected detection for Intel "Lynnfield" CPU
* Corrected detection for AMD 45nm K10 CPU
* Solved crash with AMD Geode LX
* Complies with SMBIOS 2.6.1 specs
* Fixed compilation issues with gcc 4.2+
* Many others bug fixes
-------------------------------------------------------------------
Fri Nov 28 16:09:47 CET 2008 - duwe@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package memtest86+ (Version 2.01)
# spec file for package memtest86+ (Version 4.00)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,10 +18,10 @@
Name: memtest86+
Version: 2.01
Release: 46
Version: 4.00
Release: 1
#
License: BSD 3-Clause
License: BSD 3-clause (or similar)
Group: System/Boot
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -39,8 +39,8 @@ Source: http://www.memtest.org/download/%{version}/%{name}-%{version}.ta
Patch0: fix-destdir
Patch1: include-linkonce
Patch2: serial-enable
Patch3: include-gnuhash
Patch4: fix-overflows.diff
Patch3: declare-static.diff
Patch4: use_assembler_routine.patch
Patch5: work-around-4G-virtual-overflow
#
Summary: Memory Testing Image for x86 Architecture
@ -99,119 +99,3 @@ test -x /sbin/update-bootloader && /sbin/update-bootloader --remove --force --im
%doc README* changelog FAQ
%changelog
* Fri Nov 28 2008 duwe@suse.de
- work around a virtual address wrap at 4G, if > 5GB are installed
(bnc#388191)
* Wed Apr 30 2008 coolo@suse.de
- update to 2.01 - among others:
- Solved a major bug in Memory Address Errors Reporting
- Patched for Intel-Powered Mac
- Pass duration 20%% reduced
- Solved a incoherency with pass progress indicator
- Added support for 45 nm Mobile Core 2 w/ 3 Mo L2
- Corrected Intel 3-Series (P35/X38) chipset init
- fix buffer overflows (bnc#359490) from Michael Matz
* Fri Aug 10 2007 duwe@suse.de
- Do not fail to install if update-bootloader is not there.
* Thu Aug 09 2007 duwe@suse.de
- Add memtest86+ to boot menu even if installed later
(Feature #301969)
* Mon Feb 19 2007 trenn@suse.de
- added .gnu.hash section
* Thu Jan 25 2007 duwe@suse.de
+ update to 1.70:
- Added new DMI polling feature (Thanks to Joachim D.)
- Added Support for Core/Core2 Solo/Duo/Quad CPU
- Added Support for AMD K8 with DDR2 Memory
- Added Support for Intel CPU with 192/384 KB L2 Cache
- Added Support for FB-DIMM based memory (DMI)
- Added Detection for ALI CyberAladdin-T (M1644)
- Added Detection for Turion 64 X2
- Added Detection for AMD K8 with unknown chipsets
- Added Support for ATi Radeon xPress 3200
- Added Support for Intel i975X
- Added Support for Intel Q965/P965
- Added Support for Intel Q963/Q965
* Thu Nov 16 2006 mrueckert@suse.de
- switch to memtest86+ (http://www.memtest.org)
Compared to memtest86 3.2 it supports more hardware. and has
additional fixes. see http://www.memtest.org/#change for all
details. This upgrade fixes bug (#148481).
- rediffed memtest86-3.2.diff to apply cleanly.
new name: memtest86+-1.65.diff
- rediffed memtest86-3.2-timeout-serialconsole.diff to apply cleanly.
new name: memtest86+-1.65_timeout-serialconsole.diff
- rediffed memtest86-include-linkonce to apply cleanly.
new name: memtest86+-1.65_include-linkonce.patch
- cleaned up build section and directly use install instead of the
broken install target
- added changelog and FAQ to the docs
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue May 10 2005 duwe@suse.de
- include *.gnu.linkonce.t.* sections in ld script,
to build cleanly on amd64 with gcc4
* Mon Mar 14 2005 duwe@suse.de
- update to current version 3.2:
more support for current CPUs and chipsets
fix Bugs #60303 (duped #72202), #71215
* Mon Mar 22 2004 stepan@suse.de
- update to 3.1a. This fixes compilation with gcc 3.x
- drop precompiled binary completely
- add ExclusiveArch for x86 and AMD64
* Fri Mar 19 2004 stepan@suse.de
- update to v3.1
- remove gcc 2.95 exceptions
* Sun Sep 08 2002 kukuk@suse.de
- Add splitt alias [Bug #19111]
* Thu Sep 05 2002 garloff@suse.de
- memtest86-3.0 seems to hang on some machines if the serial
console support is enabled, but no serial console connected.
Add a timeout waiting for the serial console. (Bug #18302)
* Mon Sep 02 2002 garloff@suse.de
- Supply complete image (compiled by gcc-2.95), as I don't succeed
solving the gcc-3.2 problems at this moment. (#18302)
* Sat Aug 31 2002 garloff@suse.de
- Supply main.s compiled with gcc-2.95 to work around problem with
gcc-3.2.
* Tue Jul 30 2002 garloff@suse.de
- Split off lilo package.
* Tue Jul 30 2002 sf@suse.de
- added -m32 to compiler and linker for x86_64
- added --32 to as
- added glibc-devel-32bit for x86_64
* Fri Jun 07 2002 garloff@suse.de
- Update to memtest86-3.0:
* Testing more than 2GB should work now.
* Use PIC instead of two copies
* Serial code avoid redundant writes now
* ^l/l gives screen refresh (after connecting serial console)
* Netbooting operational again
* LinuxBIOS support (memory sizing)
* Mon Apr 22 2002 garloff@suse.de
- Update to memtest86-2.9:
* Provide three memory sizing modes; default is conservative one
probably not testing all memory on some boards
* Testing more than 2GB supported
* Memory testing in segments. Minor bug fixes.
* Fri Feb 15 2002 mantel@suse.de
- remove x bit from memtest.bin since it's not a Linux executable
* Wed Dec 12 2001 garloff@suse.de
- Update to memtest86-2.8(a):
* Reworked build process; a network bootable boot image can be
produced
* mem and cache speed detection code rewritten (should work now)
* CPU detection for Pentium 4
* Serial console disabled by default
- Reenabled memtest86 serial console (9600 8n1) ;-)
- Clean up .spec file a bit
* Mon Jul 16 2001 uli@suse.de
- update memtest -> 2.7
* Mon Apr 09 2001 garloff@suse.de
- memtest86: Correct units (cosmetic)
* Thu Dec 21 2000 garloff@suse.de
- Update memtest86 to v2.5 final.
* Wed Nov 29 2000 garloff@suse.de
- Update memtest86 to v2.5-beta (Athlon/Duron support)
* Mon Aug 28 2000 garloff@suse.de
- Added memtest86-2.4.

View File

@ -1,5 +1,13 @@
--- memtest86+-2.01/config.h
+++ memtest86+-2.01/config.h
---
config.h | 2 +-
init.c | 4 ++++
serial.h | 10 ++++++----
3 files changed, 11 insertions(+), 5 deletions(-)
Index: memtest86+-4.00/config.h
===================================================================
--- memtest86+-4.00.orig/config.h
+++ memtest86+-4.00/config.h
@@ -13,7 +13,7 @@
/* SERIAL_CONSOLE_DEFAULT - The default state of the serial console. */
/* This is normally off since it slows down testing. Change to a 1 */
@ -9,9 +17,11 @@
/* SERIAL_TTY - The default serial port to use. 0=ttyS0, 1=ttyS1 */
#define SERIAL_TTY 0
--- memtest86+-2.01/init.c
+++ memtest86+-2.01/init.c
@@ -40,6 +40,7 @@
Index: memtest86+-4.00/init.c
===================================================================
--- memtest86+-4.00.orig/init.c
+++ memtest86+-4.00/init.c
@@ -42,6 +42,7 @@ static void cpu_type(void);
static void cacheable(void);
static int cpuspeed(void);
int beepmode;
@ -19,7 +29,7 @@
static void display_init(void)
{
@@ -76,6 +77,9 @@
@@ -78,6 +79,9 @@ static void display_init(void)
}
serial_echo_print("\x1B[0m");
@ -29,8 +39,10 @@
}
/*
--- memtest86+-2.01/serial.h
+++ memtest86+-2.01/serial.h
Index: memtest86+-4.00/serial.h
===================================================================
--- memtest86+-4.00.orig/serial.h
+++ memtest86+-4.00/serial.h
@@ -140,10 +140,12 @@
#define serial_echo_inb(a) inb((a)+serial_base_ports[serial_tty])
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)

104
use_assembler_routine.patch Normal file
View File

@ -0,0 +1,104 @@
Use assember code, don't execute the functions twice
Index: memtest86+-4.00/test.c
===================================================================
--- memtest86+-4.00.orig/test.c
+++ memtest86+-4.00/test.c
@@ -444,17 +444,19 @@ void movinv1(int iter, ulong p1, ulong p
if ((uintptr_t)p == (uintptr_t)pe) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * for (; p < pe; p++) {
- * *p = p1;
- * }
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ for (; p < pe; p++) {
+ *p = p1;
+ }
+#else
asm __volatile__ (
"rep\n\t" \
"stosl\n\t"
: "=D" (p)
: "c" (len), "0" (p), "a" (p1)
);
+#endif
do_tick();
BAILR
} while (!done);
@@ -484,14 +486,16 @@ void movinv1(int iter, ulong p1, ulong p
if ((uintptr_t)p == (uintptr_t)pe) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * for (; p < pe; p++) {
- * if ((bad=*p) != p1) {
- * error((ulong*)p, p1, bad);
- * }
- * *p = p2;
- * }
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ for (; p < pe; p++) {
+ ulong bad;
+ if ((bad=*p) != p1) {
+ error((ulong*)p, p1, bad);
+ }
+ *p = p2;
+ }
+#else
asm __volatile__ (
"jmp L2\n\t" \
@@ -526,10 +530,12 @@ void movinv1(int iter, ulong p1, ulong p
: "a" (p1), "0" (p), "d" (pe), "b" (p2)
: "ecx"
);
+#endif
do_tick();
BAILR
} while (!done);
}
+
for (j=segs-1; j>=0; j--) {
start = v->map[j].start;
end = v->map[j].end;
@@ -550,14 +556,16 @@ void movinv1(int iter, ulong p1, ulong p
if ((uintptr_t)p == (uintptr_t)pe) {
break;
}
-/* Original C code replaced with hand tuned assembly code
- * do {
- * if ((bad=*p) != p2) {
- * error((ulong*)p, p2, bad);
- * }
- * *p = p1;
- * } while (p-- > pe);
- */
+/* Original C code replaced with hand tuned assembly code */
+#if 0
+ do {
+ ulong bad;
+ if ((bad=*p) != p2) {
+ error((ulong*)p, p2, bad);
+ }
+ *p = p1;
+ } while (p-- > pe);
+#else
asm __volatile__ (
"addl $4, %%edi\n\t"
"jmp L9\n\t"
@@ -594,6 +602,7 @@ void movinv1(int iter, ulong p1, ulong p
: "a" (p1), "0" (p), "d" (pe), "b" (p2)
: "ecx"
);
+#endif
do_tick();
BAILR
} while (!done);