Rev 4199 | Rev 5363 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
2455 | mario79 | 3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
2288 | clevermous | 4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
7 | |||
8 | $Revision: 4273 $ |
||
9 | |||
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
11 | ;; ;; |
||
12 | ;; SYSENTER ENTRY ;; |
||
13 | ;; ;; |
||
14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
15 | |||
16 | align 32 |
||
17 | sysenter_entry: |
||
3539 | clevermous | 18 | ; Настраиваем стек |
2288 | clevermous | 19 | mov esp, [ss:tss._esp0] |
20 | sti |
||
21 | push ebp ; save app esp + 4 |
||
22 | mov ebp, [ebp] ; ebp - original ebp |
||
23 | ;------------------ |
||
24 | pushad |
||
25 | cld |
||
26 | |||
3303 | clevermous | 27 | call protect_from_terminate |
28 | |||
29 | movzx eax, byte [esp+28] |
||
3304 | clevermous | 30 | mov edx, dword [esp+20] |
2288 | clevermous | 31 | call dword [servetable2 + eax * 4] |
32 | |||
3303 | clevermous | 33 | call unprotect_from_terminate |
2288 | clevermous | 34 | popad |
35 | ;------------------ |
||
3539 | clevermous | 36 | xchg ecx, [ss:esp] ; в вершин стека - app ecx, ecx - app esp + 4 |
2288 | clevermous | 37 | sub ecx, 4 |
38 | xchg edx, [ecx] ; edx - return point, & save original edx |
||
39 | push edx |
||
40 | mov edx, [ss:esp + 4] |
||
41 | mov [ecx + 4], edx ; save original ecx |
||
42 | pop edx |
||
43 | sysexit |
||
44 | |||
45 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
46 | ;; ;; |
||
47 | ;; SYSTEM CALL ENTRY ;; |
||
48 | ;; ;; |
||
49 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
50 | |||
51 | align 16 |
||
52 | i40: |
||
53 | pushad |
||
54 | cld |
||
3303 | clevermous | 55 | call protect_from_terminate |
56 | movzx eax, byte [esp+28] |
||
3304 | clevermous | 57 | mov edx, dword [esp+20] |
2288 | clevermous | 58 | call dword [servetable2 + eax * 4] |
3303 | clevermous | 59 | call unprotect_from_terminate |
2288 | clevermous | 60 | popad |
61 | iretd |
||
62 | |||
63 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
64 | ;; ;; |
||
65 | ;; SYSCALL ENTRY ;; |
||
66 | ;; ;; |
||
67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
68 | align 32 |
||
69 | syscall_entry: |
||
70 | ; cli syscall clear IF |
||
71 | xchg esp, [ss:tss._esp0] |
||
72 | push ecx |
||
73 | lea ecx, [esp+4] |
||
74 | xchg ecx, [ss:tss._esp0] |
||
75 | sti |
||
76 | push ecx |
||
77 | mov ecx, [ecx] |
||
78 | ;------------------ |
||
79 | pushad |
||
80 | cld |
||
3303 | clevermous | 81 | call protect_from_terminate |
2288 | clevermous | 82 | |
3303 | clevermous | 83 | movzx eax, byte [esp+28] |
3304 | clevermous | 84 | mov edx, dword [esp+20] |
2288 | clevermous | 85 | call dword [servetable2 + eax * 4] |
86 | |||
3303 | clevermous | 87 | call unprotect_from_terminate |
2288 | clevermous | 88 | popad |
89 | ;------------------ |
||
90 | mov ecx, [ss:esp+4] |
||
91 | pop esp |
||
92 | sysret |
||
93 | |||
94 | iglobal |
||
95 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
96 | ;; SYSTEM FUNCTIONS TABLE ;; |
||
97 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
98 | align 4 |
||
99 | servetable2: |
||
100 | |||
101 | dd syscall_draw_window ; 0-DrawWindow |
||
102 | dd syscall_setpixel ; 1-SetPixel |
||
103 | dd sys_getkey ; 2-GetKey |
||
104 | dd sys_clock ; 3-GetTime |
||
105 | dd syscall_writetext ; 4-WriteText |
||
3303 | clevermous | 106 | dd delay_hs_unprotected ; 5-DelayHs |
4273 | clevermous | 107 | dd undefined_syscall ; 6-deprecated OpenRamdiskFile |
2288 | clevermous | 108 | dd syscall_putimage ; 7-PutImage |
109 | dd syscall_button ; 8-DefineButton |
||
110 | dd sys_cpuusage ; 9-GetProcessInfo |
||
111 | dd sys_waitforevent ; 10-WaitForEvent |
||
112 | dd sys_getevent ; 11-CheckForEvent |
||
113 | dd sys_redrawstat ; 12-BeginDraw and EndDraw |
||
114 | dd syscall_drawrect ; 13-DrawRect |
||
115 | dd syscall_getscreensize ; 14-GetScreenSize |
||
116 | dd sys_background ; 15-bgr |
||
117 | dd sys_cachetodiskette ; 16-FlushFloppyCache |
||
118 | dd sys_getbutton ; 17-GetButton |
||
119 | dd sys_system ; 18-System Services |
||
120 | dd paleholder ; 19-reserved |
||
121 | dd sys_midi ; 20-ResetMidi and OutputMidi |
||
122 | dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,. |
||
123 | dd sys_settime ; 22-setting date,time,clock and alarm-clock |
||
124 | dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent |
||
125 | dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist |
||
2509 | mario79 | 126 | dd syscall_putarea_backgr ; 25-Put Area to background |
2288 | clevermous | 127 | dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. |
128 | dd undefined_syscall ; 27-reserved |
||
129 | dd undefined_syscall ; 28-reserved |
||
130 | dd sys_date ; 29-GetDate |
||
131 | dd sys_current_directory ; 30-Get/SetCurrentDirectory |
||
132 | dd undefined_syscall ; 31-reserved |
||
133 | dd undefined_syscall ; 32-reserved |
||
134 | dd undefined_syscall ; 33-reserved |
||
2511 | mario79 | 135 | dd syscall_getpixel_WinMap ; 34-GetPixel WinMap |
2288 | clevermous | 136 | dd syscall_getpixel ; 35-GetPixel |
137 | dd syscall_getarea ; 36-GetArea |
||
138 | dd readmousepos ; 37-GetMousePosition_ScreenRelative,. |
||
139 | dd syscall_drawline ; 38-DrawLine |
||
140 | dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,. |
||
141 | dd set_app_param ; 40-WantEvents |
||
142 | dd undefined_syscall ; 41- deprecated GetIrqOwner |
||
143 | dd undefined_syscall ; 42- deprecated ReadIrqData |
||
144 | dd sys_outport ; 43-SendDeviceData |
||
145 | dd undefined_syscall ; 44- deprecated ProgramIrqs |
||
146 | dd undefined_syscall ; 45- deprecated ReserveIrq and FreeIrq |
||
147 | dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea |
||
148 | dd display_number ; 47-WriteNum |
||
149 | dd syscall_display_settings ; 48-SetRedrawType and SetButtonType |
||
150 | dd sys_apm ; 49-Advanced Power Management (APM) |
||
151 | dd syscall_set_window_shape ; 50-Window shape & scale |
||
152 | dd syscall_threads ; 51-Threads |
||
3837 | mario79 | 153 | dd undefined_syscall ; 52- deprecated Stack driver status |
154 | dd undefined_syscall ; 53- deprecated Socket interface |
||
4199 | mario79 | 155 | dd sys_clipboard ; 54-Custom clipboard |
2288 | clevermous | 156 | dd sound_interface ; 55-Sound interface |
157 | dd undefined_syscall ; 56-reserved |
||
158 | dd sys_pcibios ; 57-PCI BIOS32 |
||
4273 | clevermous | 159 | dd undefined_syscall ; 58-deprecated Common file system interface |
2288 | clevermous | 160 | dd undefined_syscall ; 59-reserved |
161 | dd sys_IPC ; 60-Inter Process Communication |
||
162 | dd sys_gs ; 61-Direct graphics access |
||
3614 | shikhin | 163 | dd pci_api ; 62-PCI functions |
164 | dd sys_msg_board ; 63-System message board |
||
2288 | clevermous | 165 | dd sys_resize_app_memory ; 64-Resize application memory usage |
166 | dd sys_putimage_palette ; 65-PutImagePalette |
||
167 | dd sys_process_def ; 66-Process definitions - keyboard |
||
168 | dd syscall_move_window ; 67-Window move or resize |
||
169 | dd f68 ; 68-Some internal services |
||
170 | dd sys_debug_services ; 69-Debug |
||
3303 | clevermous | 171 | dd file_system_lfn ; 70-Common file system interface, version 2 |
2288 | clevermous | 172 | dd syscall_window_settings ; 71-Window settings |
173 | dd sys_sendwindowmsg ; 72-Send window message |
||
174 | dd blit_32 ; 73-blitter; |
||
3545 | hidnplayr | 175 | dd sys_network ; 74-reserved for new stack |
176 | dd sys_socket ; 75-reserved for new stack |
||
177 | dd sys_protocols ; 76-reserved for new stack |
||
2288 | clevermous | 178 | times 255 - ( ($-servetable2) /4 ) dd undefined_syscall |
179 | dd sys_end ; -1-end application |
||
180 | |||
181 | endg |