Rev 5376 | Rev 7276 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5376 | Rev 5788 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 5376 $ |
8 | $Revision: 5788 $ |
9 | 9 | ||
10 | 10 | ||
Line 11... | Line 11... | ||
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;; IRQ0 HANDLER (TIMER INTERRUPT) ;; |
12 | ;; IRQ0 HANDLER (TIMER INTERRUPT) ;; |
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
14 | 14 | ||
- | 15 | ||
15 | 16 | align 32 |
|
16 | align 32 |
17 | irq0: |
17 | irq0: |
18 | pushad |
18 | pushad |
19 | mov ax, app_data |
19 | Mov ds, ax, app_data |
20 | mov ds, ax |
Line 99... | Line 100... | ||
99 | xchg esi, [current_slot] |
100 | xchg esi, [current_slot] |
100 | ; set new stack after saving old |
101 | ; set new stack after saving old |
101 | mov [esi+APPDATA.saved_esp], esp |
102 | mov [esi+APPDATA.saved_esp], esp |
102 | mov esp, [ebx+APPDATA.saved_esp] |
103 | mov esp, [ebx+APPDATA.saved_esp] |
103 | ; set new thread io-map |
104 | ; set new thread io-map |
- | 105 | mov eax, [ebx+APPDATA.io_map] |
|
104 | Mov dword [page_tabs+((tss._io_map_0 and -4096) shr 10)],eax,[ebx+APPDATA.io_map] |
106 | mov dword [page_tabs+((tss._io_map_0 and -4096) shr 10)], eax |
- | 107 | mov eax, [ebx+APPDATA.io_map+4] |
|
105 | Mov dword [page_tabs+((tss._io_map_1 and -4096) shr 10)],eax,[ebx+APPDATA.io_map+4] |
108 | mov dword [page_tabs+((tss._io_map_1 and -4096) shr 10)], eax |
106 | ; set new thread memory-map |
109 | ; set new thread memory-map |
107 | mov eax, [ebx+APPDATA.process] |
110 | mov eax, [ebx+APPDATA.process] |
108 | cmp eax, [current_process] |
111 | cmp eax, [current_process] |
109 | je @f |
112 | je @f |
110 | mov [current_process], eax |
113 | mov [current_process], eax |
111 | mov eax, [eax+PROC.pdt_0_phys] |
114 | mov eax, [eax+PROC.pdt_0_phys] |
112 | mov cr3, eax |
115 | mov cr3, eax |
113 | @@: |
116 | @@: |
114 | ; set tss.esp0 |
117 | ; set tss.esp0 |
Line 115... | Line 118... | ||
115 | 118 | ||
- | 119 | mov eax, [ebx+APPDATA.saved_esp0] |
|
Line 116... | Line 120... | ||
116 | Mov [tss._esp0],eax,[ebx+APPDATA.saved_esp0] |
120 | mov [tss._esp0], eax |
Line 117... | Line 121... | ||
117 | 121 | ||
118 | mov edx, [ebx+APPDATA.tls_base] |
122 | mov edx, [ebx+APPDATA.tls_base] |
Line 124... | Line 128... | ||
124 | 128 | ||
125 | mov dx, app_tls |
129 | mov dx, app_tls |
Line 126... | Line 130... | ||
126 | mov fs, dx |
130 | mov fs, dx |
127 | 131 | ||
- | 132 | ; set gs selector unconditionally |
|
128 | ; set gs selector unconditionally |
133 | Mov ax, graph_data |
129 | Mov gs,ax,graph_data |
134 | Mov gs, ax |
130 | ; set CR0.TS |
135 | ; set CR0.TS |
131 | cmp bh, byte[fpu_owner] ;bh == incoming task (new) |
136 | cmp bh, byte[fpu_owner] ;bh == incoming task (new) |
132 | clts ;clear a task switch flag |
137 | clts ;clear a task switch flag |