# HG changeset patch # User Pascal Bellard # Date 1558178972 -7200 # Node ID 87b6697bb350bb3f6a2ec2f3a1b43425f602c37b # Parent 2514d4060d32efb5421362e1604c4bdb6dbd7032 Up zstd (1.4.0), fix linld: base_himem/strtol diff -r 2514d4060d32 -r 87b6697bb350 libspectrum-dev/receipt --- a/libspectrum-dev/receipt Sat May 18 10:15:49 2019 +0100 +++ b/libspectrum-dev/receipt Sat May 18 13:29:32 2019 +0200 @@ -6,7 +6,7 @@ SHORT_DESC="Development files for libspectrum." MAINTAINER="slaxemulator@gmail.com" LICENSE="GPL2" -WEB_SITE="https://fuse-emulator.sourceforge.net/libspectrum.php" +WEB_SITE="http://fuse-emulator.sourceforge.net/libspectrum.php" WANTED="libspectrum" DEPENDS="libspectrum" diff -r 2514d4060d32 -r 87b6697bb350 libspectrum/receipt --- a/libspectrum/receipt Sat May 18 10:15:49 2019 +0100 +++ b/libspectrum/receipt Sat May 18 13:29:32 2019 +0200 @@ -6,7 +6,7 @@ SHORT_DESC="ZX Spectrum emulator support library." MAINTAINER="slaxemulator@gmail.com" LICENSE="GPL2" -WEB_SITE="https://fuse-emulator.sourceforge.net/libspectrum.php" +WEB_SITE="http://fuse-emulator.sourceforge.net/libspectrum.php" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="$SF_MIRROR/fuse-emulator/$TARBALL" diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/CRTL.ASM Sat May 18 13:29:32 2019 +0200 @@ -380,31 +380,31 @@ global @argstr$qpxzcxt1ppxzc:near proc @argstr$qpxzcxt1ppxzc near - stc - db 73h ; jnc + mov cl,2 + db 0a9h ; test ax,# global @argnum$qpzcxpxzcpul:near @argnum$qpzcxpxzcpul: - clc - - xchg ax,bx ; keywords - xchg ax,cx ; s - xchg ax,dx ; vars - sbb dx,dx ; str:-1 num:0 - sbb dx,-4 ; str:2 num:4 + mov cl,4 + xchg ax,bx ; keywords -> bx + xchg ax,cx ; s -> cx + cbw ; argstr:0002 argnum:0004 + xchg ax,dx ; vars -> ax push si di - xchg ax,di ; vars + xchg ax,di ; vars => di dec bx - mov al,0 @@testalt: + mov al,-1 sub di,dx @@test: cmp al,'=' je @@found + cmp al,0 ; eos, si=next argv + je @@found mov si,cx ; s add di,dx @@match: - inc bx - lodsb + inc bx ; keywords++ + lodsb ; *s++ or al,20h cmp al,[bx] je @@match @@ -414,10 +414,8 @@ je @@match @@notopt: ifdef EXTRA - add di,dx cmp [byte bx],'/' je @@testalt - sub di,dx endif cmp [byte bx],'|' je @@test @@ -432,7 +430,7 @@ dec dx dec dx je @@done - push si + mov bx,si call @strtol$qpxzc mov [di],ax mov [di+2],dx @@ -1038,21 +1036,19 @@ ;*************************************************************** -;pascal unsigned long strtol(const char *s); +;_fastcall unsigned long strtol(const char *s); ;*************************************************************** global @strtol$qpxzc:near proc @strtol$qpxzc near - pop ax - pop bx ; s - push ax ifndef NO386 - xor ebx,ebx push si - jcxz @@end - mov si,cx + mov si,bx xor ecx,ecx xor eax,eax + xor ebx,ebx + or si,si + jz @@end lodsb mov dx,ax or al,20h @@ -1136,9 +1132,10 @@ push di xor ax,ax cwd - jcxz @@goend + or bx,bx + jz @@goend xchg ax,di - mov si,cx + mov si,bx lodsb mov bx,ax or al,20h diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/CRTL.H --- a/linld/stuff/src/CRTL.H Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/CRTL.H Sat May 18 13:29:32 2019 +0200 @@ -37,7 +37,7 @@ extern _fastcall int read(int fd, void* data, int sz); extern _fastcall long lseekcur(int fd, int whence); extern _fastcall int puts(const char* s); -extern pascal unsigned long strtol(const char *s); +extern _fastcall unsigned long strtol(const char *s); // Extensions #define cli() do { asm { cli } } while(0) diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/HIMEM.CPP --- a/linld/stuff/src/HIMEM.CPP Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/HIMEM.CPP Sat May 18 13:29:32 2019 +0200 @@ -53,7 +53,8 @@ struct image_himem *m = ± u32 *q; vm2rm(); - if(((u16 *)&m->fallback)[1] >= 0x10) m->fallback = _1m; // >= _1m ? + if(((u16 *)&m->fallback)[1] >= 0x10) // >= _1m ? + ((u16 *)&m->fallback)[1] = 0x10; q = m->bufv; if(q==0) { // Move kernel diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/LINLD.CPP --- a/linld/stuff/src/LINLD.CPP Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/LINLD.CPP Sat May 18 13:29:32 2019 +0200 @@ -14,6 +14,7 @@ // -1 = Normal VGA // n = as "n" was pressed u32 topmem; +u32 base_himem; inline void syntax() { die("Syntax:" NL @@ -25,20 +26,14 @@ "\tinitrd,vga,root=(void)" NL "\tmem=256m" NL "\tcl=auto" NL -#ifdef USE_ARGSTR - "\t-b=1088k" NL -#else "\t-b 1088k" NL -#endif "Use quotes: \"cl=...\" if you need spaces in cmdline" NL "Use cl=@filename to get it from a file" #if 1 NL NL "Examples:" NL -#ifdef USE_ARGSTR - "\tLINLD -f -b=64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\"" -#else - "\tLINLD -f -b 64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\"" -#endif + "\tLINLD -f -b 64m " + "initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz " + "\"cl=rw root=/dev/null video=-32\"" NL NL "\tLINLD image=memtest" #endif ); @@ -49,8 +44,7 @@ (void) argc; - // Believe it or not - this enables A20 - // on my box! Must be DOS in HMA... -vda + ((u16*) &base_himem)[1] |= (_1m+_64k)>>16; // base_himem = _1m+_64k puts("LINLD v" VERSION_STR "+"); // Parse command line @@ -99,12 +93,10 @@ kernel_name=s; } else if(strhead(s,"initrd=") == 0) { - s+=7; - initrd_name=s; + initrd_name=s+7; } else if(strhead(s,"vga=") == 0) { - s+=4; - vid_mode = strtol(s); // support normal, extended & ask + *(u16*)&vid_mode = (u16)strtol(s+7); // support normal, extended & ask } else switch (*(u16 *)s|0x2002) { case 0x662F: // -F /f @@ -112,7 +104,7 @@ goto next; case 0x622F: // -B /b argv++; - base_himem = strtol(*argv); + ((u16 *)&base_himem)[1] = (u16)(strtol(*argv)>>16); goto next; default: if(strhead(s,"cl=") == 0) { @@ -124,9 +116,8 @@ s++; image.errmsg = "Error in cl=@file"; open_image(s, &image); - cmdline=s=(char *)malloc_or_die(image.size); - s+=image.size; - read(image.fd, (void *)cmdline, image.size); + s+=read(image.fd, (void *)cmdline=s= + (char *)malloc_or_die(image.size), image.size); // Strip any trailing cr/lf c='\0'; do { @@ -140,13 +131,11 @@ } } else if(strhead(s,"root=") == 0) { - s+=5; - root_dev = strtol(s); + *(u16*)&root_dev = (u16)strtol(s+5); goto addincmdline; } else if(strhead(s,"mem=") == 0) { - s+=4; - topmem = strtol(s); + ((u16 *)&topmem)[1] = (u16)(strtol(s+4)>>16); goto addincmdline; } else { diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/LOAD.CPP --- a/linld/stuff/src/LOAD.CPP Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/LOAD.CPP Sat May 18 13:29:32 2019 +0200 @@ -123,8 +123,6 @@ static u8* rm_buf; // @ = @rm_size + 3, see JUMP.ASM struct image_himem imgs[2]; -u32 base_himem = _1m+_64k; - static const char kernel_file_error[] = "Can't use kernel file"; char* load_kernel() { diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/TAZBOOT.CPP --- a/linld/stuff/src/TAZBOOT.CPP Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/TAZBOOT.CPP Sat May 18 13:29:32 2019 +0200 @@ -156,12 +156,14 @@ u32 root_dev; u32 vid_mode; u32 topmem; +u32 base_himem; const char* kernel_name = "bzImage"; const char* initrd_name; char* iso; int main(int argc, char *argv[]) { + ((u16*) &base_himem)[1] |= (_1m+_64k)>>16; // base_himem = _1m+_64k argv[0] = progname(); bootiso(argv); // iso ? parsing is /init.exe stuff ! @@ -197,7 +199,7 @@ else if(i == 1 && fileexist(s) != -1) { kernel_name = s; } - else strcatb(buf_cmdline,*argv); + else strcatb(buf_cmdline,*argv); // FIXME mem ? } #else if (strhead(s,"kernel=") == 0) { @@ -224,35 +226,33 @@ goto set_iso; } else if(strhead(s,"vga=") == 0) { - s += 4; - vid_mode = strtol(s); // support normal, extended & ask + *(u16*)&vid_mode = (u16)strtol(s+4); // support normal, extended & ask } else switch (*(u16 *)s|0x2002) { case 0x662F: // -F /f skip_alloc++; goto next; case 0x652F: // -E /e - argv++; - topmem = strtol(*argv); - goto next; + s=*++argv; + goto set_topmem; case 0x622F: // -B /b argv++; - base_himem = strtol(*argv); + ((u16 *)&base_himem)[1] = (u16)(strtol(*argv)>>16); goto next; default: if(i == 1 && fileexist(s) != -1) { goto set_kernelz; } else { + strcatb(buf_cmdline,*argv); if(strhead(s,"root=") == 0) { - s += 5; - root_dev = strtol(s); + *(u16*)&root_dev = (u16)strtol(s+5); } if(strhead(s,"mem=") == 0) { s += 4; - topmem = strtol(s); + set_topmem: + ((u16 *)&topmem)[1] = (u16)(strtol(s)>>16); } - strcatb(buf_cmdline,*argv); }} } #endif diff -r 2514d4060d32 -r 87b6697bb350 linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Sat May 18 10:15:49 2019 +0100 +++ b/linld/stuff/src/pipehole.awk Sat May 18 13:29:32 2019 +0200 @@ -35,6 +35,9 @@ if (/^ sub [abcds][ix],2$/) { split($2,regs,","); hold=13; next } + if (/^ push dx$/) { + hold=14; next; + } } else if (hold == 1) { if (/^ ;/) { line[kept++]=$0; next } @@ -185,6 +188,29 @@ } else print " sub " regs[1] ",2" } + else if (hold == 14) { + if (/^ push ax$/) { hold++; next; } + print " push dx"; + hold=0; + } + else if (hold == 15) { + if (/^ pop eax$/) { hold++; next; } + print " push dx"; + print " push ax"; + hold=0; + } + else if (hold == 16) { + hold=0; + if (/^ shr eax,16$/) { print " xchg ax,dx"; next; } + print " push dx"; + print " push ax"; + print " pop eax"; + } + else if (hold == 17) { + hold=0; + if (/^ cmp ax,-1$/) { print " inc ax"; next; } + } + if (/^ call near ptr @fileexist\$/) { print; hold=17; next; } s=$0 # These optimisation may break ZF or CF if (/^ sub sp,2$/) { print " push ax"; next } diff -r 2514d4060d32 -r 87b6697bb350 syslinux/stuff/iso2exe/win32.c --- a/syslinux/stuff/iso2exe/win32.c Sat May 18 10:15:49 2019 +0100 +++ b/syslinux/stuff/iso2exe/win32.c Sat May 18 13:29:32 2019 +0200 @@ -167,7 +167,7 @@ const char pifFileName[] = "slitaz.pif"; strcpy(PIF_content.s0.program_filename, isoFileName); - fd = open(pifFileName, O_WRONLY|O_BINARY|O_CREAT,0555); + fd = open(pifFileName, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC,0555); write(fd,&PIF_content,sizeof(PIF_content)); close(fd); WinExec(pifFileName, SW_MINIMIZE); diff -r 2514d4060d32 -r 87b6697bb350 zstd-dev/receipt --- a/zstd-dev/receipt Sat May 18 10:15:49 2019 +0100 +++ b/zstd-dev/receipt Sat May 18 13:29:32 2019 +0200 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="zstd-dev" -VERSION="1.3.8" +VERSION="1.4.0" CATEGORY="development" SHORT_DESC="Zstandard - Fast and efficient compression algorithm, development files." MAINTAINER="pascal.bellard@slitaz.org" diff -r 2514d4060d32 -r 87b6697bb350 zstd/receipt --- a/zstd/receipt Sat May 18 10:15:49 2019 +0100 +++ b/zstd/receipt Sat May 18 13:29:32 2019 +0200 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="zstd" -VERSION="1.3.8" +VERSION="1.4.0" CATEGORY="base-system" SHORT_DESC="Zstandard - Fast and efficient compression algorithm." MAINTAINER="pascal.bellard@slitaz.org"