Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 124722

Forum Post: Linux/PROCESSOR-SDK-AM335X: [armv7 A8 TI am335x] Illegal Instruction

$
0
0
Part Number: PROCESSOR-SDK-AM335X Tool/software: Linux Part Number: TI am335x SITARA Here is the description of the problem (C code presented): #include static void asm_read_attr_reg4(void) { unsigned int reg_value; printf("Start\n"); __asm ("mrc p15, 0, %0, c0, c2, 4" : "=r"(reg_value) ); printf("Instruction Set Attributes Register 4: 0x%08x\n", reg_value); if (0x000f0000 & reg_value) { printf("The processor does support DMB, DSB and ISB instructions\n"); } else { printf("The processor does NOT support DMB, DSB and ISB instructions\n"); return; } return; } void main(void) { asm_read_attr_reg4(); } Here are the compilation options and execution of this code: root@beaglebone:~/projects/LKM/cp15_smc# gcc --machine=arm -march=armv7-a+fp -mfpu=vfp -mfloat-abi=hard test.c -o test root@beaglebone:~/projects/LKM/cp15_smc# ./test Start Illegal instruction root@beaglebone:~/projects/LKM/cp15_smc# Why the __asm ("mrc p15, 0, %0, c0, c2, 4" : "=r"(reg_value) ); is after all Illegal Instruction??? Thank you, _nobody_

Viewing all articles
Browse latest Browse all 124722

Trending Articles