2017-01-18

来自本人的旧博客 http://blog.163.com/awaken_ing/blog/static/1206131972015839465987

模式   usr            exception                                   svc                             
-----|----|--------------------------------|---------------------------------------------------                                                                                               
函数                 vector_\name:                             usr_entry:                         


                                                                            对应的汇编语句:                    
                  +----------------+        0  +------------------+   ------------------------    
           高地址 |spsr_<exception>|           |      r0          |      str     r1, [sp]         
                  |                |        4  +------------------+    ----------------------     
             ^    +----------------+           |      r1          |                               
             |    |                |           |                  |                               
             |    |lr_<exception>  |           |      .           |                               
             |    |                |           |      .           |      stmib   sp, {r1 - r12}   
             |    +----------------+           |      .           |                               
                  |                |           |                  |                               
           低地址 |      r0        |           |     r12          |                               
                  |                |           |                  |                               
                  +----------------+       52  +------------------+     ----------------------    
                    struct stack               |      sp_usr      |                               
                                               |                  |                               
                                           56  +------------------+     stmdb   r0, {sp, lr}^     
                                               |     lr_usr       |                               
                                               |                  |                               
                                           60  +------------------+      ---------------------    
                                               |  lr_<exception>  |                               
                                               |                  |                               
                                           64  +------------------+                                
                                               | spsr_<exception> |      stmia   r0, {r2 - r4}    
                                               |                  |                               
                                           68  +------------------+                               
                                               |      -1          |                               
                                               |                  |                               
                                           72  +------------------+     -----------------------   
                                                struct  pt_regs

代码在linux-2.6.35.7/arch/arm/kernel/entry-armv.S

lr<exception> 表示 parent PC
spsr
<exception> 表示 parent CPSR

右边72个字节构成的是struct pt_regs.

本文地址: https://awakening-fong.github.io/posts/arm/arm_int_pt_regs

转载请注明出处: https://awakening-fong.github.io


若无法评论, 请打开JavaScript, 并通过proxy.


blog comments powered by Disqus