查看MIPS Linux 存储管理分析札记的源代码
←
MIPS Linux 存储管理分析札记
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== 内核在从汇编语言跳到C语言中时,其栈的栈顶是在哪里设置的?== 内核在进入 start_kernel 前,将 esp 指向了 init_thread_union + THREAD_SIZE, init_thread_union 位于 .data.init_task 节,是个 union 结构,其大小为 THREAD_SIZE(页大小为 4KB 时,THREAD_SIZE 为两个页,即 8KB),定义的比较巧妙: <source lang=c> union thread_union { struct thread_info thread_info; unsigned long stack[THREAD_SIZE/sizeof(long)]; }; </source> THREAD_SIZE 定义在 arch/mips/include/asm/thread_info.h: <source lang=cpp> /* thread information allocation */ #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT) #define THREAD_SIZE_ORDER (1) #endif #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_64BIT) #define THREAD_SIZE_ORDER (2) #endif #ifdef CONFIG_PAGE_SIZE_8KB #define THREAD_SIZE_ORDER (1) #endif #ifdef CONFIG_PAGE_SIZE_16KB #define THREAD_SIZE_ORDER (0) #endif #ifdef CONFIG_PAGE_SIZE_32KB #define THREAD_SIZE_ORDER (0) #endif #ifdef CONFIG_PAGE_SIZE_64KB #define THREAD_SIZE_ORDER (0) #endif #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) </source> <br>
返回到
MIPS Linux 存储管理分析札记
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面