2007-03-26 14:18:08 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2010-08-25 09:44:39 +02:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
|
2007-03-26 14:18:08 +02:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2007-07-27 15:52:03 +02:00
|
|
|
|
$Revision$
|
|
|
|
|
|
2007-11-13 00:08:54 +01:00
|
|
|
|
; Old style system call converter
|
|
|
|
|
align 16
|
|
|
|
|
cross_order:
|
2009-03-28 19:36:41 +01:00
|
|
|
|
; load all registers in crossed order
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
mov ebx, ecx
|
|
|
|
|
mov ecx, edx
|
|
|
|
|
mov edx, esi
|
|
|
|
|
mov esi, edi
|
|
|
|
|
movzx edi, byte[esp+28 + 4]
|
2010-08-25 09:44:39 +02:00
|
|
|
|
sub edi,53
|
2009-03-28 19:36:41 +01:00
|
|
|
|
call dword [servetable+edi*4]
|
|
|
|
|
ret
|
2007-11-13 00:08:54 +01:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2009-03-28 19:36:41 +01:00
|
|
|
|
;; SYSENTER ENTRY ;;
|
2005-10-06 19:56:22 +02:00
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2005-10-13 19:50:36 +02:00
|
|
|
|
|
2009-03-28 19:36:41 +01:00
|
|
|
|
align 32
|
|
|
|
|
sysenter_entry:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esp, [ss:tss._esp0]
|
|
|
|
|
sti
|
|
|
|
|
push ebp ; save app esp + 4
|
|
|
|
|
mov ebp, [ebp] ; ebp - original ebp
|
|
|
|
|
;------------------
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
;------------------
|
|
|
|
|
xchg ecx, [ss:esp] ; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - app ecx, ecx - app esp + 4
|
|
|
|
|
sub ecx, 4
|
|
|
|
|
xchg edx, [ecx] ; edx - return point, & save original edx
|
|
|
|
|
push edx
|
|
|
|
|
mov edx, [ss:esp + 4]
|
|
|
|
|
mov [ecx + 4], edx ; save original ecx
|
|
|
|
|
pop edx
|
|
|
|
|
sysexit
|
2007-11-13 00:08:54 +01:00
|
|
|
|
|
2007-02-25 15:20:50 +01:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2009-03-28 19:36:41 +01:00
|
|
|
|
;; SYSTEM CALL ENTRY ;;
|
2007-02-25 15:20:50 +01:00
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2009-03-28 19:36:41 +01:00
|
|
|
|
align 16
|
|
|
|
|
i40:
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
|
|
|
|
popad
|
|
|
|
|
iretd
|
2007-02-25 15:20:50 +01:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; SYSCALL ENTRY ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
align 32
|
|
|
|
|
syscall_entry:
|
2007-03-10 17:04:35 +01:00
|
|
|
|
; cli syscall clear IF
|
2009-03-28 19:36:41 +01:00
|
|
|
|
xchg esp, [ss:tss._esp0]
|
|
|
|
|
push ecx
|
|
|
|
|
lea ecx, [esp+4]
|
|
|
|
|
xchg ecx, [ss:tss._esp0]
|
|
|
|
|
sti
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, [ecx]
|
|
|
|
|
;------------------
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
2007-02-25 15:20:50 +01:00
|
|
|
|
|
2009-03-28 19:36:41 +01:00
|
|
|
|
popad
|
|
|
|
|
;------------------
|
|
|
|
|
mov ecx, [ss:esp+4]
|
|
|
|
|
pop esp
|
|
|
|
|
sysret
|
2007-02-25 15:20:50 +01:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
iglobal
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; SYSTEM FUNCTIONS TABLE ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
servetable:
|
2008-11-30 20:04:25 +01:00
|
|
|
|
dd socket ; 53-Socket interface
|
2008-02-17 14:31:28 +01:00
|
|
|
|
dd 0
|
2010-06-15 19:30:28 +02:00
|
|
|
|
dd 0
|
2008-02-17 14:31:28 +01:00
|
|
|
|
dd 0
|
2010-01-11 18:11:43 +01:00
|
|
|
|
dd 0
|
2008-11-30 20:04:25 +01:00
|
|
|
|
dd file_system ; 58-Common file system interface
|
2008-02-17 14:31:28 +01:00
|
|
|
|
dd 0
|
2010-06-15 19:30:28 +02:00
|
|
|
|
dd 0
|
2010-06-16 17:56:03 +02:00
|
|
|
|
dd 0
|
2010-08-25 09:44:39 +02:00
|
|
|
|
dd 0 ; 62-PCI functions
|
2008-11-30 20:04:25 +01:00
|
|
|
|
dd sys_msg_board ; 63-System message board
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-11-13 00:08:54 +01:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; NEW SYSTEM FUNCTIONS TABLE ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
align 4
|
|
|
|
|
servetable2:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2010-02-06 20:08:19 +01:00
|
|
|
|
dd syscall_draw_window ; 0-DrawWindow
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd syscall_setpixel ; 1-SetPixel
|
|
|
|
|
dd sys_getkey ; 2-GetKey
|
|
|
|
|
dd sys_clock ; 3-GetTime
|
|
|
|
|
dd syscall_writetext ; 4-WriteText
|
|
|
|
|
dd delay_hs ; 5-DelayHs
|
2007-12-17 12:04:07 +01:00
|
|
|
|
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd syscall_putimage ; 7-PutImage
|
2009-12-27 19:37:14 +01:00
|
|
|
|
dd syscall_button ; 8-DefineButton
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd sys_cpuusage ; 9-GetProcessInfo
|
|
|
|
|
dd sys_waitforevent ; 10-WaitForEvent
|
|
|
|
|
dd sys_getevent ; 11-CheckForEvent
|
|
|
|
|
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
|
|
|
|
dd syscall_drawrect ; 13-DrawRect
|
2009-03-28 19:36:41 +01:00
|
|
|
|
dd syscall_getscreensize ; 14-GetScreenSize
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd sys_background ; 15-bgr
|
2009-03-28 19:36:41 +01:00
|
|
|
|
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd sys_getbutton ; 17-GetButton
|
|
|
|
|
dd sys_system ; 18-System Services
|
|
|
|
|
dd paleholder ; 19-reserved
|
2009-11-20 03:36:08 +01:00
|
|
|
|
dd sys_midi ; 20-ResetMidi and OutputMidi
|
|
|
|
|
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
2009-11-20 19:50:43 +01:00
|
|
|
|
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
2007-11-13 00:08:54 +01:00
|
|
|
|
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
2009-11-28 06:56:54 +01:00
|
|
|
|
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
2008-06-09 14:12:09 +02:00
|
|
|
|
dd undefined_syscall ; 25-reserved
|
2009-11-20 03:36:08 +01:00
|
|
|
|
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd undefined_syscall ; 27-reserved
|
2008-06-09 14:12:09 +02:00
|
|
|
|
dd undefined_syscall ; 28-reserved
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd sys_date ; 29-GetDate
|
2009-12-02 18:10:46 +01:00
|
|
|
|
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd undefined_syscall ; 31-reserved
|
|
|
|
|
dd undefined_syscall ; 32-reserved
|
|
|
|
|
dd undefined_syscall ; 33-reserved
|
|
|
|
|
dd undefined_syscall ; 34-reserved
|
|
|
|
|
dd syscall_getpixel ; 35-GetPixel
|
|
|
|
|
dd syscall_getarea ; 36-GetArea
|
2009-11-28 06:56:54 +01:00
|
|
|
|
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd syscall_drawline ; 38-DrawLine
|
2009-12-02 18:10:46 +01:00
|
|
|
|
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd set_app_param ; 40-WantEvents
|
2009-03-28 19:36:41 +01:00
|
|
|
|
dd syscall_getirqowner ; 41-GetIrqOwner
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd get_irq_data ; 42-ReadIrqData
|
2009-12-02 18:10:46 +01:00
|
|
|
|
dd sys_outport ; 43-SendDeviceData
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd sys_programirq ; 44-ProgramIrqs
|
|
|
|
|
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
2009-12-03 19:48:41 +01:00
|
|
|
|
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
2010-01-08 13:39:50 +01:00
|
|
|
|
dd display_number ; 47-WriteNum
|
2010-01-05 02:28:11 +01:00
|
|
|
|
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType
|
2009-12-24 18:12:36 +01:00
|
|
|
|
dd sys_apm ; 49-Advanced Power Management (APM)
|
2010-01-08 13:39:50 +01:00
|
|
|
|
dd syscall_set_window_shape ; 50-Window shape & scale
|
|
|
|
|
dd syscall_threads ; 51-Threads
|
|
|
|
|
dd stack_driver_stat ; 52-Stack driver status
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd cross_order ; 53-Socket interface
|
|
|
|
|
dd undefined_syscall ; 54-reserved
|
2010-06-15 19:30:28 +02:00
|
|
|
|
dd sound_interface ; 55-Sound interface
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd undefined_syscall ; 56-reserved
|
2010-01-11 18:11:43 +01:00
|
|
|
|
dd sys_pcibios ; 57-PCI BIOS32
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd cross_order ; 58-Common file system interface
|
|
|
|
|
dd undefined_syscall ; 59-reserved
|
2010-06-15 19:30:28 +02:00
|
|
|
|
dd sys_IPC ; 60-Inter Process Communication
|
2010-06-16 17:56:03 +02:00
|
|
|
|
dd sys_gs ; 61-Direct graphics access
|
2010-08-25 09:44:39 +02:00
|
|
|
|
dd pci_api ;cross_order ; 62-PCI functions
|
2008-11-17 13:04:16 +01:00
|
|
|
|
dd cross_order ; 63-System message board
|
2009-12-03 19:48:41 +01:00
|
|
|
|
dd sys_resize_app_memory ; 64-Resize application memory usage
|
2010-06-14 04:41:44 +02:00
|
|
|
|
dd sys_putimage_palette ; 65-PutImagePalette
|
2010-06-13 19:12:43 +02:00
|
|
|
|
dd sys_process_def ; 66-Process definitions - keyboard
|
2010-02-06 20:08:19 +01:00
|
|
|
|
dd syscall_move_window ; 67-Window move or resize
|
2010-01-02 06:49:10 +01:00
|
|
|
|
dd f68 ; 68-Some internal services
|
2009-12-23 19:43:42 +01:00
|
|
|
|
dd sys_debug_services ; 69-Debug
|
2010-06-11 16:07:06 +02:00
|
|
|
|
dd file_system_lfn ; 70-Common file system interface, version 2
|
2010-02-06 20:08:19 +01:00
|
|
|
|
dd syscall_window_settings ; 71-Window settings
|
2009-03-28 19:36:41 +01:00
|
|
|
|
dd sys_sendwindowmsg ; 72-Send window message
|
2011-03-01 07:08:11 +01:00
|
|
|
|
dd blit_32 ; blitter;
|
2009-03-28 19:36:41 +01:00
|
|
|
|
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
|
|
|
|
dd sys_end ; -1-end application
|
2008-06-09 14:12:09 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
endg
|