Subversion Repositories Kolibri OS

Rev

Rev 4923 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4923 Rev 5116
Line 230... Line 230...
230
        pop     eax
230
        pop     eax
Line 231... Line 231...
231
 
231
 
232
        mov     edi, ebx
232
        mov     edi, ebx
233
        shr     edi, 12
233
        shr     edi, 12
234
        lea     edi, [page_tabs+edi*4]
-
 
235
 
-
 
236
if USE_FIX_FOR_INVALID_MS_VIRTUAL_PC_2007
-
 
237
        mov     edx, eax
-
 
238
@@:
-
 
239
        mov     eax, edx
-
 
240
        stosd
-
 
241
        invlpg  [ebx]
-
 
242
        add     edx, 0x1000
-
 
243
        add     ebx, 0x1000
-
 
244
        loop    @B
-
 
245
else
234
        lea     edi, [page_tabs+edi*4]
246
@@:
235
@@:
247
        stosd
236
        stosd
248
        invlpg  [ebx]
237
        invlpg  [ebx]
249
        add     eax, 0x1000
238
        add     eax, 0x1000
250
        add     ebx, 0x1000
239
        add     ebx, 0x1000
251
        loop    @B
-
 
Line 252... Line 240...
252
end if
240
        loop    @B
Line 253... Line 241...
253
 
241
 
254
        pop     edi
242
        pop     edi
Line 360... Line 348...
360
        invlpg  [eax]
348
        invlpg  [eax]
361
        pop     ebx
349
        pop     ebx
362
        ret
350
        ret
363
endp
351
endp
Line -... Line 352...
-
 
352
 
-
 
353
uglobal
-
 
354
sb16_buffer_allocated db 0
-
 
355
endg
-
 
356
 
-
 
357
; Allocates [.size] bytes so that the target memory block
-
 
358
; is inside one 64K page for 24-bit DMA controller,
-
 
359
; that is, somewhere between 00xx0000h and 00xxFFFFh.
-
 
360
proc alloc_dma24
-
 
361
; Implementation note.
-
 
362
; The only user of that function is SB16 driver,
-
 
363
; so just return a statically allocated buffer.
-
 
364
virtual at esp
-
 
365
                dd      ? ; return address
-
 
366
.size           dd      ?
-
 
367
end virtual
-
 
368
        cmp     [sb16_buffer_allocated], 0
-
 
369
        jnz     .fail
-
 
370
        inc     [sb16_buffer_allocated]
-
 
371
        mov     eax, SB16Buffer
-
 
372
        ret     4
-
 
373
.fail:
-
 
374
        xor     eax, eax
-
 
375
        ret     4
-
 
376
endp
-
 
377
 
-
 
378
; Allocates a physical page for master page table
-
 
379
; that duplicates first Mb of OS_BASE at address 0;
-
 
380
; used for starting APs and for shutting down,
-
 
381
; where it is important to execute code in trivial-mapped pages.
-
 
382
; Returns eax = allocated physical page.
-
 
383
proc create_trampoline_pgmap
-
 
384
; The only non-trivial moment:
-
 
385
; we need a linear address to fill information,
-
 
386
; but we don't need it outside of this function,
-
 
387
; so we're returning physical address.
-
 
388
; Therefore, allocate memory with kernel_alloc,
-
 
389
; this will allocate physical page and a linear address somewhere,
-
 
390
; and deallocate only linear address with free_kernel_space.
-
 
391
        stdcall kernel_alloc, 0x1000
-
 
392
        mov     edi, eax
-
 
393
        mov     esi, master_tab
-
 
394
        mov     ecx, 1024
-
 
395
        rep movsd
-
 
396
        mov     ecx, [master_tab+(OS_BASE shr 20)]
-
 
397
        mov     [eax], ecx
-
 
398
        mov     edi, eax
-
 
399
        call    get_pg_addr
-
 
400
        push    eax
-
 
401
        stdcall free_kernel_space, edi
-
 
402
        pop     eax
-
 
403
        ret
-
 
404
endp
364
 
405
 
365
align 4
406
align 4
366
proc init_LFB
407
proc init_LFB
367
           locals
408
           locals
368
             pg_count dd ?
409
             pg_count dd ?