destroy shared memory. update docs

git-svn-id: svn://kolibrios.org@945 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2008-12-06 20:24:43 +00:00
parent 31f5bf31ed
commit 34c30dea68
3 changed files with 94 additions and 26 deletions

View File

@ -1149,25 +1149,32 @@ destroy_smap:
pushfd pushfd
cli cli
push ebx push esi
mov ebx, eax push edi
mov eax, [eax+SMAP.base] mov edi, eax
test eax, eax mov esi, [eax+SMAP.parent]
jz @F test esi, esi
jz .done
stdcall user_free, eax lock dec [esi+SMEM.refcount]
@@: jnz .done
mov eax, [ebx+SMAP.parent]
test eax, eax
jz @F
lock dec [eax+SMEM.refcount] mov ecx, [esi+SMEM.bk]
@@: mov edx, [esi+SMEM.fd]
mov eax, ebx
mov [ecx+SMEM.fd], edx
mov [edx+SMEM.bk], ecx
stdcall kernel_free, [esi+SMEM.base]
mov eax, esi
call free
.done:
mov eax, edi
call destroy_kernel_object call destroy_kernel_object
pop ebx pop edi
pop esi
popfd popfd
ret ret
@ -1395,6 +1402,8 @@ proc shmem_close stdcall, name:dword
push esi push esi
push edi push edi
pushfd
cli
mov esi, [current_slot] mov esi, [current_slot]
add esi, APP_OBJ_OFFSET add esi, APP_OBJ_OFFSET
@ -1419,8 +1428,11 @@ proc shmem_close stdcall, name:dword
test eax, eax test eax, eax
jne .next jne .next
stdcall user_free, [esi+SMAP.base]
call [esi+APPOBJ.destroy] call [esi+APPOBJ.destroy]
@@: @@:
popfd
pop edi pop edi
pop esi pop esi
.fail: .fail:

View File

@ -1024,10 +1024,8 @@ f68call:
dd f68.22 dd f68.22
dd f68.23 dd f68.23
align 4 align 4
f68: f68:
cmp eax,4 cmp eax,4
jle sys_sheduler jle sys_sheduler
@ -1038,13 +1036,11 @@ f68:
ja .fail ja .fail
jmp dword [f68call+eax*4-11*4] jmp dword [f68call+eax*4-11*4]
.11: .11:
call init_heap call init_heap
mov [esp+36], eax mov [esp+36], eax
ret ret
.12: .12:
stdcall user_alloc, ebx stdcall user_alloc, ebx
mov [esp+36], eax mov [esp+36], eax
ret ret

View File

@ -2204,11 +2204,11 @@ dword-
‡ ¬¥ç ­¨ï: ‡ ¬¥ç ­¨ï:
* ‘âàãªâãà  â ¡«¨æë 梥⮢ ®¯¨á ­  ¢ áâ ­¤ àâ­®¬ ¢ª«îç ¥¬®¬ ä ©«¥ * ‘âàãªâãà  â ¡«¨æë 梥⮢ ®¯¨á ­  ¢ áâ ­¤ àâ­®¬ ¢ª«îç ¥¬®¬ ä ©«¥
macros.inc ¯®¤ ­ §¢ ­¨¥¬ system_colors; ­ ¯à¨¬¥à, ¬®¦­® ¯¨á âì: macros.inc ¯®¤ ­ §¢ ­¨¥¬ system_colors; ­ ¯à¨¬¥à, ¬®¦­® ¯¨á âì:
sc system_colors ; ®¡ê¥­¨¥ ¯¥à¥¬¥­­®© sc system_colors ; ®¡ê¥­¨¥ ¯¥à¥¬¥­­®©
... ; £¤¥-â® ­ ¤® ¢ë§¢ âì ... ; £¤¥-â® ­ ¤® ¢ë§¢ âì
; ®¯¨á뢠¥¬ãî äã­ªæ¨î á ecx=sc ; ®¯¨á뢠¥¬ãî äã­ªæ¨î á ecx=sc
mov ecx, [sc.work_button_text] ; ç¨â ¥¬ 梥â ⥪áâ  mov ecx, [sc.work_button_text] ; ç¨â ¥¬ 梥â ⥪áâ 
; ­  ª­®¯ª¥ ¢ à ¡®ç¥© ®¡« á⨠; ­  ª­®¯ª¥ ¢ à ¡®ç¥© ®¡« áâ¨
* ˆá¯®«ì§®¢ ­¨¥/­¥¨á¯®«ì§®¢ ­¨¥ íâ¨å 梥⮢ - ¤¥«® ¨áª«îç¨â¥«ì­® * ˆá¯®«ì§®¢ ­¨¥/­¥¨á¯®«ì§®¢ ­¨¥ íâ¨å 梥⮢ - ¤¥«® ¨áª«îç¨â¥«ì­®
á ¬®© ¯à®£à ¬¬ë. „«ï ¨á¯®«ì§®¢ ­¨ï ­ã¦­® ¯à®áâ® ¯à¨ ¢ë§®¢¥ ä㭪権 á ¬®© ¯à®£à ¬¬ë. „«ï ¨á¯®«ì§®¢ ­¨ï ­ã¦­® ¯à®áâ® ¯à¨ ¢ë§®¢¥ ä㭪権
à¨á®¢ ­¨ï 㪠§ë¢ âì 梥â, ¢§ïâë© ¨§ í⮩ â ¡«¨æë. à¨á®¢ ­¨ï 㪠§ë¢ âì 梥â, ¢§ïâë© ¨§ í⮩ â ¡«¨æë.
@ -3183,10 +3183,10 @@ IPC
<EFBFBD>ணࠬ¬¥ ¤®áâã¯­ë ¤ ­­ë¥ £à ä¨ç¥áª®£® íªà ­  (®¡« áâì ¯ ¬ïâ¨, ª®â®à ï <EFBFBD>ணࠬ¬¥ ¤®áâã¯­ë ¤ ­­ë¥ £à ä¨ç¥áª®£® íªà ­  (®¡« áâì ¯ ¬ïâ¨, ª®â®à ï
ᮡá⢥­­® ¨ ®â®¡à ¦ ¥â ᮤ¥à¦¨¬®¥ íªà ­ ) ­ ¯àï¬ãî ¡¥§ ¢ë§®¢®¢ ᮡá⢥­­® ¨ ®â®¡à ¦ ¥â ᮤ¥à¦¨¬®¥ íªà ­ ) ­ ¯àï¬ãî ¡¥§ ¢ë§®¢®¢
á¨á⥬­ëå ä㭪権 ç¥à¥§ ᥫ¥ªâ®à gs: á¨á⥬­ëå ä㭪権 ç¥à¥§ ᥫ¥ªâ®à gs:
mov eax, [gs:0] mov eax, [gs:0]
¯®¬¥áâ¨â ¢ eax ¯¥à¢ë© dword ¡ãä¥à , ᮤ¥à¦ é¨© ¨­ä®à¬ æ¨î ® 梥⥠¯®¬¥áâ¨â ¢ eax ¯¥à¢ë© dword ¡ãä¥à , ᮤ¥à¦ é¨© ¨­ä®à¬ æ¨î ® 梥â¥
«¥¢®© ¢¥àå­¥© â®çª¨ (¨, ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å). «¥¢®© ¢¥àå­¥© â®çª¨ (¨, ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å).
mov [gs:0], eax mov [gs:0], eax
¯à¨ à ¡®â¥ ¢ ०¨¬ å VESA c LFB ¯à¨ à ¡®â¥ ¢ ०¨¬ å VESA c LFB
ãáâ ­®¢¨â 梥⠫¥¢®© ¢¥àå­¥© â®çª¨ ãáâ ­®¢¨â 梥⠫¥¢®© ¢¥àå­¥© â®çª¨
(¨ ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å). (¨ ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å).
@ -3814,6 +3814,66 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* ‘®¤¥à¦¨¬®¥ ¯ ¬ï⨠¢¯«®âì ¤® ­ ¨¬¥­ì襣® ¨§ áâ à®£® ¨ ­®¢®£® * ‘®¤¥à¦¨¬®¥ ¯ ¬ï⨠¢¯«®âì ¤® ­ ¨¬¥­ì襣® ¨§ áâ à®£® ¨ ­®¢®£®
à §¬¥à®¢ á®åà ­ï¥âáï. à §¬¥à®¢ á®åà ­ï¥âáï.
===========================================================================
====== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 22 - ®âªàëâì ¨¬¥­®¢ ­ãî ®¡« áâì ¯ ¬ïâ¨. =====
===========================================================================
<EFBFBD> à ¬¥âàë
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 22 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¬ï ®¡« áâ¨. Œ ªá¨¬ã¬ 32 ᨬ¢®«  ¢ª«îç ï § ¢¥àè î騩 ­®«ì
* edx = à §¬¥à ®¡« á⨠¢ ¡ ©â å ¤«ï SHM_CREATE ¨ SHM_OPEN_ALWAYS
* esi = ä« £¨ ®âªàëâ¨ï ¨ ¤®áâ㯠
SHM_OPEN = 0x00
SHM_OPEN_ALWAYS = 0x04
SHM_CREATE = 0x08
SHM_READ = 0x00
SHM_WRITE = 0x01
SHM_CREATE - ᮧ¤ âì ­®¢ãî ®¡« áâì ¯ ¬ïâ¨. …᫨ ®¡« áâì á
â ª¨¬ ¨¬¥­¥¬ 㦥 áãé¥áâ¢ã¥â äã­ªæ¨ï ¢¥à­ñâ ª®¤ ®è¨¡ª¨ E_ACCESS
SHM_OPEN_ALWAYS - ®âªà뢠¥â áãé¥áâ¢ãîéãî ¨«¨ ᮧ¤ ñâ ­®¢ãî
®¡« áâì ¯ ¬ïâ¨.
SHM_OPEN - ®âªà뢠¥â áãé¥áâ¢ãîéãî ®¡« áâì ¯ ¬ïâ¨. …᫨
®¡« áâì á â ª¨¬ ¨¬¥­¥¬ ­¥ áãé¥áâ¢ã¥â äã­ªæ¨ï ¢¥à­ñâ ª®¤
®è¨¡ª¨ E_NOTFOUND.
SHM_READ - ¤®áâ㯠⮫쪮 ­  ç⥭¨¥.
SHM_WRITE - ¤®áâ㯠­  ç⥭¨¥ ¨ § ¯¨áì.
‚®§¢à é ¥¬ë¥ §­ ç¥­¨ï:
* eax = 㪠§ â¥«ì ­  ®¡« áâì ¯ ¬ï⨠¨«¨ ­®«ì ¢ á«ãç ¥ ®è¨¡ª¨
* edx = ¥á«¨ ­®¢ ï ®¡« áâì ᮧ¤ ñâáï SHM_CREATE ¨«¨ SHM_OPEN_ALWAYS
­®«ì ¢ á«ãç ¥ ãá¯¥å  ¨«¨ ª®¤ ®è¨¡ª¨.
¥á«¨ áãé¥áâ¢ãîé ï ®¡« áâì ®âªà뢠¥âáï SHM_OPEN ¨«¨ SHM_OPEN_ALWAYS
à §¬¥à ®¡« á⨠¢ ¡ ©â å ¨«¨ ª®¤ ®è¨¡ª¨
Š®¤ë ®è¨¡®ª:
* E_NOTFOUND = 5
* E_ACCESS = 10
* E_NOMEM = 30
* E_PARAM = 33
‡ ¬¥ç ­¨ï:
* …᫨ ᮧ¤ ñâáï ­®¢ ï ®¡« áâì â® ä« £¨ ¤®áâ㯠 ãáâ ­ ¢«¨¢ îâ
¬ ªá¨¬ «ì­ë¥ ¯à ¢  ¤®áâ㯠 ¤«ï ®áâ «ì­ëå ¯à®æ¥áᮢ.
* <20>®¤¨â¥«ì᪨© ¯à®æ¥áá ¢á¥£¤  ¨¬¥¥â ¤®áâ㯠­  § ¯¨áì.
===========================================================================
====== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 22 - § ªàëâì ¨¬¥­®¢ ­ãî ®¡« áâì ¯ ¬ïâ¨. =====
===========================================================================
<EFBFBD> à ¬¥âàë
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 23 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¬ï ®¡« áâ¨. Œ ªá¨¬ã¬ 32 ᨬ¢®«  ¢ª«îç ï § ¢¥àè î騩 ­®«ì
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ­¥ ®¯à¥¤¥«¥­®
====================================================================== ======================================================================
======================== ”ã­ªæ¨ï 69 - ®â« ¤ª . ======================= ======================== ”ã­ªæ¨ï 69 - ®â« ¤ª . =======================
====================================================================== ======================================================================
@ -3881,7 +3941,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
¨ ¯à¨ ¯®áâ㯫¥­¨¨ ­®¢®£® á®®¡é¥­¨ï á¨á⥬  ¡ã¤¥â ¦¤ âì. ¨ ¯à¨ ¯®áâ㯫¥­¨¨ ­®¢®£® á®®¡é¥­¨ï á¨á⥬  ¡ã¤¥â ¦¤ âì.
„«ï ᨭåà®­¨§ æ¨¨ ®¡à ¬«ï©â¥ ¢áî à ¡®âã á ¡ãä¥à®¬ ®¯¥à æ¨ï¬¨ „«ï ᨭåà®­¨§ æ¨¨ ®¡à ¬«ï©â¥ ¢áî à ¡®âã á ¡ãä¥à®¬ ®¯¥à æ¨ï¬¨
¡«®ª¨à®¢ª¨/à §¡«®ª¨à®¢ª¨ ¡«®ª¨à®¢ª¨/à §¡«®ª¨à®¢ª¨
neg [bufsize] neg [bufsize]
* „ ­­ë¥ ¢ ¡ãä¥à¥ âà ªâãîâáï ª ª ¬ áᨢ í«¥¬¥­â®¢ ¯¥à¥¬¥­­®© ¤«¨­ë - * „ ­­ë¥ ¢ ¡ãä¥à¥ âà ªâãîâáï ª ª ¬ áᨢ í«¥¬¥­â®¢ ¯¥à¥¬¥­­®© ¤«¨­ë -
á®®¡é¥­¨©. ”®à¬ â á®®¡é¥­¨ï 㪠§ ­ ¢ ®¡é¥¬ ®¯¨á ­¨¨. á®®¡é¥­¨©. ”®à¬ â á®®¡é¥­¨ï 㪠§ ­ ¢ ®¡é¥¬ ®¯¨á ­¨¨.