This commit is contained in:
Pavel 2023-12-15 11:29:04 +03:00
parent 279383bebd
commit 1371a9302c
2 changed files with 9 additions and 10 deletions

View File

@ -229,8 +229,6 @@ begin
(v_end < $fc00000001) or
(sdk_version_big_20()=false) ) then
begin
_rmap_insert:
rmem_map_lock(@rmap);
err:=Integer(rmem_map_lookup_entry(@rmap,OFF_TO_IDX(phaddr),@rentry));
rmem_map_unlock(@rmap);
@ -240,6 +238,8 @@ begin
(is_sce_prog_attr_080000(@g_authinfo)) or
((p_proc.p_dmem_aliasing and 1)<>0) then //aliasing
begin
_rmap_insert:
err:=dmem_map_set_mtype(@dmem,OFF_TO_IDX(phaddr),OFF_TO_IDX(phaddr+length),mtype);
if (err=0) then
@ -252,10 +252,6 @@ begin
end else
begin
err:=vm_mmap_to_errno(err);
dmem_map_lock (@dmem);
dmem_map_delete(@dmem,OFF_TO_IDX(phaddr),OFF_TO_IDX(phaddr+length));
dmem_map_unlock(@dmem);
end;
end;
@ -264,7 +260,7 @@ begin
begin
if ((prot and VM_PROT_GPU_ALL)<>0) then
begin
Assert(False,'TODO');
Writeln('TODO check aliasing prot');
end;
goto _rmap_insert;
end else
@ -515,6 +511,8 @@ begin
if ((obj^.flags and OBJ_DMEM_EXT)<>0) then
begin
qinfo^.protection:=qinfo^.protection and (VM_PROT_GPU_ALL or VM_PROT_RW);
start :=entry^.start;
relofs:=entry^.offset - start;

View File

@ -521,8 +521,6 @@ begin
new_entry:=AllocMem(SizeOf(vm_map_entry));
Assert((new_entry<>nil),'vm_map_entry_create: kernel resources exhausted');
Result:=new_entry;
Result^.entry_id:=map^.entry_id;
Inc(map^.entry_id);
end;
{
@ -1057,7 +1055,7 @@ charged:
end else
if ((prev_entry<>@map^.header) and
(prev_entry^.eflags=protoeflags) and
((cow and (MAP_ENTRY_GROWS_DOWN or MAP_ENTRY_GROWS_UP))=0) and
((cow and (MAP_ENTRY_GROWS_DOWN or MAP_ENTRY_GROWS_UP or MAP_COW_NO_COALESCE))=0) and
(prev_entry^.__end=start) and
vm_object_coalesce(prev_entry^.vm_obj,
prev_entry^.offset,
@ -1126,6 +1124,9 @@ charged:
new_entry^.protection:=prot;
new_entry^.max_protection:=max;
new_entry^.entry_id:=map^.entry_id;
Inc(map^.entry_id);
vm_object_reference(obj);
Assert(not ENTRY_CHARGED(new_entry),'OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry');