内联汇编的问题 救命啊T_T
#elif defined __i386 && ( defined __linux || defined __svr4__ || defined VXWORKS )
I32 family = RV_IA_CPU_UNKNOWN;
I32 model = 0, stepping = 0;
I32 has_mmx = 0, has_kni = 0, has_sse2 = 0;
cpu_info->architecture = RV_CPU_IA;
__asm__ __volatile (
"pushl %%ebx \n\t" <----241行
"pushfl \n\t"
"popl %%eax \n\t"
"movl %%eax, %%ebx \n\t"
"xorl $0x200000, %eax \n\t"
"pushl %%eax \n\t"
"popfl \n\t"
"pushfl \n\t"
"popl %%eax \n\t"
"xorl %%ebx, %%eax \n\t"
"andl $0x200000, %%eax \n\t"
"jz jumphere \n\t"
"xorl %%eax, %%eax \n\t"
"cpuid \n\t"
"or %%eax, %%eax \n\t"
"jz jumphere \n\t"
"movl $1, %%eax \n\t"
"cpuid \n\t"
"movl %%eax, %%ecx \n\t"
"andl $0xf00, %%ecx \n\t"
"shrl $8, %%ecx \n\t"
"movl %%ecx, %0 \n\t"
"movl %%eax, %%ecx \n\t"
"andl $0xf0, %%ecx \n\t"
"shrl $4, %%ecx \n\t"
"movl %%ecx, %1 \n\t"
"movl %%eax, %%ecx \n\t"
"andl $0x0f, %%ecx \n\t"
"movl %%ecx, %2 \n\t"
"movl %%edx, %%eax \n\t"
"andl $0x800000, %%eax \n\t"
"jz jumphere \n\t"
"mov $1, %%eax \n\t"
"mov %%eax, %3 \n\t"
"movl %%edx, %%eax \n\t"
"and $0x2000000, %%eax \n\t"
"mov %%eax, %4 \n\t"
"movl %%edx, %%eax \n\t"
"and $0x4000000, %%eax \n\t"
"mov %%eax, %5 \n\t"
"jumphere: \n\t"
"popl %%ebx \n\t"
:"=m" (family),"=m" (model), "=m" (stepping), "=m" (has_mmx), "=m" (has_kni), "=m" (has_sse2)
:/*no input*/
:"%eax","%ebx","%ecx","%edx");
出错信息如下:
cdeclib/rvcpu.c:241: error: PIC register `ebx' clobbered in `asm'