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

linld: skip xmm_alloc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 12 10:41:29 2020 +0000 (2020-12-12)
parents 555bcdab610b
children 34d90fb03f57
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Nov 28 09:45:01 2020 +0000
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Sat Dec 12 10:41:29 2020 +0000
     1.3 @@ -22,9 +22,6 @@
     1.4  		global	overflow:byte
     1.5  overflow	db	"/"
     1.6  msg_malloc      db      "Out of memory",0
     1.7 -	ifdef	EXTRA
     1.8 -tazboot_cmd	db	"tazboot.cmd",0
     1.9 -	endif
    1.10  
    1.11          ends    _DATA
    1.12  
    1.13 @@ -61,14 +58,18 @@
    1.14          global  @strcatb$qpxzct1:near
    1.15          proc	@strcatb$qpxzct1 near
    1.16  
    1.17 +	ifdef	EXTRA
    1.18  		mov	cl,7Fh
    1.19  		db	0bah			; mov	dx,imm opcode
    1.20          global	@strcpy$qpxzct1:near
    1.21  @strcpy$qpxzct1:
    1.22  		xor	cx,cx
    1.23 +	endif
    1.24                  push	si
    1.25                  xchg	ax,si			; b
    1.26 +	ifdef	EXTRA
    1.27  		jcxz	@@nocat
    1.28 +	endif
    1.29  		dec	bx
    1.30  @@catlp:
    1.31                  inc	bx
    1.32 @@ -88,8 +89,10 @@
    1.33                  inc	bx
    1.34  		or	al,al
    1.35                  jne	@@cpylp
    1.36 +	ifdef	EXTRA
    1.37  strfound:
    1.38  		xchg	ax,dx
    1.39 +	endif
    1.40  strend:
    1.41                  pop	si
    1.42  	global	@ret:near
    1.43 @@ -190,12 +193,13 @@
    1.44  		cwd				; action = open
    1.45  		stc
    1.46                  int	21h
    1.47 -		pop	si bx
    1.48 +		pop	si dx
    1.49                  jnc	doret
    1.50 +	else
    1.51 +                mov	dx,bx
    1.52  	endif
    1.53                  mov	ax,3d00h		; read-only+compatibility
    1.54  		;mov	cl,0			; attribute mask
    1.55 -                mov	dx,bx
    1.56  		jmp	dos
    1.57  
    1.58          endp    @open$qpxzc
    1.59 @@ -234,15 +238,15 @@
    1.60  
    1.61  
    1.62  ;***************************************************************
    1.63 -;_fastcall int readrm(bx:struct himem *m, ax:int sz);
    1.64 +;_fastcall int readrm(di:struct himem *m, ax:int sz);
    1.65  ;_fastcall int read(ax:int fd, bx:void* data, dx:int sz);
    1.66  ;_fastcall int write(ax:int fd, bx:const void* data, dx:int sz);
    1.67  ;***************************************************************
    1.68          global  @readrm$qp11image_himemi:near
    1.69  @readrm$qp11image_himemi:
    1.70  		xchg	ax,dx		; sz
    1.71 -		mov	ax,[bx]		; fd
    1.72 -		mov	bx,[bx-2]	; data
    1.73 +		mov	ax,[di]		; fd
    1.74 +		mov	bx,[di-2]	; data
    1.75          global  @read$qipvi:near
    1.76          proc    @read$qipvi near
    1.77  
    1.78 @@ -647,14 +651,14 @@
    1.79  	endif
    1.80  
    1.81  ;***************************************************************
    1.82 -;_fastcall u32* malloc_bufv_or_die(bx:struct image_himem *m);
    1.83 +;_fastcall u32* malloc_bufv_or_die(si:struct image_himem *m);
    1.84  ;***************************************************************
    1.85          global  @malloc_bufv_or_die$qp11image_himem:near
    1.86          proc    @malloc_bufv_or_die$qp11image_himem near
    1.87  
    1.88                  p386
    1.89  		push	si
    1.90 -		mov	si,bx
    1.91 +		mov	bx,si
    1.92  	ifdef	LARGE_IMAGES
    1.93  		movzx	eax,[word ((image_himem si).size) + 2]
    1.94  		shr	ax,4			; pages index size = size >> 20
    1.95 @@ -767,6 +771,13 @@
    1.96  ;***************************************************************
    1.97  ;_fastcall void memcpy_image(bx:struct image_himem *m);
    1.98  ;***************************************************************
    1.99 +	global	memcpy_image_initrd:near
   1.100 +memcpy_image_initrd:
   1.101 +		lea	bx,[si+32]
   1.102 +		db	0A9h			; test	ax,imm
   1.103 +	global	memcpy_image_kernel:near
   1.104 +memcpy_image_kernel:
   1.105 +		mov	bx,si
   1.106          global  @memcpy_image$qp11image_himem:near
   1.107          proc    @memcpy_image$qp11image_himem near
   1.108  
   1.109 @@ -826,15 +837,15 @@
   1.110          endp    @memcpy_image$qp11image_himem
   1.111  
   1.112  ;***************************************************************
   1.113 -;_fastcall void storepage(bx:u32 *dst);
   1.114 +;_fastcall void storepage(di:u32 *dst);
   1.115  ;***************************************************************
   1.116          global  @storepage$qpul:near
   1.117          proc    @storepage$qpul near
   1.118  
   1.119  		ifndef	NO386
   1.120 -		mov	edx,[bx]
   1.121 +		mov	edx,[di]
   1.122  		else
   1.123 -		les	ax,[dword bx]
   1.124 +		les	ax,[dword di]
   1.125  		mov	dx,es
   1.126  		endif
   1.127  		mov	cx,offset _xfer_buf
   1.128 @@ -861,20 +872,20 @@
   1.129  	ifdef	LARGE_IMAGES
   1.130                  p386
   1.131  ;***************************************************************
   1.132 -;_fastcall void reset_bufv(bx:u32 *p);
   1.133 +;_fastcall void reset_bufv(di:u32 *p);
   1.134  ;***************************************************************
   1.135          global  @reset_bufv$qpul:near
   1.136          proc    @reset_bufv$qpul near
   1.137  
   1.138 -		mov	[curdata],bx
   1.139 -		and	[dword (data_himem bx).cacheidx],0
   1.140 +		mov	[curdata],di
   1.141 +		and	[dword (data_himem di).cacheidx],0
   1.142  		ret
   1.143  
   1.144          endp    @reset_bufv$qpul
   1.145  
   1.146  ;***************************************************************
   1.147 -;u32* prev_bufv();
   1.148 -;u32* prev_bufv();
   1.149 +;u32* di=prev_bufv();
   1.150 +;u32* di=prev_bufv();
   1.151  ;***************************************************************
   1.152          global  _prev_bufv:near
   1.153          global  _next_bufv:near
   1.154 @@ -884,32 +895,29 @@
   1.155  		db	73h			; jnc
   1.156  _next_bufv:
   1.157  		clc
   1.158 -		push	si
   1.159 -		mov	si,0
   1.160 +		mov	bx,0
   1.161  		org	$-2
   1.162  curdata		dw	?
   1.163  		sbb	ax,ax
   1.164  		cmc
   1.165 -		adc	ax,[(data_himem si).cacheidx]	; -1/+1
   1.166 +		adc	ax,[(data_himem bx).cacheidx]	; -1/+1
   1.167  		xor	ecx,ecx
   1.168  		test	ax,0fc00h
   1.169  		jz	@@gotpage
   1.170  		push	ax			; FFFF / 0400
   1.171  		sar	ax,8			; FFFC / 0004
   1.172  		and	al,0fch
   1.173 -		add	[(data_himem si).pageidx],ax
   1.174 -		mov	bx,[(data_himem si).pageidx]
   1.175 -		lea	bx,[(data_himem bx+si).page]
   1.176 +		add	[(data_himem bx).pageidx],ax
   1.177 +		mov	di,[(data_himem bx).pageidx]
   1.178 +		lea	di,[(data_himem bx+di).page]
   1.179  		mov	edx,ds
   1.180  		shl	edx,4
   1.181 -		lea	cx,[(data_himem si).cache]		
   1.182 +		lea	cx,[(data_himem bx).cache]		
   1.183  		add	edx,ecx
   1.184 -		mov	eax,[bx]
   1.185 +		mov	eax,[di]
   1.186  		or	eax,eax
   1.187  		jnz	@@pageok
   1.188  		pop	ax
   1.189 -		xchg	ax,bx
   1.190 -		pop	si
   1.191  		ret
   1.192  @@pageok:
   1.193  		mov	cx,4096
   1.194 @@ -918,15 +926,15 @@
   1.195  		cbw
   1.196  		shr	ax,6			; 03FF / 0000
   1.197  @@gotpage:
   1.198 -		mov	[(data_himem si).cacheidx],ax
   1.199 +		mov	[(data_himem bx).cacheidx],ax
   1.200  		shl	ax,2
   1.201 -		xchg	ax,bx
   1.202 -		lea	ax,[(data_himem bx+si).cache]		
   1.203 -		or	bx,[(data_himem si).pageidx]	; !pageidx && !cacheidx
   1.204 +		xchg	ax,di
   1.205 +		lea	ax,[(data_himem bx+di).cache]		
   1.206 +		or	di,[(data_himem bx).pageidx]	; !pageidx && !cacheidx
   1.207  		jnz	@@notfirst2
   1.208 -		xchg	ax,si				; &first
   1.209 +		xchg	ax,bx				; &first
   1.210  @@notfirst2:
   1.211 -		pop	si
   1.212 +		xchg	ax,di
   1.213  		ret
   1.214  
   1.215          endp    _prev_bufv
   1.216 @@ -1266,43 +1274,6 @@
   1.217  	endp	@strtol$qpxzc
   1.218  
   1.219  
   1.220 -		ifdef	USE_ARGSTR
   1.221 -;***************************************************************
   1.222 -;_fastcall void set_cmdline(bx:const char *filename);
   1.223 -;***************************************************************
   1.224 -        global  @set_cmdline$qpxzc:near
   1.225 -        proc	@set_cmdline$qpxzc near
   1.226 -		call	openargs
   1.227 -		jc	strtol_ret
   1.228 -		mov	ch,15			; cx<4096
   1.229 -		mov	di,[_heap_top]
   1.230 -		extrn	read_cmdline:near
   1.231 -		jmp	near read_cmdline	; read_cmdline(ax,di,cx)
   1.232 -
   1.233 -        endp	@set_cmdline$qpxzc
   1.234 -		endif
   1.235 -
   1.236 -
   1.237 -		ifdef	NO386
   1.238 -;***************************************************************
   1.239 -;u16 topseg();
   1.240 -;***************************************************************
   1.241 -        global  _topseg:near
   1.242 -        proc    _topseg near
   1.243 -
   1.244 -		int	12h
   1.245 -		jnc	@@max640k
   1.246 -		mov	ax,640			; 9000
   1.247 -@@max640k:
   1.248 -		dec	ax
   1.249 -		and	al,0C0h
   1.250 -		mov	cl,6
   1.251 -		shl	ax,cl
   1.252 -		ret
   1.253 -
   1.254 -        endp    _topseg
   1.255 -		endif
   1.256 -
   1.257  		ifdef	EXTRA
   1.258                  p8086
   1.259  ;***************************************************************
   1.260 @@ -1361,26 +1332,6 @@
   1.261  
   1.262  			endif
   1.263  
   1.264 -;***************************************************************
   1.265 -;void try_default_args();
   1.266 -;***************************************************************
   1.267 -	ifdef	EXTRA
   1.268 -
   1.269 -        global  _try_default_args:near
   1.270 -        proc    _try_default_args near
   1.271 -
   1.272 -		mov	bx,offset tazboot_cmd
   1.273 -		call	open
   1.274 -		jc	kver2ulret
   1.275 -		mov	cx,4096
   1.276 -		mov	di,[_heap_top]
   1.277 -		extrn	read_cmdline:near
   1.278 -		jmp	near read_cmdline	; read_cmdline(ax,di,cx)
   1.279 -		
   1.280 -        endp    _try_default_args
   1.281 -
   1.282 -	endif
   1.283 -
   1.284          ends    _TEXT
   1.285  
   1.286          end