|
nckernel
0.1
|
인터럽트 관련 아키텍쳐 독립적 인터페이스 정의 More...
|
Macros | |
| #define | HIGH_PRIORITY 0x80000000 |
| IRQ 등록시 가장 높은 우선 순위로, 가장 먼저 실행 된다. More... | |
| #define | LOW_PRIORITY 0x7FFFFFFF |
| IRQ 등록시 가장 낮은 우선 순위로, 가장 나중에 실행 된다. More... | |
| #define | NORMAL_PRIORITY 0 |
| IRQ 등록시 일반 적인 우선 순위를 정의한다. More... | |
Functions | |
| void | disable_interrupt (void) |
| 인터럽트를 비활성화 시킨다. More... | |
| void | enable_interrupt (void) |
| 인터럽트를 활성화 시킨다. More... | |
| void | irq_local_restore (unsigned long value) |
| 주어진 인자의 값으로 인터럽트 상태를 복원한다. More... | |
| void | irq_local_save (unsigned long *value) |
| 주어진 인자에 현재 인터럽트 상태를 저장하고 인터럽트를 비활성화 시킨다. More... | |
| int | register_irq (int idx, int priority, int(*handler)(int, void *, void *), void *data) |
| 인터럽트 핸들러를 등록한다. More... | |
| int | unregister_irq (int idx, int(*handler)(int, void *, void *), void *data) |
| 등록된 인터럽트 핸들러를 제거한다. More... | |
인터럽트 관련 아키텍쳐 독립적 인터페이스 정의
데이터를 주고 받는 방법과 유사하게 어떤 변화나 이벤트에 대해서도 CPU 는 알아야 한다.
CPU 가 외부로 부터의 변화를 감지할 수 있는 방법은 외부 장치를 꾸준히 감시하는 방법과 외부 장치가 변화가 생겼을 때 CPU 에게 알려주는 방법이 있다.
전자처럼 꾸준히 감시하는 방법을 Polling 이라고 하며, 후자처럼 외부 장치가 변화를 CPU 에게 알려주는 방법을 인터럽트라 한다.
CPU 는 인터럽트가 발생하면 현재 하던일을 잠시 중단하고, Interrupt 발생 원인을 파악한 후 등록된 인터럽트 서비스 루틴을 실행시켜준다.
| #define HIGH_PRIORITY 0x80000000 |
IRQ 등록시 가장 높은 우선 순위로, 가장 먼저 실행 된다.
Definition at line 30 of file interrupt.h.
| #define LOW_PRIORITY 0x7FFFFFFF |
IRQ 등록시 가장 낮은 우선 순위로, 가장 나중에 실행 된다.
Definition at line 27 of file interrupt.h.
Referenced by arch_init().
| #define NORMAL_PRIORITY 0 |
IRQ 등록시 일반 적인 우선 순위를 정의한다.
Definition at line 33 of file interrupt.h.
Referenced by arch_init(), keyboard_init(), main(), and serial_open().
| void disable_interrupt | ( | void | ) |
인터럽트를 비활성화 시킨다.
Definition at line 15 of file interrupt.c.
| void enable_interrupt | ( | void | ) |
인터럽트를 활성화 시킨다.
Definition at line 10 of file interrupt.c.
| void irq_local_restore | ( | unsigned long | value) |
주어진 인자의 값으로 인터럽트 상태를 복원한다.
| [in] | value | 저장된 인터럽트 상태값. |
Definition at line 26 of file interrupt.c.
Referenced by brk(), dma_init(), free(), malloc(), posix_memalign(), pthread_cancel(), pthread_mutex_lock(), pthread_mutex_trylock(), pthread_mutex_unlock(), register_irq(), sbrk(), sem_post(), sem_trywait(), sem_wait(), and unregister_irq().

| void irq_local_save | ( | unsigned long * | value) |
주어진 인자에 현재 인터럽트 상태를 저장하고 인터럽트를 비활성화 시킨다.
| [in] | value | 저장할 변수 |
Definition at line 20 of file interrupt.c.
Referenced by brk(), dma_init(), free(), malloc(), posix_memalign(), pthread_cancel(), pthread_mutex_lock(), pthread_mutex_trylock(), pthread_mutex_unlock(), register_irq(), sbrk(), sem_post(), sem_trywait(), sem_wait(), and unregister_irq().

| int register_irq | ( | int | idx, |
| int | priority, | ||
| int(*)(int, void *, void *) | handler, | ||
| void * | data | ||
| ) |
인터럽트 핸들러를 등록한다.
| [in] | idx | 인터럽트 번호 |
| [in] | priority | 인터럽트 처리 우선 순위 |
| [in] | handler | 핸들러 포인터 |
| [in] | data | 인터럽트 핸들러에 전달할 인자 |
Insertion sorting
Definition at line 43 of file isr.c.
References list::cnt, irq_handler::data, ENOMEM, free(), irq_handler::handler, list::head, irq_handler::head, list::idx, irq_local_restore(), irq_local_save(), list::list, list_entry, list_for_each, malloc(), list::max_priority, NULL, and irq_handler::priority.
Referenced by arch_init(), keyboard_init(), main(), and serial_open().


| int unregister_irq | ( | int | idx, |
| int(*)(int, void *, void *) | handler, | ||
| void * | data | ||
| ) |
등록된 인터럽트 핸들러를 제거한다.
| [in] | idx | 인터럽트 번호 |
| [in] | handler | 핸들러 포인터 |
| [in] | data | 인터럽트 핸들러에 전달되던 인자 |
Definition at line 106 of file isr.c.
References list::cnt, irq_handler::data, ENOENT, free(), irq_handler::handler, list::head, irq_handler::head, list::idx, irq_local_restore(), irq_local_save(), list::list, list_entry, list_for_each_safe, and NULL.
Referenced by arch_init(), keyboard_init(), and serial_close().


1.8.4