Page fault

这段bug越是浪漫越美妙, 离别最是吃不消

我最不忍看你 背向我转面
要走一刻请不必诸多眷恋
浮沉浪似人潮 哪会没有思念
你我伤心到讲不出再见
——-《讲不出再见》

好,Page fault exceptions 准备揭开它的神秘面纱……

先从根源说起

Indicates that, with paging enabled (the PG flag in the CR0 register is set), the processor detected one of the following conditions
while using the page-translation mechanism to translate a linear address to a physical address

    /**
         传递给 thread_state_suspend()三个参数
         wo: 
            即x0  
            #define THREAD_FLAGS_EXIT_ON_FOREIGN_INTR   (1 << 2)

            在整个os中仅有两处调用 thread_state_suspend ,

            另一处是在thread_rpc中 : 

            FUNC thread_rpc , 
            .....
            mov w0, #THREAD_FLAGS_COPY_ARGS_ON_RETURN
            bl  thread_state_suspend

            当thread_resume_from_rpc()的时候,会检查该flags,

            Return From RPC To Request Service of a foreign interrupt must not
            get parameters from non-secure world

            if (threads[n].flags & THREAD_FLAGS_COPY_ARGS_ON_RETURN) {
                ....
            }
            两者不只是调用同一个函数,且都是运行在屏蔽intr环境中,都是一个密室
            这里是和linux kernel intr top half 是相似的地方 

            好了,那么会问 : 到底什么是intr ? 
            为什么这么重要,为什么要处处防着它 ?

            牙膏厂给intr下了一个定义 : 

            Interrupts and exceptions are events that indicate that
            a condition exists Somewhere In The System

            哈哈,感觉起来是不是如沐春风呢! 
    */
    mov w0, #THREAD_FLAGS_EXIT_ON_FOREIGN_INTR
    mrs x1, spsr_el1
    mrs x2, elr_el1
    bl  thread_state_suspend
    mov w4, w0      /* Supply thread index */
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值