Subversion Repositories Kolibri OS

Rev

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

Rev 2050 Rev 2106
Line 112... Line 112...
112
    mov eax, edi
112
    mov eax, edi
113
    stosd
113
    stosd
114
    stosd
114
    stosd
115
    loop @B
115
    loop @B
Line 116... Line 116...
116
 
116
 
117
    mov ecx, 48
117
    mov ecx, 47
118
    mov eax, irqh_array+IRQH.sizeof
118
    mov eax, irqh_pool+IRQH.sizeof
Line 119... Line 119...
119
    mov [next_irqh], irqh_array
119
    mov [next_irqh], irqh_pool
120
 
120
 
121
@@:
121
@@:
122
    mov [eax-IRQH.sizeof], eax
122
    mov [eax-IRQH.sizeof], eax
Line 513... Line 513...
513
	; popa
513
	; popa
514
	; ret
514
	; ret
515
; endp
515
; endp
Line 516... Line -...
516
 
-
 
517
 
-
 
518
macro __list_add new, prev, next
-
 
519
{
-
 
520
    mov [next+LHEAD.prev], new
-
 
521
    mov [new+LHEAD.next], next
-
 
522
    mov [new+LHEAD.prev], prev
-
 
523
    mov [prev+LHEAD.next], new
-
 
524
}
-
 
525
 
-
 
526
macro list_add new, head
-
 
527
{
-
 
528
    mov eax, [head+LHEAD.next]
-
 
529
    __list_add new, head, eax
-
 
530
}
-
 
531
 
-
 
532
macro list_add_tail new, head
-
 
533
{
-
 
534
    mov eax, [head+LHEAD.prev]
-
 
Line 535... Line -...
535
    __list_add new, eax, head
-
 
536
}
-
 
537
 
-
 
538
 
-
 
539
align 4
-
 
540
proc attach_int_handler_ex stdcall, irq:dword, handler:dword, user_data:dword
-
 
541
         locals
-
 
542
           .irqh dd ?
-
 
543
         endl
-
 
544
 
-
 
545
         and [.irqh], 0
-
 
546
 
-
 
547
         push ebx
-
 
548
 
-
 
549
         mov  ebx, [irq]            ;irq num
-
 
550
         test ebx, ebx
-
 
551
         jz   .err
-
 
552
 
-
 
553
         cmp  ebx, IRQ_RESERVE
-
 
554
         jae  .err
-
 
555
 
-
 
556
         mov  edx, [handler]
-
 
557
         test edx, edx
-
 
558
         jz   .err
-
 
559
 
-
 
Line 560... Line -...
560
         pushfd
-
 
561
         cli
-
 
562
 
-
 
563
;allocate handler
-
 
564
 
-
 
565
         mov ecx, [next_irqh]
-
 
566
         test ecx, ecx
-
 
567
         jz .fail
-
 
568
 
-
 
569
         mov eax, [ecx]
-
 
570
         mov [next_irqh], eax
-
 
571
 
-
 
572
         mov [.irqh], ecx
-
 
573
 
-
 
574
         mov eax, [user_data]
-
 
575
         mov [ecx+IRQH.handler], edx
-
 
576
         mov [ecx+IRQH.data],    eax
-
 
577
 
-
 
578
         lea edx, [irqh_tab+ebx*8]
-
 
579
         list_add_tail ecx, edx     ;clobber eax
-
 
580
 
-
 
581
         stdcall enable_irq, [irq]
-
 
582
 
-
 
583
.fail:
-
 
584
         popfd
-
 
585
.err:
-