Subversion Repositories Kolibri OS

Rev

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

Rev 431 Rev 434
Line 1... Line 1...
1
$Revision: 431 $
1
$Revision: 434 $
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 12... Line 12...
12
;;                                                            ;;
12
;;                                                            ;;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 14... Line 14...
14
 
14
 
15
align 32
15
align 32
-
 
16
i40:
-
 
17
; diamond, 27.03.2007: handler does not require disabled interrupts
16
i40:
18
;                      so interrupts remain enabled when calling int 0x40
17
      push  ds es
19
      push  ds es
18
      pushad
20
      pushad
Line 19... Line 21...
19
      cld
21
      cld
Line 29... Line 31...
29
        mov     edx, esi
31
        mov     edx, esi
30
        mov     esi, edi
32
        mov     esi, edi
31
        mov     edi, [esp+28]
33
        mov     edi, [esp+28]
Line 32... Line 34...
32
 
34
 
33
      ; enable interupts  -  a task switch or an IRQ _CAN_ interrupt i40 handler
35
      ; enable interupts  -  a task switch or an IRQ _CAN_ interrupt i40 handler
34
      sti
36
;      sti
35
      push  eax
37
      push  eax
36
      and   edi,0xff
38
      and   edi,0xff
37
      call  dword [servetable+edi*4]
39
      call  dword [servetable+edi*4]
38
      pop   eax
40
      pop   eax
Line 47... Line 49...
47
;;                                                            ;;
49
;;                                                            ;;
48
;;                     SYSENTER ENTRY                         ;;
50
;;                     SYSENTER ENTRY                         ;;
49
;;                                                            ;;
51
;;                                                            ;;
50
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 51... Line 53...
51
 
53
 
52
uglobal
54
;uglobal
53
times	100 db ?
55
;times	100 db ?
54
sysenter_stack:
56
;sysenter_stack:
Line 55... Line 57...
55
endg
57
;endg
56
 
58
 
57
align 32
59
align 32
58
SYSENTER_VAR	equ	0
60
SYSENTER_VAR	equ	0
Line 63... Line 65...
63
     ;   mov     eax, [ss:CURRENT_TASK]
65
     ;   mov     eax, [ss:CURRENT_TASK]
64
     ;   shl     eax, 8
66
     ;   shl     eax, 8
65
     ;   mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
67
     ;   mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
66
     ;   lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
68
     ;   lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
67
     ;   mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
69
     ;   mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
-
 
70
        mov     esp, [ss:CURRENT_RING0_ESP]
Line 68... Line -...
68
 
-
 
69
        mov     esp, [ss:CURRENT_TASK]
-
 
70
        shl     esp, 8
-
 
71
        mov     esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack]
-
 
72
        add     esp, RING0_STACK_SIZE           ; configure ESP
71
 
73
	sti
72
	sti
74
	;------------------
73
	;------------------
75
	push	ds es
74
	push	ds es
76
	pushad
75
	pushad
Line 104... Line 103...
104
;;                     SYSCALL ENTRY                          ;;
103
;;                     SYSCALL ENTRY                          ;;
105
;;                                                            ;;
104
;;                                                            ;;
106
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
105
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107
align 32
106
align 32
108
syscall_entry:
107
syscall_entry:
-
 
108
 
109
  ;     cli                 syscall clear IF
109
  ;     cli                 syscall clear IF
-
 
110
        xchg    esp, [ss:CURRENT_RING0_ESP]
-
 
111
        push    ecx
110
	xchg	ecx, [esp]
112
        lea     ecx, [esp+4]
-
 
113
        xchg    ecx, [ss:CURRENT_RING0_ESP]
-
 
114
        sti
-
 
115
        push    ecx
111
	mov	[SYSENTER_VAR + 4], esp
116
        mov     ecx, [ecx]
Line 112... Line 117...
112
 
117
 
113
  ;      mov     [ss:sysenter_stack - 4], eax
118
  ;      mov     [ss:sysenter_stack - 4], eax
114
  ;      mov     eax, [ss:CURRENT_TASK]
119
  ;      mov     eax, [ss:CURRENT_TASK]
115
  ;      shl     eax, 8
120
  ;      shl     eax, 8
116
  ;      mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
121
  ;      mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
117
  ;      lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
122
  ;      lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
Line 118... Line -...
118
  ;      mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
-
 
119
 
-
 
120
        mov     esp, [ss:CURRENT_TASK]
-
 
121
        shl     esp, 8
-
 
122
        mov     esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack]
-
 
123
        add     esp, RING0_STACK_SIZE             ; configure ESP
-
 
124
 
123
  ;      mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
125
	sti
124
 
126
	;------------------
125
	;------------------
127
	push	ds es
126
	push	ds es
Line 146... Line 145...
146
 
145
 
147
	popad
146
	popad
148
	pop	es ds
147
	pop	es ds
Line 149... Line -...
149
	;------------------
-
 
150
 
148
	;------------------
151
        cli
149
 
152
	mov	esp, [SYSENTER_VAR + 4]
150
        mov     ecx, [ss:esp+4]
-
 
151
        pop     esp
153
	xchg	ecx, [esp]
152
        sysret
154
	sysret
153
 
155
iglobal
154
iglobal
156
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
155
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;