wok-current rev 24579

linld: do not confuse memtop and topload
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 27 11:43:07 2022 +0000 (2022-02-27)
parents 8db826af003e
children 957a0d04295e
files linld/stuff/src/COMMON.H linld/stuff/src/LOAD.CPP linld/stuff/src/MEMTOP.ASM
line diff
     1.1 --- a/linld/stuff/src/COMMON.H	Sun Feb 27 10:47:38 2022 +0000
     1.2 +++ b/linld/stuff/src/COMMON.H	Sun Feb 27 11:43:07 2022 +0000
     1.3 @@ -181,6 +181,7 @@
     1.4  #ifdef	WITH_XMM_ALLOC
     1.5  extern _fastcall void xmm_alloc(struct image_himem *m);
     1.6  #endif
     1.7 +extern "C" u32 topload();
     1.8  extern "C" u32 memtop();
     1.9  extern "C" void enable_a20_or_die();
    1.10  extern "C" void far vm2rm();
     2.1 --- a/linld/stuff/src/LOAD.CPP	Sun Feb 27 10:47:38 2022 +0000
     2.2 +++ b/linld/stuff/src/LOAD.CPP	Sun Feb 27 11:43:07 2022 +0000
     2.3 @@ -215,7 +215,7 @@
     2.4      struct image_himem *m = &initrd;
     2.5      open_image(m, initrd_name);
     2.6  
     2.7 -    if ((m->fallback=(memtop()-m->size)&(~PAGE_MASK))-m[-1].fallback < m[-1].size) {
     2.8 +    if ((m->fallback=(topload()-m->size)&(~PAGE_MASK))-m[-1].fallback < m[-1].size) {
     2.9  	loadfailure();
    2.10          return;
    2.11      }
     3.1 --- a/linld/stuff/src/MEMTOP.ASM	Sun Feb 27 10:47:38 2022 +0000
     3.2 +++ b/linld/stuff/src/MEMTOP.ASM	Sun Feb 27 11:43:07 2022 +0000
     3.3 @@ -22,9 +22,10 @@
     3.4          segment _TEXT byte public use16 'CODE'
     3.5  
     3.6  ;***************************************************************
     3.7 -;u32 memtopz();
     3.8 +;u32 memtop();
     3.9  ;***************************************************************
    3.10 -        proc    _memtopz near
    3.11 +        global  _memtop:near
    3.12 +        proc    _memtop near
    3.13  ;***************************************************************
    3.14  ;u32 memtop_e820()
    3.15  ;***************************************************************
    3.16 @@ -155,7 +156,7 @@
    3.17  
    3.18  ;        endp    _memtop_88
    3.19  
    3.20 -;        proc    _memtopz near
    3.21 +;        proc    _memtop near
    3.22  
    3.23  ;                call	_memtop_e801
    3.24  ;		jnz	@@ok
    3.25 @@ -176,11 +177,11 @@
    3.26  
    3.27  
    3.28  ;***************************************************************
    3.29 -;u32 memtop();
    3.30 +;u32 topload();
    3.31  ;***************************************************************
    3.32 -        global  _memtop:near
    3.33 -_memtop:
    3.34 -		call	_memtopz
    3.35 +        global  _topload:near
    3.36 +_topload:
    3.37 +		call	_memtop
    3.38  		mov	cx,40h		; min 4m
    3.39  ; If reported mem is ridiculously low, presume
    3.40  ; we had trouble detecting memory size
    3.41 @@ -209,7 +210,7 @@
    3.42  ;@@ok:
    3.43  		ret
    3.44  
    3.45 -        endp    _memtopz
    3.46 +        endp    _memtop
    3.47  
    3.48  ;***************************************************************
    3.49  ;void hook_int15_88();