arm上的current

来源:互联网 发布:linux如何更改ftp目录 编辑:程序博客网 时间:2024/05/21 10:20
arch/arm/include/asm/current.h
static inline struct task_struct *get_current(void)
{
return current_thread_info()->task;
}

#define current (get_current())

arch/arm/include/asm/thread_info.h
static inline struct thread_info *current_thread_info(void) __attribute_const__;

static inline struct thread_info *current_thread_info(void)
{
register unsigned long sp asm ("sp");
return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
}

struct thread_info 放在当前线程栈底
thread_info可索引到struct task_struct
0 0
原创粉丝点击