/kernel/trunk/core/dll.inc |
---|
9,7 → 9,7 |
DRV_COMPAT equ 5 ;minimal required drivers version |
DRV_CURRENT equ 5 ;current drivers model version |
DRV_CURRENT equ 6 ;current drivers model version |
DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT |
PID_KERNEL equ 1 ;os_idle thread |
17,6 → 17,9 |
align 4 |
proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword |
pushfd |
cli |
push ebx |
mov ebx, [irq] ;irq num |
27,51 → 30,26 |
mov eax, [handler] |
test eax, eax |
jz .err |
cmp [irq_owner + 4 * ebx], 0 |
je @f |
mov ecx, [irq_rights + 4 * ebx] ; Rights : 0 - full access, 1 - read only, 2 - forbidden |
test ecx, ecx |
jnz .err |
@@: |
mov [irq_tab+ebx*4], eax |
mov eax, [access_rights] |
mov [irq_rights + 4 * ebx], eax |
mov [irq_owner + 4 * ebx], PID_KERNEL ; all handlers belong to a kernel |
stdcall enable_irq, [irq] |
pop ebx |
mov eax, 1 |
popfd |
ret |
.err: |
pop ebx |
xor eax, eax |
popfd |
ret |
endp |
uglobal |
irq_rights rd 16 |
endg |
proc get_int_handler stdcall, irq:dword |
mov eax, [irq] |
cmp [irq_rights + 4 * eax], dword 1 |
ja .err |
mov eax, [irq_tab + 4 * eax] |
ret |
.err: |
xor eax, eax |
ret |
endp |
align 4 |
/kernel/trunk/core/sys32.inc |
---|
675,25 → 675,6 |
and [bgrlock], 0 |
@@: |
pusha ; remove all irq reservations |
mov eax,esi |
shl eax, 5 |
mov eax,[eax+CURRENT_TASK+TASKDATA.pid] |
mov edi,irq_owner |
xor ebx, ebx |
xor edx, edx |
newirqfree: |
cmp [edi + 4 * ebx], eax |
jne nofreeirq |
mov [edi + 4 * ebx], edx ; remove irq reservation |
mov [irq_tab + 4 * ebx], edx ; remove irq handler |
mov [irq_rights + 4 * ebx], edx ; set access rights to full access |
nofreeirq: |
inc ebx |
cmp ebx, 16 |
jb newirqfree |
popa |
pusha ; remove all port reservations |
mov edx,esi |
shl edx, 5 |
/kernel/trunk/core/syscall.inc |
---|
161,11 → 161,11 |
dd syscall_drawline ; 38-DrawLine |
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,. |
dd set_app_param ; 40-WantEvents |
dd syscall_getirqowner ; 41-GetIrqOwner |
dd get_irq_data ; 42-ReadIrqData |
dd undefined_syscall ; 41- deprecated GetIrqOwner |
dd undefined_syscall ; 42- deprecated ReadIrqData |
dd sys_outport ; 43-SendDeviceData |
dd sys_programirq ; 44-ProgramIrqs |
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq |
dd undefined_syscall ; 44- deprecated ProgramIrqs |
dd undefined_syscall ; 45- deprecated ReserveIrq and FreeIrq |
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea |
dd display_number ; 47-WriteNum |
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType |