简体   繁体   English

x86程序下面的端口为mips32

[英]Port below x86 program to mips32

Below sample code for X86 arch, 下面是X86 arch的示例代码,

#  define INC(_lval,_lqual) \
      __asm__ __volatile__ ( \
      "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" )

Please somebody help me equivalent MIPS32 arch. 请有人帮我等同MIPS32拱门。

That looks like gcc inline assembly for an atomic increment. 这看起来像gcc内联汇编,用于原子增量。 This is the gcc intrinsic for an atomic increment: 这是原子增量的gcc内在函数:

__sync_fetch_and_add(&_lval, 1);

Works on x86, mips32, etc. 适用于x86,mips32等

I found a code that might be useful for you here . 我发现可能对您有用代码在这里 It seems in fact to indicate that the builtin for gcc is not implemented for that architecture. 实际上似乎表明gcc的内置版没有为该架构实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM