# HG changeset patch # User Pascal Bellard # Date 1486401300 -3600 # Node ID d726d0daa9a785ad39344c5d3790bf44ca53c822 # Parent 7c50dfc88e2a8777faa0201a9ff2bda0d79f3388 memtest: update for GCC5 diff -r 7c50dfc88e2a -r d726d0daa9a7 memtest/receipt --- a/memtest/receipt Sat Feb 04 17:25:27 2017 +0200 +++ b/memtest/receipt Mon Feb 06 18:15:00 2017 +0100 @@ -18,10 +18,8 @@ # Rules to configure and make the package. compile_rules() { - sed -i '/scp memtest.bin/d' Makefile - for i in array-size io setup ; do - patch -p1 < $stuff/$SOURCE-$VERSION-$i.patch - done + sed -i -e '/scp memtest.bin/d' \ + -e 's/no-stack-protector/& -fgnu89-inline/' Makefile make cp $stuff/*.S $stuff/pack . for i in bootloader unpack ; do diff -r 7c50dfc88e2a -r d726d0daa9a7 memtest/stuff/memtest86+-5.01-O0.patch --- a/memtest/stuff/memtest86+-5.01-O0.patch Sat Feb 04 17:25:27 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- memtest86+-5.01/Makefile~ 2014-01-08 01:30:11.355900076 +0000 -+++ memtest86+-5.01/Makefile 2014-01-08 01:31:19.387555469 +0000 -@@ -12,7 +12,7 @@ - AS=as -32 - CC=gcc - --CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \ -+CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \ - -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector - - OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ diff -r 7c50dfc88e2a -r d726d0daa9a7 memtest/stuff/memtest86+-5.01-array-size.patch --- a/memtest/stuff/memtest86+-5.01-array-size.patch Sat Feb 04 17:25:27 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- memtest86+-5.01/controller.c~ 2013-08-10 02:01:58.000000000 +0000 -+++ memtest86+-5.01/controller.c 2013-12-12 20:58:12.873555378 +0000 -@@ -292,7 +292,7 @@ - - /* 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 +327,7 @@ - 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; diff -r 7c50dfc88e2a -r d726d0daa9a7 memtest/stuff/memtest86+-5.01-io.patch --- a/memtest/stuff/memtest86+-5.01-io.patch Sat Feb 04 17:25:27 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- memtest86+-5.01/io.h~ 2013-08-10 02:01:58.000000000 +0000 -+++ memtest86+-5.01/io.h 2014-01-08 01:29:12.404465515 +0000 -@@ -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##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" diff -r 7c50dfc88e2a -r d726d0daa9a7 memtest/stuff/memtest86+-5.01-setup.patch --- a/memtest/stuff/memtest86+-5.01-setup.patch Sat Feb 04 17:25:27 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ ---- memtest86+-5.01/setup.S -+++ memtest86+-5.01/setup.S -@@ -27,11 +27,11 @@ - #ljmp $INITSEG, $(reload - start + 0x200) - reload: - movw $INITSEG, %ax -- movw %ax, %ds - movw %ax, %es - movw %ax, %fs -+ movw %ax, %gs - movw %ax, %ss # reset the stack to INITSEG:0x4000-12. -- movw %dx, %sp -+ movw $0x4000-12, %sp - push %cs - pop %ds - lidt idt_48 - start # load idt with 0,0 -@@ -50,13 +50,13 @@ - jz alt_a20_done - - /* set or clear bit1, the ALT_A20_GATE bit */ -- movb 4(%esp), %ah -- testb %ah, %ah -- jz alt_a20_cont1 -+ //movb 4(%esp), %ah -+ //testb %ah, %ah -+ //jz alt_a20_cont1 - orb $2, %al -- jmp alt_a20_cont2 -+ //jmp alt_a20_cont2 - alt_a20_cont1: -- and $0xfd, %al -+ //and $0xfd, %al - - /* clear the INIT_NOW bit; don't accidently reset the machine */ - alt_a20_cont2: -@@ -87,9 +87,9 @@ - movw $KERNEL_DS, %ax - movw %ax, %ds - movw %ax, %es -- movw %ax, %ss - movw %ax, %fs - movw %ax, %gs -+ movw %ax, %ss - - data32 ljmp $KERNEL_CS, $(TSTLOAD <<4) # jmp offset 2000 of segment 0x10 (cs) - -@@ -100,18 +100,16 @@ - * No timeout is used - if this hangs there is something wrong with - * the machine, and we probably couldn't proceed anyway. - */ -+has_output: -+ call delay -+ inb $0x60, %al # read it - empty_8042: - call delay - inb $0x64, %al # 8042 status port - cmpb $0xff, %al # from grub-a20-patch, skip if not impl - jz empty_8042_ret - testb $1, %al # output buffer? -- jz no_output -- call delay -- inb $0x60, %al # read it -- jmp empty_8042 -- --no_output: -+ jnz has_output - testb $2, %al # is input buffer full? - jnz empty_8042 # yes - loop - empty_8042_ret: