Subversion Repositories Kolibri OS

Rev

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

Rev 7733 Rev 8050
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2020. 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: 7733 $
8
$Revision: 8050 $
9
 
9
 
10
align 4 ;3A08
10
align 4 ;3A08
11
build_interrupt_table:
11
build_interrupt_table:
Line 102... Line 102...
102
 
102
 
103
uglobal
103
uglobal
104
  pf_err_code   dd ?
104
  pf_err_code   dd ?
Line 105... Line 105...
105
endg
105
endg
106
 
106
 
107
page_fault_exc:                 ; дуракоусточивость: селекторы испорчены...
107
page_fault_exc:                   ; foolproof: selectors are clobbered ...
108
        pop     [ss:pf_err_code]; действительно до следующего #PF
108
        pop     [ss:pf_err_code]  ; actually, until the next #PF
Line 109... Line 109...
109
        save_ring3_context
109
        save_ring3_context
110
        mov     bl, 14
110
        mov     bl, 14
111
 
111
 
112
exc_c:                          ; исключения (все, кроме 7-го - #NM)
112
exc_c:                            ; exceptions (all but 7th - #NM)
113
; Фрэйм стека при исключении/прерывании из 3-го кольца + pushad (т.е., именно здесь)
113
 ; stack frame when exception/interrupt from ring3 + pushad (i.e right here)
114
  reg_ss        equ esp+0x30
114
  reg_ss        equ esp+0x30
115
  reg_esp3      equ esp+0x2C
115
  reg_esp3      equ esp+0x2C
116
  reg_eflags    equ esp+0x28
116
  reg_eflags    equ esp+0x28
117
  reg_cs3       equ esp+0x24
117
  reg_cs3       equ esp+0x24
118
  reg_eip       equ esp+0x20
118
  reg_eip       equ esp+0x20
119
 ; это фрэйм от pushad
119
 ; this if frame from pushad
120
  reg_eax       equ esp+0x1C
120
  reg_eax       equ esp+0x1C
121
  reg_ecx       equ esp+0x18
121
  reg_ecx       equ esp+0x18
122
  reg_edx       equ esp+0x14
122
  reg_edx       equ esp+0x14
123
  reg_ebx       equ esp+0x10
123
  reg_ebx       equ esp+0x10
124
  reg_esp0      equ esp+0x0C
124
  reg_esp0      equ esp+0x0C
Line 125... Line 125...
125
  reg_ebp       equ esp+0x08
125
  reg_ebp       equ esp+0x08
126
  reg_esi       equ esp+0x04
126
  reg_esi       equ esp+0x04
127
  reg_edi       equ esp+0x00
127
  reg_edi       equ esp+0x00
128
 
128
 
129
        mov     ax, app_data        ;исключение
129
        mov     ax, app_data       ; exception
130
        mov     ds, ax                  ;загрузим правильные значения
130
        mov     ds, ax             ; load proper values
131
        mov     es, ax                  ;в регистры
131
        mov     es, ax             ; to registers
132
        cld                     ; и приводим DF к стандарту
132
        cld                        ; clear the destination flag
133
        movzx   ebx, bl
133
        movzx   ebx, bl
Line 363... Line 363...
363
 
363
 
Line 364... Line 364...
364
        pop     edx ecx eax
364
        pop     edx ecx eax
Line 365... Line -...
365
 
-
 
366
        ret
-
 
367
 
-
 
368
;  * eax = 64 - номер функции
-
 
369
;  * ebx = 1 - единственная подфункция
365
 
370
;  * ecx = новый размер памяти
-
 
371
;Возвращаемое значение:
-
 
372
;  * eax = 0 - успешно
366
        ret
373
;  * eax = 1 - недостаточно памяти
367
 
374
 
368
; sysfn 64 implementation
-
 
369
align 4
375
align 4
370
sys_resize_app_memory:
-
 
371
; in:   eax = 64 - function number
-
 
372
;       ebx = 1 - number of its only subfunction
-
 
373
;       ecx = new amount of memory
Line 376... Line 374...
376
sys_resize_app_memory:
374
; out:
377
        ; ebx = 1 - resize
375
;       eax = 0 - success
378
        ; ecx = new amount of memory
376
;       eax = 1 - out of memory