Subversion Repositories Kolibri OS

Rev

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

Rev 1505 Rev 1507
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 1496 $
8
$Revision: 1507 $
9
 
9
 
Line 371... Line 371...
371
 
371
 
372
           shr edi, 12
372
           shr edi, 12
373
           mov [pg_count], edi
373
           mov [pg_count], edi
Line 374... Line -...
374
           shr edi, 10
-
 
375
 
-
 
376
           bt [cpu_caps], CAPS_PSE
374
           shr edi, 10
377
           jnc .map_page_tables
375
 
378
           or esi, PG_LARGE+PG_UW
376
           or esi,  PG_GLOBAL+PG_LARGE+PG_UW
379
           mov edx, sys_pgdir+(LFB_BASE shr 20)
377
           mov edx, sys_pgdir+(LFB_BASE shr 20)
380
@@:
378
@@:
381
           mov [edx], esi
379
           mov [edx], esi
382
           add edx, 4
380
           add edx, 4
383
           add esi, 0x00400000
381
           add esi, 0x00400000
Line 384... Line -...
384
           dec edi
-
 
385
           jnz @B
-
 
386
 
-
 
387
           bt [cpu_caps], CAPS_PGE
-
 
388
           jnc @F
382
           dec edi
389
           or dword [sys_pgdir+(LFB_BASE shr 20)], PG_GLOBAL
383
           jnz @B
390
@@:
384
 
391
           mov dword [LFBAddress], LFB_BASE
385
           mov dword [LFBAddress], LFB_BASE
-
 
386
           mov eax, cr3       ;flush TLB
Line 392... Line -...
392
           mov eax, cr3       ;flush TLB
-
 
393
           mov cr3, eax
-
 
394
           ret
387
           mov cr3, eax
395
 
388
           ret
396
.map_page_tables:
389
endp
397
 
390
 
-
 
391
align 4
398
@@:
392
proc init_userDMA
399
           call alloc_page
393
           stdcall alloc_pages, 4096 	; 16M <<<<<<<<<<+++++++++++++++++++++++++++++++++
400
           stdcall map_page_table, edx, eax
-
 
401
           add edx, 0x00400000
394
           add eax, 0x007FFFF0
402
           dec edi
395
	   and eax, 0xFF800000		; align at 8M boundary
403
           jnz @B
396
	   mov [UserDMAaddr], eax
404
 
397
           or  eax, PG_UW + PG_NOCACHE
405
           mov eax, [LFBAddress]
-
 
406
           mov edi, page_tabs + (LFB_BASE shr 10)
-
 
407
           or eax, PG_UW
398
           mov ebx, USER_DMA_BUFFER
408
           mov ecx, [pg_count]
399
	   mov ecx, 2048		; 8M, to be sure
409
           cld
400
           call commit_pages
410
@@:
401
           mov eax, [UserDMAaddr]
411
           stosd
-
 
412
           add eax, 0x1000
-
 
413
           dec ecx
402
           or  eax, PG_LARGE + PG_UW + PG_NOCACHE
414
           jnz @B
403
           mov ebx, sys_pgdir + (USER_DMA_BUFFER shr 20)
415
 
-
 
416
           mov dword [LFBAddress], LFB_BASE
404
           mov [ebx], eax
417
           mov eax, cr3       ;flush TLB
405
	   add ebx, 4
Line 418... Line 406...
418
           mov cr3, eax
406
           add eax, 0x00400000
419
 
407
           mov [ebx], eax