Other Parts Discussed in Thread: AM3358
Tool/software: Linux
Here is the description of the problem (C code presented):
#include <stdio.h>
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_