正在加载图片...
current thread info 令从刚才看到的 thread info和内核态堆栈之间的配 对,内核可以很容易的从esp寄存器的值获得当 前在CPU上运行的进程的描述符指针 令因为这个内存区是8KB=213大小,内核必须做的 就是让esp有13位的有效位,以获得进程描述符 /k how to get the current stack pointer from C*/ register unsigned long current_stack_pointer asm("esp")_used /k how to get the thread information struct from C * static inline struct thread_info *current_ thread_info(void) return(struct thread info (current_stack_pointer &w(THREAD_SIZE 8191=8192-1=0x2000-1=0x1仟f 2021/2/6 Liux操作系取反:0xffe000(最后13位为0)2021/2/6 Linux操作系统分析 22/65 current_thread_info ❖从刚才看到的thread_info和内核态堆栈之间的配 对,内核可以很容易的从esp寄存器的值获得当 前在CPU上运行的进程的描述符指针 ❖因为这个内存区是8KB=213大小,内核必须做的 就是让esp有13位的有效位,以获得进程描述符 的基地址 8191=8192-1=0x2000-1=0x1fff 取反:0xffffe000(最后13位为0)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有