huchuan2025/20-Area/22-Work/222-ReadNote/Linux OS/内核代码分析/通用.md

451 B
Raw Blame History

  • current 宏 获取task_struct的重要的宏
    • 每个体系结构都要有自己的实现
    • 对于arm64来讲 就是读取sp_el0 ? 为什么是el0
    • 只有process context进程上下文中才生效 在中断上下文中不生效。
      • on behalf of a process by syscall or trigger an exceptionexception handler
      • executing an interrupt handler.
    • 关于currentkernel还封装了一组操作
      • task_pid_nr(current)