/kernel/branches/Kolibri-acpi/core/apic.inc |
---|
575,17 → 575,6 |
mov [ecx+IRQH.handler], edx |
mov [ecx+IRQH.data], eax |
mov eax, [irqh_set] |
bt [pci_irq_set], ebx ;check irq type |
jc .pci_irq |
.isa_irq: |
bts eax, ebx ;check for installed handler |
jc .fail |
.set_handler: |
mov [irqh_set], eax |
lea edx, [irqh_tab+ebx*8] |
list_add_tail ecx, edx ;clobber eax |
598,9 → 587,4 |
mov eax, [.irqh] |
ret |
.pci_irq: |
bts ecx, ebx ;check for installed handler |
jmp .set_handler |
endp |
/kernel/branches/Kolibri-acpi/core/dll.inc |
---|
14,50 → 14,7 |
DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT |
PID_KERNEL equ 1 ;os_idle thread |
align 4 |
proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword |
pushfd |
cli |
push ebx |
mov ebx, [irq] ;irq num |
test ebx, ebx |
jz .err |
cmp ebx, [IRQ_COUNT] ; hidnplayr says: we only have 16 IRQ's |
; Ghost says: we can have more... |
jae .err |
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 IRQ_RESERVE |
115,42 → 72,70 |
align 16 |
.main: |
save_ring3_context |
mov eax, [esp + 32] |
mov ebp, [esp + 32] |
mov bx, app_data ;os_data |
mov ds, bx |
mov es, bx |
cmp [v86_irqhooks+eax*8], 0 |
cmp [v86_irqhooks+ebp*8], 0 |
jnz v86_irq |
cmp al, 6 |
cmp bp, 6 |
jnz @f |
push eax |
push ebp |
call [fdc_irq_func] |
pop eax |
pop ebp |
@@: |
cmp al, 14 |
cmp bp, 14 |
jnz @f |
push eax |
push ebp |
call [irq14_func] |
pop eax |
pop ebp |
@@: |
cmp al, 15 |
cmp bp, 15 |
jnz @f |
push eax |
push ebp |
call [irq15_func] |
pop eax |
pop ebp |
@@: |
bts [pending_irq_set], ebp |
mov ebx, [irq_tab+eax*4] |
test ebx, ebx |
jz .exit |
lea esi, [irqh_tab+ebp*8] ; esi= list head |
mov ebx, esi |
.next: |
mov ebx, [ebx+IRQH.list.next] ; ebx= irqh pointer |
cmp ebx, esi |
je .done |
call ebx |
push ebx ; FIX THIS |
push edi |
push esi |
push [ebx+IRQH.data] |
call [ebx+IRQH.handler] |
add esp, 4 |
pop esi |
pop edi |
pop ebx |
test eax, eax |
jz .next |
btr [pending_irq_set], ebp |
jmp .next |
.done: |
btr [pending_irq_set], ebp |
jnc .exit |
inc [bogus_irq+ebp*4] |
.exit: |
mov [check_idle_semaphore],5 |
.exit: mov eax, [esp + 32] |
mov eax, ebp |
call IRQ_EOI |
restore_ring3_context |
add esp, 4 |
/kernel/branches/Kolibri-acpi/core/exports.inc |
---|
91,7 → 91,7 |
dd szRegService , reg_service |
dd szGetService , get_service |
dd szServiceHandler , srv_handler |
dd szAttachIntHandler, attach_int_handler |
dd szAttachIntHandler, attach_int_handler_ex |
dd szGetIntHandler , get_int_handler |
dd szFpuSave , fpu_save |
dd szFpuRestore , fpu_restore |
/kernel/branches/Kolibri-acpi/core/peload.inc |
---|
316,7 → 316,7 |
\ |
get_service, 'GetService', \ ; |
reg_service, 'RegService', \ ; stdcall |
attach_int_handler, 'AttachIntHandler', \ ; stdcall |
attach_int_handler_ex, 'AttachIntHandler', \ ; stdcall |
user_alloc, 'UserAlloc', \ ; stdcall |
user_free, 'UserFree', \ ; stdcall |
unmap_pages, 'UnmapPages', \ ; eax, ecx |
/kernel/branches/Kolibri-acpi/data32.inc |
---|
274,8 → 274,12 |
irqh_tab rd LHEAD.sizeof * IRQ_RESERVE / 4 |
irqh_array rd IRQH.sizeof *48 /4 |
bogus_irq rd IRQ_RESERVE |
next_irqh rd 1 |
pending_irq_set rd 1 |
align 16 |
mem_block_map rb 512 |
mem_block_list rd 64 |
large_block_list rd 31 |
306,9 → 310,6 |
srv.fd rd 1 |
srv.bk rd 1 |
irqh_set rd 1 |
pci_irq_set rd 1 |
align 16 |
_display display_t |
/kernel/branches/Kolibri-acpi/kernel.asm |
---|
992,33 → 992,11 |
jne .bll1 |
end if |
; UNMASK ALL IRQ'S |
; mov esi,boot_allirqs |
; call boot_log |
; |
; cli ;guarantee forbidance of interrupts. |
; mov al,0 ; unmask all irq's |
; out 0xA1,al |
; out 0x21,al |
; |
; mov ecx,32 |
; |
; ready_for_irqs: |
; |
; mov al,0x20 ; ready for irqs |
; out 0x20,al |
; out 0xa0,al |
; |
; loop ready_for_irqs ; flush the queue |
cli ;guarantee forbidance of interrupts. |
stdcall enable_irq, 2 ; @#$%! PIC |
stdcall enable_irq, 6 ; FDD |
stdcall enable_irq, 13 ; co-processor |
stdcall attach_int_handler_ex, 1, irq1, 0 |
; mov [dma_hdd],1 |
cmp [IDEContrRegsBaseAddr], 0 |
setnz [dma_hdd] |
mov [timer_ticks_enable],1 ; for cd driver |
3789,7 → 3767,7 |
mov ebx, [f_irqs + 4 * eax] |
stdcall attach_int_handler, eax, ebx, dword 0 |
stdcall attach_int_handler_ex, eax, ebx, dword 0 |
mov [ecx], edi |