Subversion Repositories Kolibri OS

Rev

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

Rev 465 Rev 477
Line 1... Line 1...
1
$Revision: 465 $
1
$Revision: 477 $
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 46... Line 46...
46
;;                                                            ;;
46
;;                                                            ;;
47
;;                     SYSENTER ENTRY                         ;;
47
;;                     SYSENTER ENTRY                         ;;
48
;;                                                            ;;
48
;;                                                            ;;
49
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 50... Line -...
50
 
-
 
51
;uglobal
-
 
52
;times	100 db ?
-
 
53
;sysenter_stack:
-
 
54
;endg
-
 
55
 
50
 
56
align 32
-
 
57
SYSENTER_VAR	equ	0
51
align 32
58
sysenter_entry:
52
sysenter_entry:
59
	; Íàñòðàèâàåì ñòåê
-
 
60
     ;   cli                   sysenter clear IF
-
 
61
     ;   push    eax
-
 
62
     ;   mov     eax, [ss:CURRENT_TASK]
-
 
63
     ;   shl     eax, 8
-
 
64
     ;   mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
-
 
65
     ;   lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
-
 
66
     ;   mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
53
	; Íàñòðàèâàåì ñòåê
67
        mov     esp, [ss:tss._esp0]
-
 
68
 
54
        mov     esp, [ss:tss._esp0]
-
 
55
	sti
-
 
56
	push	ebp			; save app esp + 4
69
	sti
57
	mov	ebp, [ebp]		; ebp - original ebp
70
    ;------------------
58
	;------------------
71
	pushad
59
	pushad
Line 72... Line 60...
72
	cld
60
	cld
Line 83... Line 71...
83
	call	dword [servetable + edi * 4]
71
	call	dword [servetable + edi * 4]
84
	pop	eax
72
	pop	eax
Line 85... Line 73...
85
 
73
 
86
	popad
74
	popad
-
 
75
	;------------------
-
 
76
	xchg	ecx, [ss:esp]		; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
87
	;------------------
77
	sub	ecx, 4
-
 
78
	xchg	edx, [ecx]		; edx - return point, & save original edx
-
 
79
	push	edx
88
        mov     edx, [SYSENTER_VAR]       ; eip
80
	mov	edx, [ss:esp + 4]
-
 
81
	mov	[ecx + 4], edx		; save original ecx
89
        mov     ecx, [SYSENTER_VAR + 4]   ; esp
82
	pop	edx
Line 90... Line 83...
90
	sysexit
83
	sysexit
91
 
84
 
92
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
85
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;