wok-current view linld/stuff/src/XMM.ASM @ rev 20794
Update some WEB_SITE
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 15 11:29:31 2019 +0100 (2019-02-15) |
parents | 65366955881f |
children | d0b13dc0fe1c |
line source
1 ;***************************************************************
2 ;****** This file is distributed under GPL
3 ;***************************************************************
4 ideal
5 %crefref
6 %noincl
7 %nomacs
8 ifdef NO386
9 p8086
10 else
11 p386
12 endif
14 group DGROUP _TEXT,_BSS
15 assume cs:DGROUP,ds:DGROUP
17 segment _BSS byte public use16 'BSS'
19 xmm_handler dd ?
21 ends _BSS
23 segment _TEXT byte public use16 'CODE'
25 ;***************************************************************
26 ;void enable_a20_xmm();
27 ;***************************************************************
28 global _enable_a20_xmm:near
29 proc _enable_a20_xmm near
31 mov ah,03h ;global enable a20
32 call xmm_driver ;
33 mov ah,05h ;local enable a20
34 ;jmp xmm_driver ;
36 endp _enable_a20_xmm
38 ;***************************************************************
39 ;Call xmm driver addr or 0 if no xmm
40 ;void xmm_driver(ah)
41 ;***************************************************************
42 proc xmm_driver near
44 push si
45 mov si,offset xmm_handler
46 ifndef NO386
47 cmp [dword si],0
48 else
49 mov cx,[word si]
50 or cx,[word si+2]
51 endif
52 jne @@gotit
54 xchg ax,cx ; save cmd
55 mov ax,4300h ; installation check in al
56 int 2fh
57 mov bx,offset xmm_fail
58 push cs
59 pop es
60 cmp al,80h
61 jne @@err
62 mov ax,4310h ; get driver address in es:bx
63 int 2fh
64 @@err:
65 xchg ax,cx ; restore cmd
66 mov [si],bx
67 mov [si+2],es
68 @@gotit:
69 call [dword si] ; far ptr [si]
70 dec ax ; Z=1=OK
71 pop si
72 ret
73 xmm_fail:
74 xor ax,ax
75 cwd
76 retf
78 endp xmm_driver
81 struc image_himem ;struct image_himem {
82 fd dw ? ; 0 int fd;
83 fallback dd ? ; 2 u32 fallback;
84 size dd ? ; 6 u32 size;
85 remaining dd ? ;10 u32 remaining;
86 buf dd ? ;14 u32 buf;
87 bufv dw ? ;18 u32 *bufv;
88 errmsg dw ? ;20 char *errmsg;
89 chunk_size dd ? ;22 u32 chunk_size;
90 next_chunk dw ? ;26 void (*next_chunk)(struct image_himem *);
91 state dw ? ;28 u16 state;
92 fd2close dw ? ;30 u16 fd2close;
93 ends ;};
95 ;***************************************************************
96 ;_fastcall void xmm_alloc(struct image_himem *m)
97 ;***************************************************************
98 global @xmm_alloc$qp11image_himem:near
99 proc @xmm_alloc$qp11image_himem near
101 ifdef TO_BE_FIXED
102 ifndef NO386
103 mov edx,[(image_himem bx).size] ; m->size
104 ;dec edx
105 shr edx,10 ; to Kb
106 inc edx
107 mov ah,89h ;allocate blk of EDX kilobytes
108 else
109 ;mov ax,-1
110 ;cwd
111 ;add ax,[word (image_himem bx).size] ; lo m->size
112 ;adc dx,[word (image_himem bx+2).size] ; hi m->size
113 mov ax,[word (image_himem bx).size] ; lo m->size
114 mov dx,[word (image_himem bx+2).size] ; hi m->size
115 mov cl,16-10
116 extrn N_LXLSH@:near
117 call N_LXLSH@
118 inc dx
119 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
120 endif
121 push bx
122 call xmm_driver ;
123 jnz @@goerr
124 ;now: dx=handle of the blk
125 mov ah,0Ch ;lock blk
126 call xmm_driver ;
127 ;now: dx:bx=addr of blk
128 xchg ax,bx
129 @@goerr:
130 pop bx
131 jnz @@err
132 mov [word (image_himem bx).buf],ax ; lo m->buf
133 mov [word (image_himem bx+2).buf],dx ; hi m->buf
134 endif ; TO_BE_FIXED
135 @@err:
136 ret
138 endp @xmm_alloc$qp11image_himem
140 ends _TEXT
142 end
144 ;###### END OF FILE ############################################