wok diff linld/stuff/src/CRTL.ASM @ rev 20534

Add util-linux-losetup
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Nov 26 09:46:23 2018 +0100 (2018-11-26)
parents f0d71e920c5a
children 65366955881f
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Fri Nov 09 16:37:55 2018 +0100
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Mon Nov 26 09:46:23 2018 +0100
     1.3 @@ -330,20 +330,22 @@
     1.4          endp    @lseekset$qiul
     1.5  
     1.6  		ifdef	EXTRA
     1.7 -struc		isostate	; struct isostate {
     1.8 -fd		dw	?	; 0	int fd;
     1.9 -fileofs		dd	?	; 2	unsigned long fileofs;
    1.10 -filesize	dd	?	; 6	unsigned long filesize;
    1.11 -filemod		dw	?	;10	unsigned short filemod;
    1.12 -filename	dw	?	;12	char *filename;
    1.13 -dirofs		dd	?	;14	unsigned long dirofs;
    1.14 -dirsize		dd	?	;16	unsigned long dirsize;
    1.15 -curdirofs	dd	?	;20	unsigned long curdirofs;
    1.16 -curdirsize	dd	?	;24	unsigned long curdirsize;
    1.17 -curpos		dd	?	;28	unsigned long curpos;
    1.18 -ends				; } isostate;
    1.19 +;typedef unsigned dirsizetype;
    1.20 +struc		isostate		; struct isostate {
    1.21 +fd		dw	?		; 0	int fd;
    1.22 +filemod		dw	?		; 2	unsigned short filemod;
    1.23 +fileofs		dd	?		; 4	unsigned long fileofs;
    1.24 +filesize	dd	?		; 8	unsigned long filesize;
    1.25 +filename	dw	?		;12	char *filename;
    1.26 +curdirsize	dw	?		;14	dirsizetype curdirsize;
    1.27 +dirsize		dw	?		;16	dirsizetype dirsize;
    1.28 +curdirofs	dd	?		;18	unsigned long curdirofs;
    1.29 +dirofs		dd	?		;22	unsigned long dirofs;
    1.30 +curpos		dw	?		;26	unsigned curpos;
    1.31 +buffer		db	2560	dup(?)	;28	char buffer[2048+512];
    1.32 +ends					; } isostate;
    1.33  ;***************************************************************
    1.34 -;pascal int isolseek(const unsigned long *offset);
    1.35 +;pascal long isolseek(const unsigned long *offset);
    1.36  ;***************************************************************
    1.37          global  @isolseek$qpxul:near
    1.38          proc    @isolseek$qpxul near
    1.39 @@ -351,16 +353,40 @@
    1.40  		pop	ax
    1.41  		pop	bx
    1.42  		push	ax
    1.43 +isolseek:
    1.44  		mov	dx,[bx]
    1.45  		mov	cx,[bx+2]
    1.46  		extrn	_isostate:isostate
    1.47  		mov	bx,[_isostate.fd]
    1.48 -		call	lseekset		; (bx=fd, sz=cx:dx)
    1.49 +		jmp	lseekset		; (bx=fd, sz=cx:dx)
    1.50 +		
    1.51 +        endp    @isolseek$qpxul
    1.52 +
    1.53 +
    1.54 +;***************************************************************
    1.55 +;pascal int isoreadsector(const unsigned long *offset);
    1.56 +;***************************************************************
    1.57 +        global  @isoreadsector$qpxul:near
    1.58 +        proc    @isoreadsector$qpxul near
    1.59 +
    1.60 +		pop	ax
    1.61 +		pop	bx
    1.62 +		push	ax
    1.63 +		call	isolseek
    1.64  		and	ax,dx
    1.65  		inc	ax
    1.66 +		jz	@@fail
    1.67 +		mov	cx,2560
    1.68 +		mov	dx,offset _isostate.buffer
    1.69 +		mov	bx,[_isostate.fd]
    1.70 +		call	@read$cxdxbx		; read(fd,buffer,2560)
    1.71 +@@fail:
    1.72 +		cmp	ax,2048
    1.73 +		sbb	ax,ax
    1.74  		ret
    1.75 -		
    1.76 -        endp    @isolseek$qpxul
    1.77 +
    1.78 +        endp    @isoreadsector$qpxul
    1.79 +
    1.80  		endif
    1.81  
    1.82  
    1.83 @@ -852,9 +878,14 @@
    1.84  		push	cx
    1.85                  push	di
    1.86  		xchg	ax,di
    1.87 -		mov	[(image_himem di).next_chunk],offset next_chunk
    1.88                  mov	[(image_himem di).state],bx
    1.89  		push	bx
    1.90 +		ifdef	EXTRA
    1.91 +		xor	ax,ax
    1.92 +		or	ax,[(image_himem di).next_chunk]
    1.93 +		jne	@@next
    1.94 +		endif
    1.95 +		mov	[(image_himem di).next_chunk],offset next_chunk
    1.96  @@next:
    1.97                  call	[(image_himem di).next_chunk]	; m->next_chunk()
    1.98  		ifndef	NO386