Subversion Repositories Kolibri OS

Rev

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

Rev 1461 Rev 1496
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: 1461 $
8
$Revision: 1496 $
9
 
9
 
Line 947... Line 947...
947
	ret
947
	ret
948
endp
948
endp
Line 949... Line 949...
949
 
949
 
950
sys_IPC:
950
sys_IPC:
951
;input:
951
;input:
952
;  eax=1 - set ipc buffer area
952
;  ebx=1 - set ipc buffer area
953
;    ebx=address of buffer
953
;    ecx=address of buffer
954
;    ecx=size of buffer
954
;    edx=size of buffer
955
;  eax=2 - send message
955
;  eax=2 - send message
956
;    ebx=PID
956
;    ebx=PID
957
;    ecx=address of message
957
;    ecx=address of message
Line 958... Line -...
958
;    edx=size of message
-
 
959
 
-
 
960
           cmp  eax,1
-
 
961
           jne @f
-
 
962
           call set_ipc_buff
-
 
963
           mov [esp+36], eax
958
;    edx=size of message
964
           ret
-
 
965
@@:
-
 
966
           cmp eax, 2
-
 
967
           jne @f
-
 
968
           stdcall sys_ipc_send, ebx, ecx, edx
-
 
969
           mov [esp+36], eax
-
 
970
           ret
-
 
971
@@:
-
 
972
           xor eax, eax
-
 
973
           not eax
-
 
974
           mov [esp+36], eax
-
 
975
           ret
959
 
976
 
-
 
Line 977... Line 960...
977
align 4
960
	dec	ebx
978
proc set_ipc_buff
961
	jnz	@f
979
 
962
 
980
           mov  eax,[current_slot]
963
	mov  	eax,[current_slot]
981
           pushf
964
        pushf
Line 982... Line 965...
982
           cli
965
        cli
983
           mov  [eax+APPDATA.ipc_start],ebx     ;set fields in extended information area
966
        mov  	[eax+APPDATA.ipc_start],ecx     ;set fields in extended information area
984
           mov  [eax+APPDATA.ipc_size],ecx
967
        mov  	[eax+APPDATA.ipc_size],edx
985
 
968
 
986
           add ecx, ebx
969
        add edx, ecx
987
           add ecx, 4095
970
        add edx, 4095
988
           and ecx, not 4095
971
        and edx, not 4095
989
 
972
 
Line 990... Line 973...
990
.touch:    mov eax, [ebx]
973
.touch: mov eax, [ecx]
991
           add ebx, 0x1000
974
        add ecx, 0x1000
992
           cmp ebx, ecx
975
        cmp ecx, edx
-
 
976
        jb  .touch
-
 
977
 
-
 
978
        popf
-
 
979
        mov [esp+32], ebx	;ebx=0
-
 
980
        ret
-
 
981
 
-
 
982
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
983
;2
-
 
984
@@:
-
 
985
	dec	ebx
-
 
986
	jnz	@f
-
 
987
 
-
 
988
        stdcall sys_ipc_send, ecx, edx, esi
-
 
989
        mov 	[esp+32], eax
-
 
990
        ret
-
 
991
@@:
-
 
992
	or	eax,-1
-
 
993
        mov 	[esp+32], eax
-
 
994
        ret
-
 
995
 
-
 
996
;align 4
-
 
997
;proc set_ipc_buff
-
 
998
 
-
 
999
;           mov  eax,[current_slot]
-
 
1000
;           pushf
-
 
1001
;           cli
-
 
1002
;           mov  [eax+APPDATA.ipc_start],ebx     ;set fields in extended information area
-
 
1003
;           mov  [eax+APPDATA.ipc_size],ecx
-
 
1004
;
-
 
1005
;           add ecx, ebx
-
 
1006
;           add ecx, 4095
-
 
1007
;           and ecx, not 4095
-
 
1008
;
-
 
1009
;.touch:    mov eax, [ebx]
-
 
1010
;           add ebx, 0x1000
-
 
1011
;           cmp ebx, ecx
993
           jb  .touch
1012
;           jb  .touch
Line 994... Line 1013...
994
 
1013
;
995
           popf
1014
;           popf
996
           xor eax, eax
1015
;           xor eax, eax
997
           ret
1016
;           ret