# HG changeset patch # User Pascal Bellard # Date 1543430770 -3600 # Node ID 65366955881f8a907496704b0a341525399a37e5 # Parent 91b11cc25f3d4852caebf2c2f1864ba9d8cf9d14 linld: _fastcall calls diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/COMMON.H --- a/linld/stuff/src/COMMON.H Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/COMMON.H Wed Nov 28 19:46:10 2018 +0100 @@ -52,14 +52,15 @@ } imgs[2]; #define pm (imgs[0]) #define initrd (imgs[1]) +#define pm2initrd(p) (p+1) extern int skip_alloc; extern u32 base_himem; -extern pascal void memcpy_image(struct image_himem *m); -extern pascal void storepage(u32 *dst, u16 src); +extern _fastcall void memcpy_image(struct image_himem *m); +extern _fastcall void storepage(u32 *dst); #ifdef LARGE_IMAGES -extern pascal void reset_bufv(unsigned long *p); +extern _fastcall void reset_bufv(unsigned long *p); extern "C" unsigned long* prev_bufv(); extern "C" unsigned long* next_bufv(); #define next(p) p = next_bufv() @@ -76,7 +77,7 @@ extern u32 root_dev; extern u32 vid_mode; // External asm helpers -extern pascal void xmm_alloc(struct image_himem *m); +extern _fastcall void xmm_alloc(struct image_himem *m); extern u32 topmem; extern "C" u32 memtop(); extern "C" void enable_a20_or_die(); @@ -89,8 +90,8 @@ #endif void load_image(struct image_himem *m); -extern pascal void open_image(const char *name, struct image_himem *m); -extern pascal int read_image(struct image_himem *m, void* data, int sz); +extern _fastcall void open_image(const char *name, struct image_himem *m); +extern _fastcall int read_image(struct image_himem *m); char* load_kernel(); void load_initrd(); extern "C" void boot_kernel(); diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/CRTL.ASM Wed Nov 28 19:46:10 2018 +0100 @@ -31,6 +31,7 @@ segment _BSS byte public use16 'BSS' +_xfer_buf db 4096 dup (?) global _no_exit:byte _no_exit db ? filecnt db ? ; in fact 0 minus file count... @@ -47,9 +48,9 @@ segment _TEXT byte public use16 'CODE' ;*************************************************************** -;pascal void strcpy(const char* a, const char* b); -;pascal void strcat(const char* a, const char* b); -;pascal void strcatb(const char* a, const char* b); +;_fastcall void strcpy(const char* a, const char* b); +;_fastcall void strcat(const char* a, const char* b); +;_fastcall void strcatb(const char* a, const char* b); ;*************************************************************** global @strcatb$qpxzct1:near proc @strcatb$qpxzct1 near @@ -65,12 +66,9 @@ @strcpy$qpxzct1: xor cx,cx endif - pop ax ;caller return address - pop bx ; b - pop dx ; a - push ax push si - mov si,dx + mov si,bx ; a + xchg ax,dx ; b ifdef EXTRA jcxz @@nocat endif @@ -106,15 +104,13 @@ ifdef EXTRA p8086 ;*************************************************************** -;pascal char strstr(const char* a,const char* b); +;_fastcall char strstr(const char* a,const char* b); ;*************************************************************** global @strstr$qpxzct1:near proc @strstr$qpxzct1 near - pop ax ;caller return address - pop cx ; b - pop dx ; a - push ax + xchg ax,cx ; b + mov dx,bx ; a push si @@loop: xor ax,ax @@ -136,15 +132,11 @@ ;*************************************************************** -;pascal int strcmp(const char* a,const char* b); +;_fastcall int strcmp(const char* a,const char* b); ;*************************************************************** global @strcmp$qpxzct1:near proc @strcmp$qpxzct1 near - pop cx ;caller return address - pop ax ; b - pop bx ; a - push cx push si xchg ax,si dec bx @@ -165,14 +157,11 @@ ;*************************************************************** -;pascal void puts(const char* s): +;_fastcall void puts(const char* s): ;*************************************************************** global @puts$qpxzc:near proc @puts$qpxzc near - pop ax ;caller return address - pop bx ; s - push ax ; global puts:near ; puts(bx) puts: call @@putsz @@ -192,16 +181,13 @@ ;*************************************************************** -;pascal int fileattr(const char* name); +;_fastcall int fileattr(const char* name); ;*************************************************************** global @fileattr$qpxzc:near proc @fileattr$qpxzc near - pop ax ;caller return address - pop dx ; name - push ax mov ax,4300h - int 21h + call dos_filename xchg ax,cx jmp chkc @@ -209,19 +195,24 @@ ;*************************************************************** -;pascal int open(const char* name, int flags=O_RDONLY); +;_fastcall int open(const char* name, int flags=O_RDONLY); ;*************************************************************** + global openargs:near ; openargs(bx) +openargs: + cmp [byte bx],'@' + stc + jne fail + inc bx + global @open$qpxzc:near proc @open$qpxzc near - pop ax ;caller return address - pop bx ; name - push ax global open:near ; open(bx) open: + mov ax,3d00h ; read-only+compatibility + ;mov cl,0 ; attribute mask +dos_filename: mov dx,bx - ;mov cl,0 ; attribute mask - mov ax,3d00h ; read-only+compatibility dos: int 21h chkc: @@ -237,26 +228,15 @@ endif ret - global openargs:near ; openargs(bx) -openargs: - cmp [byte bx],'@' - stc - jne fail - inc bx - jmp open - endp @open$qpxzc ;*************************************************************** -;pascal int close(int fd); +;_fastcall int close(int fd); ;*************************************************************** global @close$qi:near proc @close$qi near - pop ax ;caller return address - pop bx ; fd - push ax global close:near ; close(bx) close: mov ah,3Eh @@ -268,8 +248,8 @@ ;*************************************************************** -;pascal int read(int fd, void* data, int sz); -;pascal int write(int fd, const void* data, int sz); +;_fastcall int read(int fd, void* data, int sz); +;_fastcall int write(int fd, const void* data, int sz); ;*************************************************************** global @read$qipvi:near proc @read$qipvi near @@ -281,11 +261,9 @@ @write$qipvi: clc endif - pop ax ;caller return address - pop cx ; sz - pop dx ; data - pop bx ; fd - push ax + xchg ax,bx ; fd + xchg ax,dx ; data + xchg ax,cx ; sz ifdef WRITE mov ah,40h sbb ah,0 @@ -299,21 +277,15 @@ endp @read$qipvi - ;ifdef EXTRA ;*************************************************************** -;pascal long lseekset(int fd, unsigned long sz); +;_fastcall long lseekset(int fd, unsigned sz); ;*************************************************************** - global @lseekset$qiul:near - proc @lseekset$qiul near + global @lseekset$qiui:near + proc @lseekset$qiui near - pop ax ;caller return address - pop dx ; sz lo - pop cx ; sz hi - pop bx ; fd - push ax - ;endif -; global lseekset:near + xchg ax,bx ; fd + xor cx,cx ; sz hi lseekset: clc db 0B0h ; mov al,im @@ -327,9 +299,10 @@ xor cx,cx jmp dos - endp @lseekset$qiul + endp @lseekset$qiui - ifdef EXTRA + ifdef EXTRA + ;typedef unsigned dirsizetype; struc isostate ; struct isostate { fd dw ? ; 0 int fd; @@ -345,33 +318,26 @@ buffer db 2560 dup(?) ;28 char buffer[2048+512]; ends ; } isostate; ;*************************************************************** -;pascal long isolseek(const unsigned long *offset); +;_fastcall long isolseek(const unsigned long *offset); ;*************************************************************** global @isolseek$qpxul:near proc @isolseek$qpxul near - pop ax - pop bx - push ax isolseek: mov dx,[bx] mov cx,[bx+2] extrn _isostate:isostate mov bx,[_isostate.fd] - jmp lseekset ; (bx=fd, sz=cx:dx) - - endp @isolseek$qpxul + jmp lseekset + endp @isolseek$qpxul ;*************************************************************** -;pascal int isoreadsector(const unsigned long *offset); +;_fastcall int isoreadsector(const unsigned long *offset); ;*************************************************************** global @isoreadsector$qpxul:near proc @isoreadsector$qpxul near - pop ax - pop bx - push ax call isolseek and ax,dx inc ax @@ -391,15 +357,11 @@ ;*************************************************************** -;pascal int strhead(const char* a,const char* b); +;_fastcall int strhead(const char* a,const char* b); ;*************************************************************** global @strhead$qpxzct1:near proc @strhead$qpxzct1 near - pop cx ;caller return address - pop ax ; b - pop bx ; a - push cx @@loop: xchg ax,bx mov cl,[bx] ; cl = *b++ @@ -417,14 +379,12 @@ ;*************************************************************** -;pascal char* malloc_or_die(unsigned size); +;_fastcall char* malloc_or_die(unsigned size); ;*************************************************************** global @malloc_or_die$qui:near proc @malloc_or_die$qui near - pop ax ;caller return address - pop cx ; size - push ax + mov cx,bx ; size global malloc_or_die:near ; malloc_or_die(cx) malloc_or_die: mov ax,[_heap_top] ; return value @@ -441,16 +401,13 @@ ;*************************************************************** -;pascal int die(const char* msg); +;_fastcall int die(const char* msg); ;int exit(); ;int abort(); ;*************************************************************** global @die$qpxzc:near proc @die$qpxzc near @die$qpxzc: - pop ax ;caller return address - pop bx ; s - ;push ax global die:near ; die(bx) die: call puts @@ -565,17 +522,14 @@ endif ;*************************************************************** -;pascal u32* malloc_bufv_or_die(struct image_himem *m); +;_fastcall u32* malloc_bufv_or_die(struct image_himem *m); ;*************************************************************** global @malloc_bufv_or_die$qp11image_himem:near proc @malloc_bufv_or_die$qp11image_himem near p386 - pop bx ;caller return address - pop ax - push bx push si - xchg ax,si + mov si,bx ifdef LARGE_IMAGES movzx ecx,[word ((image_himem si).size) + 2] shr cx,4 ; pages index size = size >> 20 @@ -688,14 +642,11 @@ ;*************************************************************** -;pascal void memcpy_image(struct image_himem *m); +;_fastcall void memcpy_image(struct image_himem *m); ;*************************************************************** global @memcpy_image$qp11image_himem:near proc @memcpy_image$qp11image_himem near - pop ax ;caller return address - pop bx - push ax ifndef NO386 mov edx,[(image_himem bx).fallback] mov eax,[(image_himem bx).buf] @@ -752,21 +703,18 @@ endp @memcpy_image$qp11image_himem ;*************************************************************** -;pascal void storepage(u32 *dst, u16 src); +;_fastcall void storepage(u32 *dst); ;*************************************************************** - global @storepage$qpulus:near - proc @storepage$qpulus near + global @storepage$qpul:near + proc @storepage$qpul near - pop ax ;caller return address - pop cx - pop bx - push ax ifndef NO386 mov edx,[bx] else mov ax,[bx] mov dx,[bx+2] endif + mov cx,offset _xfer_buf storepage: ; storepage(edx,cx) ifndef NO386 push 0 @@ -784,20 +732,17 @@ push ds jmp call_memcpy32 - endp @storepage$qpulus + endp @storepage$qpul ifdef LARGE_IMAGES p386 ;*************************************************************** -;pascal void reset_bufv(u32 *p); +;_fastcall void reset_bufv(u32 *p); ;*************************************************************** global @reset_bufv$qpul:near proc @reset_bufv$qpul near - pop ax ;caller return address - pop bx - push ax mov [curdata],bx and [dword (data_himem bx).cacheidx],0 ret @@ -867,23 +812,22 @@ endif ;*************************************************************** -;pascal void open_image(const char *name, struct image_himem *m); +;_fastcall void open_image(const char *name, struct image_himem *m); ;*************************************************************** global @open_image$qpxzcp11image_himem:near proc @open_image$qpxzcp11image_himem near - pop cx ;caller return address - pop ax ; m - pop bx ; name - push cx push di xchg ax,di + ifdef EXTRA + cmp [(image_himem di).fd],0 ; iso image/kernel ? + jnz @@alreadydone + endif mov [(image_himem di).state],bx push bx ifdef EXTRA - xor ax,ax - or ax,[(image_himem di).next_chunk] - jne @@next + cmp [(image_himem di).next_chunk],0 ; iso image/initrd ? + jnz @@next endif mov [(image_himem di).next_chunk],offset next_chunk @@next: @@ -904,6 +848,7 @@ jnz @@next pop [(image_himem di).state] call [(image_himem di).next_chunk] ; m->next_chunk() +@@alreadydone: pop di ret @@ -911,21 +856,15 @@ ;*************************************************************** -;pascal int read_image(struct image_himem *m, char* data, int sz); +;_fastcall int read_image(struct image_himem *m); ;*************************************************************** - global @read_image$qp11image_himempvi:near - proc @read_image$qp11image_himempvi near + global @read_image$qp11image_himem:near + proc @read_image$qp11image_himem near - arg sz :word, \ - data :word, \ - m :word = PARAM_SIZE - - push bp - mov bp,sp - push si di - mov di,[m] - mov si,[data] - mov bp,[sz] + push bp si di + mov di,bx + mov si,offset _xfer_buf + mov bp,4096 push bp ; original size @@loop: ifndef NO386 @@ -945,7 +884,7 @@ @@szok: jcxz image_done mov dx,si - mov bx,[word di] + mov bx,[di] call @read$cxdxbx jc image_done add si,ax @@ -987,9 +926,9 @@ pop ax ; original size sub ax,bp pop di si bp - ret 6 + ret - endp @read_image$qp11image_himempvi + endp @read_image$qp11image_himem ;*************************************************************** @@ -998,8 +937,8 @@ global @strtol$qpxzc:near proc @strtol$qpxzc near - pop ax ;caller return address - pop cx ; s + pop ax + pop bx ; s push ax ifndef NO386 xor ebx,ebx @@ -1266,15 +1205,11 @@ ;*************************************************************** -;pascal void chdirname(char *path) +;_fastcall void chdirname(char *path) ;*************************************************************** global @chdirname$qpzc:near proc @chdirname$qpzc near - pop ax - pop bx - push ax - cmp [byte bx+1],3Ah ; ':' jne @@nodisk mov dl,20h @@ -1315,15 +1250,13 @@ ;*************************************************************** -;pascal char *ultoa(unsigned long n); +;_fastcall char *ultoa(unsigned long n); ;*************************************************************** global @ultoa$qul:near proc @ultoa$qul near - pop dx - pop cx - pop ax - push dx ; AX:CX = n + xchg ax,cx + xchg ax,dx ; AX:CX = n push si mov si,10 mov bx,offset ultoabuf+11 @@ -1348,16 +1281,13 @@ ;*************************************************************** -;pascal unsigned long kver2ul(char *kernel_version); +;_fastcall unsigned long kver2ul(char *kernel_version); ;*************************************************************** global @kver2ul$qpzc:near proc @kver2ul$qpzc near - pop bx - pop ax - push bx push si - xchg ax,si + mov si,bx xor bx,bx mov cx,304h @@number: @@ -1386,7 +1316,7 @@ ;*************************************************************** ;void try_default_args(); -;pascal void set_cmdline(const char *filename); +;_fastcall void set_cmdline(const char *filename); ;*************************************************************** ifdef EXTRA diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/CRTL.H --- a/linld/stuff/src/CRTL.H Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/CRTL.H Wed Nov 28 19:46:10 2018 +0100 @@ -25,17 +25,18 @@ extern char data_start; extern char data_end; extern char bss_start; extern char bss_end; extern char* heap_top; +extern char xfer_buf[4096]; void parse_cmdline(); -extern pascal void strcatb(const char* a,const char* b); -extern pascal int strhead(const char* a,const char* head); -extern pascal int fileattr(const char* name); +extern _fastcall void strcatb(const char* a,const char* b); +extern _fastcall int strhead(const char* a,const char* head); +extern _fastcall int fileattr(const char* name); //extern "C" int open(const char* name, int flags); -extern pascal int open(const char* name); -extern pascal int close(int fd); -extern pascal int read(int fd, void* data, int sz); -extern pascal long lseekset(int fd, unsigned long sz); -extern pascal int puts(const char* s); +extern _fastcall int open(const char* name); +extern _fastcall int close(int fd); +extern _fastcall int read(int fd, void* data, int sz); +extern _fastcall long lseekset(int fd, unsigned sz); +extern _fastcall int puts(const char* s); extern pascal unsigned long strtol(const char *s); // Extensions @@ -44,9 +45,9 @@ #define int3() do { asm { db 0cch } } while(0) #define nop() do { asm { db 90h } } while(0) extern char no_exit; -extern pascal int die(const char* msg); +extern _fastcall int die(const char* msg); //extern "C" char* malloc_or_die(unsigned size); //extern "C" unsigned long* malloc_bufv_or_die(struct image_himem *m); -extern pascal int malloc_or_die(unsigned size); -extern pascal int malloc_bufv_or_die(struct image_himem *m); -extern pascal void set_cmdline(const char *filename); +extern _fastcall int malloc_or_die(unsigned size); +extern _fastcall int malloc_bufv_or_die(struct image_himem *m); +extern _fastcall void set_cmdline(const char *filename); diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/CRTLX.H --- a/linld/stuff/src/CRTLX.H Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/CRTLX.H Wed Nov 28 19:46:10 2018 +0100 @@ -1,15 +1,15 @@ // This file is distributed under GPL // -extern pascal void strcpy(const char* a,const char* b); -extern pascal void strcat(const char* a,const char* b); -extern pascal int strcmp(const char* a,const char* b); +extern _fastcall void strcpy(const char* a,const char* b); +extern _fastcall void strcat(const char* a,const char* b); +extern _fastcall int strcmp(const char* a,const char* b); //extern "C" char* strstr(const char* a,const char* b); -extern pascal int strstr(const char* a,const char* b); +extern _fastcall int strstr(const char* a,const char* b); extern "C" char *progname(void); -extern pascal void chdirname(char *path); -extern pascal unsigned long kver2ul(char *kernel_version); +extern _fastcall void chdirname(char *path); +extern _fastcall unsigned long kver2ul(char *kernel_version); //extern "C" char *ultoa(unsigned long n); -extern pascal int ultoa(unsigned long n); +extern _fastcall int ultoa(unsigned long n); extern "C" void try_default_args(); extern char cpu_features[]; #define CPUMASKLM (0x20) diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/HIMEM.CPP --- a/linld/stuff/src/HIMEM.CPP Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/HIMEM.CPP Wed Nov 28 19:46:10 2018 +0100 @@ -9,50 +9,6 @@ struct image_himem imgs[2]; int skip_alloc; -// Called just before rm->pm -void last_ditch() { - struct image_himem *m = ± - vm2rm(); - if(((u16 *)&m->fallback)[1] >= 0x10) m->fallback = _1m; // >= _1m ? - if(m->bufv==0) { - // Move kernel - memcpy_image(m); - // Move initrd - memcpy_image(&initrd); - } else { //vcpi - // Move kernel - // 'Gathering' copy in chunks of PAGE_SIZE - // No risk of overlapping: kernel is copied from above to 1m mark - m->size = initrd.size = PAGE_SIZE; - u32 *p = m->bufv; - reset_bufv(p); - if (p) do { - m->buf = *p; - memcpy_image(m); - next(p); m->fallback+=PAGE_SIZE; - } while(*p); - // Move initrd - m = &initrd; - if(m->fallback) { - // This is tricky: copy initrd backwards to reduce - // risk of overlapping: use the fact that initrd is copied - // to the very top of ram - // (overlapping still can happen with more than 256mb ram) - // (generic solution for this overwrite problem, anyone?) - p=m->bufv; - reset_bufv(p); - do { - next(p); m->fallback+=PAGE_SIZE; - } while(*p); - do { - prev(p); m->fallback-=PAGE_SIZE; - m->buf = *p; - memcpy_image(m); - } while(p != m->bufv); - } - } -} - void load_image(struct image_himem *m) { no_exit++; // die() won't return to DOS m->remaining = m->size; @@ -69,13 +25,63 @@ } buf = m->buf; do { - u8 xfer_buf[PAGE_SIZE]; u16 size; - if(s16(size = read_image(m, xfer_buf, PAGE_SIZE)) <= 0) break; - storepage(bufv, ofs(xfer_buf)); + if(s16(size = read_image(m)) <= 0) break; + storepage(bufv); if (bufv != &buf) next(bufv); buf += size; } while (*bufv); if(m->remaining) die("Read error"); close(m->fd2close); } + +// Called just before rm->pm +void last_ditch() { + struct image_himem *m = ± + u32 *q; + vm2rm(); + if(((u16 *)&m->fallback)[1] >= 0x10) m->fallback = _1m; // >= _1m ? + q = m->bufv; + if(q==0) { + // Move kernel + memcpy_image(m); + // Move initrd + memcpy_image(pm2initrd(m)); + } else { //vcpi +#if defined(__BORLANDC__) && defined(NO386) +#pragma option -3 + asm{ + .386p + } +#endif + // Move kernel + // 'Gathering' copy in chunks of PAGE_SIZE + // No risk of overlapping: kernel is copied from above to 1m mark + m->size = pm2initrd(m)->size = PAGE_SIZE; + reset_bufv(q); + do { + m->buf = *q; + memcpy_image(m); + next(q); m->fallback+=PAGE_SIZE; + } while(*q); + // Move initrd + m = pm2initrd(m); + if(((u16 *)&m->fallback)[1]) { + // This is tricky: copy initrd backwards to reduce + // risk of overlapping: use the fact that initrd is copied + // to the very top of ram + // (overlapping still can happen with more than 256mb ram) + // (generic solution for this overwrite problem, anyone?) + q=m->bufv; + reset_bufv(q); + do { + next(q); m->fallback+=PAGE_SIZE; + } while(*q); + do { + prev(q); m->fallback-=PAGE_SIZE; + m->buf = *q; + memcpy_image(m); + } while(q != m->bufv); + } + } +} diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/ISO9660.CPP Wed Nov 28 19:46:10 2018 +0100 @@ -9,9 +9,10 @@ { static const unsigned long root = 16UL * 2048; struct isostate *x=&isostate; - if (name) + if (name) { //x->fd = open(name, O_RDONLY); x->fd = open(name); + } if (isoreadsector(&root) < 0 || strhead(x->buffer+1,"CD001")) { //close(x->fd); return -1; @@ -36,8 +37,8 @@ goto restarted; } if (x->curpos >= SECTORSZ || * (short *) (x->buffer + x->curpos) == 0) { + restarted: if (x->curdirsize < DIRSECTORSZ) return -1; - restarted: isoreadsector(&x->curdirofs); //x->curdirofs += SECTORSZ; *(int *)((char *) &x->curdirofs+1) += SECTORSZ/256; @@ -45,8 +46,9 @@ x->curpos = 0; } p = x->buffer; p += x->curpos; - if ((size = * (short *) p) == 0) + if ((size = * (short *) p) == 0) { return -1; + } x->fileofs = (* (unsigned long *) (p + 2)) << SECTORBITS; x->filesize = * (unsigned long *) (p + 10); x->filemod = (p[25] & 2) ? 0040755 : 0100755; diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/ISO9660.H --- a/linld/stuff/src/ISO9660.H Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/ISO9660.H Wed Nov 28 19:46:10 2018 +0100 @@ -25,8 +25,8 @@ #define isofilesize isostate.filesize #define isofilemod isostate.filemod #define isofilename isostate.filename -extern pascal long isolseek(const unsigned long *offset); -extern pascal int isoreadsector(const unsigned long *offset); +extern _fastcall long isolseek(const unsigned long *offset); +extern _fastcall int isoreadsector(const unsigned long *offset); extern int isoreset(char *name); extern int isoopen(const char *name); extern int isoreaddir(int restart); diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/LOAD.CPP --- a/linld/stuff/src/LOAD.CPP Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/LOAD.CPP Wed Nov 28 19:46:10 2018 +0100 @@ -242,6 +242,12 @@ void load_initrd() { struct image_himem *m = &initrd; if (!initrd_name && !m->fd) return; +#if defined(__BORLANDC__) && defined(NO386) +#pragma option -3 + asm{ + .386p + } +#endif m->errmsg = "Can't use initrd file"; open_image(initrd_name, m); diff -r 91b11cc25f3d -r 65366955881f linld/stuff/src/XMM.ASM --- a/linld/stuff/src/XMM.ASM Mon Nov 26 10:53:27 2018 +0200 +++ b/linld/stuff/src/XMM.ASM Wed Nov 28 19:46:10 2018 +0100 @@ -93,14 +93,11 @@ ends ;}; ;*************************************************************** -;pascal void xmm_alloc(struct image_himem *m) +;_fastcall void xmm_alloc(struct image_himem *m) ;*************************************************************** global @xmm_alloc$qp11image_himem:near proc @xmm_alloc$qp11image_himem near - pop ax - pop bx - push ax ret ; TO BE FIXED ifndef NO386 mov edx,[(image_himem bx).size] ; m->size