Subversion Repositories Kolibri OS

Rev

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

Rev 519 Rev 520
Line 1... Line 1...
1
$Revision: 519 $
1
$Revision: 520 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 1083... Line 1083...
1083
           pop edx
1083
           pop edx
1084
           pop ecx
1084
           pop ecx
1085
           ret
1085
           ret
1086
endp
1086
endp
Line -... Line 1087...
-
 
1087
 
-
 
1088
align 4
-
 
1089
proc create_ring_buffer stdcall, size:dword, flags:dword
-
 
1090
           locals
-
 
1091
             buf_ptr  dd ?
-
 
1092
           endl
-
 
1093
 
-
 
1094
           mov eax, [size]
-
 
1095
           test eax, eax
-
 
1096
           jz .fail
-
 
1097
 
-
 
1098
           add eax, eax
-
 
1099
           stdcall alloc_kernel_space, eax
-
 
1100
           test eax, eax
-
 
1101
           jz .fail
-
 
1102
 
-
 
1103
           mov [buf_ptr], eax
-
 
1104
 
-
 
1105
           mov ebx, [size]
-
 
1106
           shr ebx, 12
-
 
1107
           push ebx
-
 
1108
 
-
 
1109
           stdcall alloc_pages, ebx
-
 
1110
           pop ecx
-
 
1111
 
-
 
1112
           test eax, eax
-
 
1113
           jz .mm_fail
-
 
1114
 
-
 
1115
           or eax, [flags]
-
 
1116
           mov edi, [buf_ptr]
-
 
1117
           mov ebx, [buf_ptr]
-
 
1118
           mov edx, ecx
-
 
1119
           shl edx, 2  
-
 
1120
           shr edi, 10
-
 
1121
@@:
-
 
1122
           mov [page_tabs+edi], eax
-
 
1123
           mov [page_tabs+edi+edx], eax
-
 
1124
           invlpg [ebx]
-
 
1125
           invlpg [ebx+esi]
-
 
1126
           add eax, 0x1000
-
 
1127
           add ebx, 0x1000
-
 
1128
           add edi, 4 
-
 
1129
           dec ecx
-
 
1130
           jnz @B
-
 
1131
 
-
 
1132
           mov eax, [buf_ptr]
-
 
1133
           ret
-
 
1134
.mm_fail:
-
 
1135
           stdcall free_kernel_space, [buf_ptr]
-
 
1136
           xor eax, eax
-
 
1137
.fail:
-
 
1138
           ret
Line 1087... Line 1139...
1087
 
1139
endp
1088
 
1140
 
1089
if 0
1141
if 0
1090
     push eax
1142
     push eax