lkml.org 
[lkml]   [2012]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectkernel 3.0.22 ARM unaligned access issue
From
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


\
 
 \ /
  Last update: 2012-03-14 14:13    [W:0.026 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site