cli() sti() 함수에 관한 질문입니다

czh의 이미지

리눅스에 대해서 아는것이라고는 거의 없고

이제 막 배우기 시작한 초보유저입니다.

cli 와 sti 에 대해 인터넷에서 찾아보다가

asm/system.h 에 정의 되있다는 글을 보고

system.h에 들어가보니 그런 함수는 없네요.

커널 버젼은 2.6입니다.

얼핏 봐서는 local_irq_enable() 이 비슷한 역활을 하는것 같은데요

맞는지 궁금합니다.

vacancy의 이미지

CLear Interrupt
SeT Interrupt 입니다.
인터럽트를 Disable/Enable하는 것이고요. ;;

pastime의 이미지

커널 2.6 의 <include/linux/interrupt.h> 에 define 되어 있습니다.
이전 버전과의 호환성을 위해 존재하며
앞으로는 local_irq_enable/disable() 을 직접 사용하는 편이 좋습니다.

50 /*
51  * Temporary defines for UP kernels, until all code gets fixed.
52  */
53 #ifndef CONFIG_SMP
54 # define cli()                  local_irq_disable()
55 # define sti()                  local_irq_enable()
56 # define save_flags(x)          local_save_flags(x)
57 # define restore_flags(x)       local_irq_restore(x)
58 # define save_and_cli(x)        local_irq_save(x)
59 #endif
czh의 이미지

예전 문서를 보고 공부를 하다보니

현재 커널과 틀린 부분이 조금씩 있네요

답변 감사합니다

junghwanz의 이미지

모든 interrupt에 대해서 disable, enable 입니다.

kyong의 이미지

junghwanz wrote:
모든 interrupt에 대해서 disable, enable 입니다.

2.6 버젼에서는 current processor에 대해서만 그렇습니다.