kernel 3.0.22 ARM unaligned access issue
From: naveen yadav
Date: Wed Mar 14 2012 - 09:11:37 EST
Hi all,
I am running one simple program, unaligned access on ARM cortex A9 on
3.0.22 kernel.
CONFIG_DISABLE_UNALIGNED_ACCESS=y
CONFIG_ALIGNMENT_TRAP=y
But I am surprise that program run well,and control does not come to
do_alignment(). for user fault.
what may be reason ?
Test Code:
#include<stdio.h>
#include<malloc.h>
int main ( )
{
char *data;
short *sp1, *sp2;
int *ip;
data = (char *)malloc(16);;
sp1 = (short*)(data+3);
sp2 = (short*)(data+5);
ip = (int*)(data+7);
*sp1=10;
*sp2=20;
*ip=30;
fprintf(stderr, "%d %d %d\n", *sp1, *sp2, *ip);
return 0;
}
on kernel 3.0.22
./a.out
10 20 30
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/