I am using inline assembly to do ARM operations in C code. In the C code I'm allocating memory with calloc. This memory block is divided into different buffers, such that:
int * SCRATCH = (int *)calloc(LEN, sizeof(int));
buffer1 = (int *)SCRATCH;
buffer2 = (short *)((int *) buffer1 + sizeof(* buffer1) * LEN_BUF_1);
where the lengths are all known. Now I'm accessing values from those buffers with
LDRD r4, r4, [r0], #8;
which gives me an error since the memory is not aligned properly. How would I manage to align all buffers that I'm using to be able to use double loads and stores?
Thank you!