&是什么QUOT;拇指"在ARM-Linux的code宏办? [英] What does "THUMB" macro do in ARM-linux code?

查看:241
本文介绍了&是什么QUOT;拇指"在ARM-Linux的code宏办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在看的head.S ARM Linux上的code。
我知道Thumb模式是什么。但是有一条线,如拇指(其当量),这是一个predefined宏作为的#define拇指(X ...) X
dotdotdot 的实际写入。

请告诉我,宏做什么。

  ENTRY(STEXT)
  setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE,R9 @保证SVC模式
                                               @和禁用IRQ
  MRC P15,0,R9,C0,C0 @得到了处理器的ID
  bl__lookup_processor_type @ R5 = procinfo R9 = CPUID
  MOVS R10,R5 @无效处理器(R5 = 0)?
  拇指(联茂)@力修正,能长枝编码
  BEQ __error_p @是的,错误'P'


解决方案

拇指() ARM() preprocessor宏用于条件编译根据目标指令集源组件。如果内核被编译为ARM目标拇指()宏是无操作。相反,如果内核被编译为拇指,拇指()宏扩展到它的参数。

I am looking at head.S ARM linux code. I know what thumb mode is. But there is one line such as THUMB(it eq) and it is a predefined macro as #define THUMB(x...) x The dotdotdot is actually written.

Please tell me what the macro does.

ENTRY(stext)
  setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
                                               @ and irqs disabled
  mrc p15, 0, r9, c0, c0      @ get processor id
  bl__lookup_processor_type   @ r5=procinfo r9=cpuid
  movs r10, r5                @ invalid processor (r5=0)? 
  THUMB( iteq )               @ force fixup-able long branch encoding
  beq __error_p               @ yes, error 'p'

解决方案

THUMB() an ARM() preprocessor macros are used to conditionally compile the source assembly depending on the target instruction set. If the kernel is being compiled for ARM target, THUMB() macro is no-op. On the contrary, if the kernel is being compiled for THUMB, THUMB() macro is expanded to its arguments.

这篇关于&是什么QUOT;拇指"在ARM-Linux的code宏办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆