2014/06/25 5

[x86] Interrupt

ㅇ IO-APIC Interrupts - IO-APIC은 24개의 interrupt line을 가지고 있으며, priority를 설정할 수 있다.- 하위 16개의 interrupt 는 XT-PIC 과 backwards compatibility를 위해서 동작한다. - IO-APIC 은 Local-APIC에 interrupt vector를 씀. 따라서 OS는 IO-APIC과 interaction이 필요하지 않다.EOI를 Notification 할 때만 IO-APIC과 interaction 이 존재한다. interrupted CPU는 interrupt vector 를 받아서 ISR를 실행한다. ㅇ Message Signaled Interrupts- every device to write directly to ..

R&D/OS 2014.06.25

likely unlikely

Kernel 소스코드를 보면 likely, unlikely 라는 메크로를 자주 사용한다.이에 대한 설명이다. likely(), unlikely() 는 include/linux/compiler.h 에 정의된 macro 이다. 이것의 용도는 컴파일러에게 branch 예측을 도와 주는 용도로 사용이된다. 즉, 대부분 0으로 예측이 된다면 unlikely(x) 의 형태로 쓰고, 1로 예상되는 값을 likely(x) 로 쓴다.예측을 도와 줌으로써 성능의 향상을 볼 수 있도록 하는 것이다. #define likely(x) __builtin_expect(!!(x), 1)#define unlikely(x) __builtin_expect(!!(x), 0) http://kernelnewbies.org/FAQ/LikelyU..

R&D/OS 2014.06.25