错误:“pop”/“push”的操作数类型不匹配

时间:2016-08-07 06:07:58

标签: linux assembly kernel x86-64 inline-assembly

我在64位处理器上运行64位内核。我必须构建内核2.4.32才能安装特定软件的内核模块。但make bzImage显示以下错误:

bus.c: Assembler messages:
bus.c:647: Error: operand type mismatch for `pop'
bus.c:649: Error: operand type mismatch for `push'
bus.c:685: Error: operand type mismatch for `pop'
bus.c:689: Error: operand type mismatch for `push'

错误来自函数spin_lock_irqsavespin_unlock_irqrestore的bus.c文件以及这些定义:

#define spin_lock_irqsave(lock, flags)      do { local_irq_save(flags);       spin_lock(lock); } while (0)
#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock);  local_irq_restore(flags); } while (0)

问题来自函数local_irq_savelocal_irq_restore

#define local_irq_save(x)   do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0)

#define local_irq_restore(x)    __asm__ __volatile__("# local_irq_restore \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory")

请帮助我如何解决问题!

0 个答案:

没有答案