wok-current rev 21569

Up zstd (1.4.0), fix linld: base_himem/strtol
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 18 13:29:32 2019 +0200 (2019-05-18)
parents 2514d4060d32
children d8057344b557
files libspectrum-dev/receipt libspectrum/receipt linld/stuff/src/CRTL.ASM linld/stuff/src/CRTL.H linld/stuff/src/HIMEM.CPP linld/stuff/src/LINLD.CPP linld/stuff/src/LOAD.CPP linld/stuff/src/TAZBOOT.CPP linld/stuff/src/pipehole.awk syslinux/stuff/iso2exe/win32.c zstd-dev/receipt zstd/receipt
line diff
     1.1 --- a/libspectrum-dev/receipt	Sat May 18 10:15:49 2019 +0100
     1.2 +++ b/libspectrum-dev/receipt	Sat May 18 13:29:32 2019 +0200
     1.3 @@ -6,7 +6,7 @@
     1.4  SHORT_DESC="Development files for libspectrum."
     1.5  MAINTAINER="slaxemulator@gmail.com"
     1.6  LICENSE="GPL2"
     1.7 -WEB_SITE="https://fuse-emulator.sourceforge.net/libspectrum.php"
     1.8 +WEB_SITE="http://fuse-emulator.sourceforge.net/libspectrum.php"
     1.9  
    1.10  WANTED="libspectrum"
    1.11  DEPENDS="libspectrum"
     2.1 --- a/libspectrum/receipt	Sat May 18 10:15:49 2019 +0100
     2.2 +++ b/libspectrum/receipt	Sat May 18 13:29:32 2019 +0200
     2.3 @@ -6,7 +6,7 @@
     2.4  SHORT_DESC="ZX Spectrum emulator support library."
     2.5  MAINTAINER="slaxemulator@gmail.com"
     2.6  LICENSE="GPL2"
     2.7 -WEB_SITE="https://fuse-emulator.sourceforge.net/libspectrum.php"
     2.8 +WEB_SITE="http://fuse-emulator.sourceforge.net/libspectrum.php"
     2.9  
    2.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.11  WGET_URL="$SF_MIRROR/fuse-emulator/$TARBALL"
     3.1 --- a/linld/stuff/src/CRTL.ASM	Sat May 18 10:15:49 2019 +0100
     3.2 +++ b/linld/stuff/src/CRTL.ASM	Sat May 18 13:29:32 2019 +0200
     3.3 @@ -380,31 +380,31 @@
     3.4  	global	@argstr$qpxzcxt1ppxzc:near
     3.5  	proc	@argstr$qpxzcxt1ppxzc near
     3.6  
     3.7 -		stc
     3.8 -		db	73h			; jnc
     3.9 +		mov	cl,2
    3.10 +		db	0a9h			; test	ax,#
    3.11  	global	@argnum$qpzcxpxzcpul:near
    3.12  @argnum$qpzcxpxzcpul:
    3.13 -		clc
    3.14 -
    3.15 -		xchg	ax,bx			; keywords
    3.16 -		xchg	ax,cx			; s
    3.17 -		xchg	ax,dx			; vars
    3.18 -		sbb	dx,dx			; str:-1	num:0
    3.19 -		sbb	dx,-4			; str:2		num:4
    3.20 +		mov	cl,4
    3.21 +		xchg	ax,bx			; keywords -> bx
    3.22 +		xchg	ax,cx			; s -> cx
    3.23 +		cbw				; argstr:0002 argnum:0004
    3.24 +		xchg	ax,dx			; vars -> ax
    3.25  		push	si di
    3.26 -		xchg	ax,di			; vars
    3.27 +		xchg	ax,di			; vars => di
    3.28  		dec	bx
    3.29 -		mov	al,0
    3.30  @@testalt:
    3.31 +		mov	al,-1
    3.32  		sub	di,dx
    3.33  @@test:
    3.34  		cmp	al,'='
    3.35  		je	@@found
    3.36 +		cmp	al,0			; eos, si=next argv
    3.37 +		je	@@found
    3.38  		mov	si,cx			; s
    3.39  		add	di,dx
    3.40  @@match:
    3.41 -		inc	bx
    3.42 -		lodsb
    3.43 +		inc	bx			; keywords++
    3.44 +		lodsb				; *s++
    3.45  		or	al,20h
    3.46  		cmp	al,[bx]
    3.47  		je	@@match
    3.48 @@ -414,10 +414,8 @@
    3.49  		je	@@match
    3.50  @@notopt:
    3.51  		ifdef	EXTRA
    3.52 -		add	di,dx
    3.53  		cmp	[byte bx],'/'
    3.54  		je	@@testalt
    3.55 -		sub	di,dx
    3.56  		endif
    3.57  		cmp	[byte bx],'|'
    3.58  		je	@@test
    3.59 @@ -432,7 +430,7 @@
    3.60  		dec	dx
    3.61  		dec	dx
    3.62  		je	@@done
    3.63 -		push	si
    3.64 +		mov	bx,si
    3.65  		call	@strtol$qpxzc
    3.66  		mov	[di],ax
    3.67  		mov	[di+2],dx
    3.68 @@ -1038,21 +1036,19 @@
    3.69  
    3.70  
    3.71  ;***************************************************************
    3.72 -;pascal unsigned long strtol(const char *s);
    3.73 +;_fastcall unsigned long strtol(const char *s);
    3.74  ;***************************************************************
    3.75  	global	@strtol$qpxzc:near
    3.76  	proc	@strtol$qpxzc near
    3.77  
    3.78 -		pop	ax
    3.79 -                pop	bx			; s
    3.80 -		push	ax
    3.81  		ifndef	NO386
    3.82 -		xor	ebx,ebx
    3.83  		push	si
    3.84 -		jcxz	@@end
    3.85 -		mov	si,cx
    3.86 +		mov	si,bx
    3.87  		xor	ecx,ecx
    3.88  		xor	eax,eax
    3.89 +		xor	ebx,ebx
    3.90 +		or	si,si
    3.91 +		jz	@@end
    3.92  		lodsb
    3.93  		mov	dx,ax
    3.94  		or	al,20h
    3.95 @@ -1136,9 +1132,10 @@
    3.96  		push	di
    3.97  		xor	ax,ax
    3.98  		cwd
    3.99 -		jcxz	@@goend
   3.100 +		or	bx,bx
   3.101 +		jz	@@goend
   3.102  		xchg	ax,di
   3.103 -		mov	si,cx
   3.104 +		mov	si,bx
   3.105  		lodsb
   3.106  		mov	bx,ax
   3.107  		or	al,20h
     4.1 --- a/linld/stuff/src/CRTL.H	Sat May 18 10:15:49 2019 +0100
     4.2 +++ b/linld/stuff/src/CRTL.H	Sat May 18 13:29:32 2019 +0200
     4.3 @@ -37,7 +37,7 @@
     4.4  extern _fastcall int read(int fd, void* data, int sz);
     4.5  extern _fastcall long lseekcur(int fd, int whence);
     4.6  extern _fastcall int puts(const char* s);
     4.7 -extern pascal unsigned long strtol(const char *s);
     4.8 +extern _fastcall unsigned long strtol(const char *s);
     4.9  
    4.10  // Extensions
    4.11  #define cli() do { asm { cli } } while(0)
     5.1 --- a/linld/stuff/src/HIMEM.CPP	Sat May 18 10:15:49 2019 +0100
     5.2 +++ b/linld/stuff/src/HIMEM.CPP	Sat May 18 13:29:32 2019 +0200
     5.3 @@ -53,7 +53,8 @@
     5.4      struct image_himem *m = &pm;
     5.5      u32 *q;
     5.6      vm2rm();
     5.7 -    if(((u16 *)&m->fallback)[1] >= 0x10) m->fallback = _1m; // >= _1m ?
     5.8 +    if(((u16 *)&m->fallback)[1] >= 0x10) // >=	_1m ?
     5.9 +	((u16 *)&m->fallback)[1] = 0x10;
    5.10      q = m->bufv;
    5.11      if(q==0) {
    5.12          // Move kernel
     6.1 --- a/linld/stuff/src/LINLD.CPP	Sat May 18 10:15:49 2019 +0100
     6.2 +++ b/linld/stuff/src/LINLD.CPP	Sat May 18 13:29:32 2019 +0200
     6.3 @@ -14,6 +14,7 @@
     6.4  			// -1 = Normal VGA
     6.5  			//  n = as "n" was pressed
     6.6  u32 topmem;
     6.7 +u32 base_himem;
     6.8  
     6.9  inline void syntax() {
    6.10      die("Syntax:" NL
    6.11 @@ -25,20 +26,14 @@
    6.12          "\tinitrd,vga,root=(void)" NL
    6.13          "\tmem=256m" NL
    6.14          "\tcl=auto" NL
    6.15 -#ifdef	USE_ARGSTR
    6.16 -        "\t-b=1088k" NL
    6.17 -#else
    6.18          "\t-b 1088k" NL
    6.19 -#endif
    6.20          "Use quotes: \"cl=...\" if you need spaces in cmdline" NL
    6.21          "Use cl=@filename to get it from a file"
    6.22  #if 1
    6.23          NL NL "Examples:" NL
    6.24 -#ifdef	USE_ARGSTR
    6.25 -        "\tLINLD -f -b=64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\""
    6.26 -#else
    6.27 -        "\tLINLD -f -b 64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\""
    6.28 -#endif
    6.29 +	"\tLINLD -f -b 64m "
    6.30 +        "initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz "
    6.31 +	"\"cl=rw root=/dev/null video=-32\""
    6.32  	NL NL "\tLINLD image=memtest"
    6.33  #endif
    6.34      );
    6.35 @@ -49,8 +44,7 @@
    6.36  
    6.37      (void) argc;
    6.38  
    6.39 -    // Believe it or not - this enables A20
    6.40 -    // on my box! Must be DOS in HMA...   -vda
    6.41 +    ((u16*) &base_himem)[1] |= (_1m+_64k)>>16;	// base_himem = _1m+_64k
    6.42      puts("LINLD v" VERSION_STR "+");
    6.43  
    6.44      // Parse command line
    6.45 @@ -99,12 +93,10 @@
    6.46              kernel_name=s;
    6.47          }
    6.48          else if(strhead(s,"initrd=") == 0) {
    6.49 -	    s+=7;
    6.50 -            initrd_name=s;
    6.51 +            initrd_name=s+7;
    6.52          }
    6.53          else if(strhead(s,"vga=") == 0) {
    6.54 -	    s+=4;
    6.55 -            vid_mode = strtol(s);	// support normal, extended & ask
    6.56 +            *(u16*)&vid_mode = (u16)strtol(s+7);	// support normal, extended & ask
    6.57          }
    6.58          else switch (*(u16 *)s|0x2002) {
    6.59  	case 0x662F:	// -F /f
    6.60 @@ -112,7 +104,7 @@
    6.61  	    goto next;
    6.62  	case 0x622F:	// -B /b
    6.63  	    argv++;
    6.64 -	    base_himem = strtol(*argv);
    6.65 +	    ((u16 *)&base_himem)[1] = (u16)(strtol(*argv)>>16);
    6.66  	    goto next;
    6.67  	default:
    6.68  	    if(strhead(s,"cl=") == 0) {
    6.69 @@ -124,9 +116,8 @@
    6.70  		    s++;
    6.71  		    image.errmsg = "Error in cl=@file";
    6.72  		    open_image(s, &image);
    6.73 -		    cmdline=s=(char *)malloc_or_die(image.size);
    6.74 -		    s+=image.size;
    6.75 -		    read(image.fd, (void *)cmdline, image.size);
    6.76 +		    s+=read(image.fd, (void *)cmdline=s=
    6.77 +			(char *)malloc_or_die(image.size), image.size);
    6.78  		    // Strip any trailing cr/lf
    6.79  		    c='\0';
    6.80  		    do {
    6.81 @@ -140,13 +131,11 @@
    6.82  		}
    6.83  	    }
    6.84              else if(strhead(s,"root=") == 0) {
    6.85 -		s+=5;
    6.86 -		root_dev = strtol(s);
    6.87 +		*(u16*)&root_dev = (u16)strtol(s+5);
    6.88  		goto addincmdline;
    6.89  	    }
    6.90  	    else if(strhead(s,"mem=") == 0) {
    6.91 -		s+=4;
    6.92 -		topmem = strtol(s);
    6.93 +		((u16 *)&topmem)[1] = (u16)(strtol(s+4)>>16);
    6.94  		goto addincmdline;
    6.95  	    }
    6.96  	    else {
     7.1 --- a/linld/stuff/src/LOAD.CPP	Sat May 18 10:15:49 2019 +0100
     7.2 +++ b/linld/stuff/src/LOAD.CPP	Sat May 18 13:29:32 2019 +0200
     7.3 @@ -123,8 +123,6 @@
     7.4  static u8* rm_buf;	// @ = @rm_size + 3, see JUMP.ASM
     7.5  struct image_himem imgs[2];
     7.6  
     7.7 -u32 base_himem = _1m+_64k;
     7.8 -
     7.9  static const char kernel_file_error[] = "Can't use kernel file";
    7.10  char* load_kernel() {
    7.11  
     8.1 --- a/linld/stuff/src/TAZBOOT.CPP	Sat May 18 10:15:49 2019 +0100
     8.2 +++ b/linld/stuff/src/TAZBOOT.CPP	Sat May 18 13:29:32 2019 +0200
     8.3 @@ -156,12 +156,14 @@
     8.4  u32 root_dev;
     8.5  u32 vid_mode;
     8.6  u32 topmem;
     8.7 +u32 base_himem;
     8.8  const char* kernel_name = "bzImage";
     8.9  const char* initrd_name;
    8.10  char* iso;
    8.11  
    8.12  int main(int argc, char *argv[])
    8.13  {
    8.14 +	((u16*) &base_himem)[1] |= (_1m+_64k)>>16;	// base_himem = _1m+_64k
    8.15  	argv[0] = progname();
    8.16  	bootiso(argv);	// iso ? parsing is /init.exe stuff !
    8.17  
    8.18 @@ -197,7 +199,7 @@
    8.19  		else if(i == 1 && fileexist(s) != -1) {
    8.20  			kernel_name = s;
    8.21  		}
    8.22 -		else strcatb(buf_cmdline,*argv);
    8.23 +		else strcatb(buf_cmdline,*argv);	// FIXME mem ?
    8.24  	}
    8.25  #else
    8.26  		if (strhead(s,"kernel=") == 0) {
    8.27 @@ -224,35 +226,33 @@
    8.28  			goto set_iso;
    8.29  		}
    8.30  		else if(strhead(s,"vga=") == 0) {
    8.31 -			s += 4;
    8.32 -			vid_mode = strtol(s);	// support normal, extended & ask
    8.33 +			*(u16*)&vid_mode = (u16)strtol(s+4);	// support normal, extended & ask
    8.34  		}
    8.35  	        else switch (*(u16 *)s|0x2002) {
    8.36  		case 0x662F:	// -F /f
    8.37  			skip_alloc++;
    8.38  			goto next;
    8.39  		case 0x652F:	// -E /e
    8.40 -			argv++;
    8.41 -			topmem = strtol(*argv);
    8.42 -			goto next;
    8.43 +			s=*++argv;
    8.44 +			goto set_topmem;
    8.45  		case 0x622F:	// -B /b
    8.46  			argv++;
    8.47 -			base_himem = strtol(*argv);
    8.48 +			((u16 *)&base_himem)[1] = (u16)(strtol(*argv)>>16);
    8.49  			goto next;
    8.50  		default:
    8.51  		if(i == 1 && fileexist(s) != -1) {
    8.52  			goto set_kernelz;
    8.53  		}
    8.54  		else {
    8.55 +			strcatb(buf_cmdline,*argv);
    8.56  			if(strhead(s,"root=") == 0) {
    8.57 -				s += 5;
    8.58 -				root_dev = strtol(s);
    8.59 +				*(u16*)&root_dev = (u16)strtol(s+5);
    8.60  			}
    8.61  			if(strhead(s,"mem=") == 0) {
    8.62  				s += 4;
    8.63 -				topmem = strtol(s);
    8.64 +			set_topmem:
    8.65 +				((u16 *)&topmem)[1] = (u16)(strtol(s)>>16);
    8.66  			}
    8.67 -			strcatb(buf_cmdline,*argv);
    8.68  		}}
    8.69  	}
    8.70  #endif
     9.1 --- a/linld/stuff/src/pipehole.awk	Sat May 18 10:15:49 2019 +0100
     9.2 +++ b/linld/stuff/src/pipehole.awk	Sat May 18 13:29:32 2019 +0200
     9.3 @@ -35,6 +35,9 @@
     9.4  		if (/^	sub	[abcds][ix],2$/) {
     9.5  			split($2,regs,","); hold=13; next
     9.6  		}
     9.7 +		if (/^	push	dx$/) {
     9.8 +			hold=14; next;
     9.9 +		}
    9.10  	}
    9.11  	else if (hold == 1) {
    9.12  		if (/^   ;/) { line[kept++]=$0; next }
    9.13 @@ -185,6 +188,29 @@
    9.14  		}
    9.15  		else	print "	sub	" regs[1] ",2"
    9.16  	}
    9.17 +	else if (hold == 14) {
    9.18 +		if (/^	push	ax$/) { hold++; next; }
    9.19 +		print	"	push	dx";
    9.20 +		hold=0;
    9.21 +	}
    9.22 +	else if (hold == 15) {
    9.23 +		if (/^	pop	eax$/) { hold++; next; }
    9.24 +		print	"	push	dx";
    9.25 +		print	"	push	ax";
    9.26 +		hold=0;
    9.27 +	}
    9.28 +	else if (hold == 16) {
    9.29 +		hold=0;
    9.30 +		if (/^	shr	eax,16$/) { print "	xchg	ax,dx"; next; }
    9.31 +		print	"	push	dx";
    9.32 +		print	"	push	ax";
    9.33 +		print	"	pop	eax";
    9.34 +	}
    9.35 +	else if (hold == 17) {
    9.36 +		hold=0;
    9.37 +		if (/^	cmp	ax,-1$/) { print "	inc	ax"; next; }
    9.38 +	}
    9.39 +	if (/^	call	near ptr @fileexist\$/) { print; hold=17; next; }
    9.40  	s=$0
    9.41  	# These optimisation may break ZF or CF
    9.42  	if (/^	sub	sp,2$/) { print "	push	ax"; next }
    10.1 --- a/syslinux/stuff/iso2exe/win32.c	Sat May 18 10:15:49 2019 +0100
    10.2 +++ b/syslinux/stuff/iso2exe/win32.c	Sat May 18 13:29:32 2019 +0200
    10.3 @@ -167,7 +167,7 @@
    10.4  	const char pifFileName[] = "slitaz.pif";
    10.5  
    10.6  	strcpy(PIF_content.s0.program_filename, isoFileName);
    10.7 -	fd = open(pifFileName, O_WRONLY|O_BINARY|O_CREAT,0555);
    10.8 +	fd = open(pifFileName, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC,0555);
    10.9  	write(fd,&PIF_content,sizeof(PIF_content));
   10.10  	close(fd);
   10.11  	WinExec(pifFileName, SW_MINIMIZE);
    11.1 --- a/zstd-dev/receipt	Sat May 18 10:15:49 2019 +0100
    11.2 +++ b/zstd-dev/receipt	Sat May 18 13:29:32 2019 +0200
    11.3 @@ -1,7 +1,7 @@
    11.4  # SliTaz package receipt.
    11.5  
    11.6  PACKAGE="zstd-dev"
    11.7 -VERSION="1.3.8"
    11.8 +VERSION="1.4.0"
    11.9  CATEGORY="development"
   11.10  SHORT_DESC="Zstandard - Fast and efficient compression algorithm, development files."
   11.11  MAINTAINER="pascal.bellard@slitaz.org"
    12.1 --- a/zstd/receipt	Sat May 18 10:15:49 2019 +0100
    12.2 +++ b/zstd/receipt	Sat May 18 13:29:32 2019 +0200
    12.3 @@ -1,7 +1,7 @@
    12.4  # SliTaz package receipt.
    12.5  
    12.6  PACKAGE="zstd"
    12.7 -VERSION="1.3.8"
    12.8 +VERSION="1.4.0"
    12.9  CATEGORY="base-system"
   12.10  SHORT_DESC="Zstandard - Fast and efficient compression algorithm."
   12.11  MAINTAINER="pascal.bellard@slitaz.org"