void-packages/srcpkgs/memtest86+/patches/03.memtest86+-5.01-crash-fix.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

101 lines
2.8 KiB
Diff

Patch to get memtest86+ working with gcc 4.7.2 or later and PCI scan fix
these patches were taken from Mageia
upstream report containing link to the patches:
http://forum.canardpc.com/threads/83443-Memtest86-V5.01-crashes-with-gcc-4.7.2-or-later
Patch source: http://pkgs.fedoraproject.org/cgit/rpms/memtest86+.git/
--- a/controller.c
+++ b/controller.c
@@ -2,6 +2,8 @@
* MemTest86+ V5 Specific code (GPL V2.0)
* By Samuel DEMEULEMEESTER, sdemeule@memtest.org
* http://www.canardpc.com - http://www.memtest.org
+ *
+ * Edited by David McInnis Oct 4, 2014
*/
//#include "defs.h"
@@ -292,7 +294,7 @@ static void setup_nhm(void)
/* First, locate the PCI bus where the MCH is located */
- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
vid &= 0xFFFF;
@@ -327,7 +329,7 @@ static void setup_nhm32(void)
ctrl.mode = ECC_NONE;
/* First, locate the PCI bus where the MCH is located */
- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
vid &= 0xFFFF;
@@ -1424,7 +1426,7 @@ static void poll_fsb_amd64(void) {
unsigned long dramchr;
float clockratio;
double dramclock;
- unsigned int dummy[3];
+ unsigned int dummy[4];
int ram_type;
float coef = 10;
@@ -2851,13 +2853,13 @@ static void poll_timings_nf4ie(void) {
static void poll_timings_i875(void) {
- ulong dev6, dev62;
+ ulong dev6;
ulong temp;
float cas;
int rcd, rp, ras, chan;
long *ptr, *ptr2;
- pci_conf_read( 0, 6, 0, 0x40, 4, &dev62);
+ pci_conf_read( 0, 6, 0, 0x40, 4, &dev6);
ptr2=(long*)(dev6+0x68);
/* Read the MMR Base Address & Define the pointer */
--- a/init.c
+++ b/init.c
@@ -7,6 +7,8 @@
*
* Released under version 2 of the Gnu Public License.
* By Chris Brady
+ *
+ * Edited by David McInnis October 4, 2014
*/
@@ -914,7 +916,6 @@ void cpu_type(void)
default:
cprint(0, COL_MID, "Unknown Intel");
break;
- break;
}
}
--- a/main.c
+++ b/main.c
@@ -422,7 +422,7 @@ void test_start(void)
//initialise_cpus();
btrace(my_cpu_num, __LINE__, "BeforeInit", 1, 0, 0);
/* Draw the screen and get system information */
- init();
+ init();
/* Set defaults and initialize variables */
set_defaults();
@@ -737,7 +737,7 @@ void test_start(void)
/* Do the same test for each CPU */
if (++cpu_sel >= act_cpus)
{
- cpu_sel = 0;
+ cpu_sel = 0;
next_test();
} else {
continue;