저는 리눅스 커널을 처음 접했습니다. 그리고 스파 스 도구를 사용하여 코드에있는 노이즈를 제거합니다. 다음 매크로를 발견했습니다 :linux/compiler.h 파일에 정의 된 사전 처리기 매크로의 용도는 무엇입니까?
# define __user __attribute__((noderef, address_space(1)))
# define __kernel __attribute__((address_space(0)))
# define __safe __attribute__((safe))
# define __force __attribute__((force))
# define __nocast __attribute__((nocast))
# define __iomem __attribute__((noderef, address_space(2)))
# define __must_hold(x) __attribute__((context(x,1,1)))
# define __acquires(x) __attribute__((context(x,0,1)))
# define __releases(x) __attribute__((context(x,1,0)))
# define __acquire(x) __context__(x,1)
# define __release(x) __context__(x,-1)
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
# define __percpu __attribute__((noderef, address_space(3)))
이제 나는 알고 싶습니다 : 어떻게 스파 스가 오류/경고를보고하는데 사용됩니까?
내 질문 :
- 나는 그들이 컴파일러와 경고를보고 스파 스를 어떻게 도움이되는지 세부 사항을합니다.
- 무엇입니까? address_space (x)컨텍스트 (X, x, x) 및 용도는 무엇입니까?
- 무엇 __nocast 의 목적, __force, __user, __safe?
기사를 공유해 주셔서 감사합니다. 그러나 나는 아직도 이러한 문제를보고하는 데 도움이되는 방법에 대한 답을 찾을 수 없습니다. 나는 여전히 'address_space (num)'가 실제로 경고를 해결하고보고하는 것을 돕는 방법을 얻지 못하고있다. 비슷하게'context (x, x, x)'. –