V
Victor
Hi,
I have 2 problems:
First, I want to grep one pattern at a time from the pattern group
below:
unsigned long long i;
unsigned long long *dataPatternPtr[] = {
0xa0a00000000000aaLL,
0xFFFFFFFFFFFFFFFFLL,
0x5555555555555555LL,
0xAAAAAAAAAAAAAAAALL,
0xCCCCCCCCCCCCCCCCLL,
0x3333333333333333LL,
0xEEEEEEEEEEEEEEEELL,
0x7777777777777777LL,
0x0000000000000001LL,
0xFFFFFFFFFFFFFFFELL,
0xABCDEF0123456789LL,
};
unsigned long long seed = *(dataPatternPtr + 2); // This one
works during compile
unsigned long long seed = *(dataPatternPtr + i); // *********
ERROR ****** But why does this one not work?
But when I compiled, I received this kind of error:
/projects/svdc/aurora.validation/work/vhnguyen/aurora_validation/uboot/
examples/zzzmain.c:295: undefined reference to `memcpy'
make[1]: *** [zzzmain] Error 1
Does anyone know why? It seems memcpy is not found in #include files
but what library memcpy should reside in?
Any best practice to store and retrieve data pattern in my case?
2) I also tried to reduce the above problem to use Struct. In this
case, I assume in order to access pattern # 3, then I should do
*(dataPattern[2].pattern), is it right? I can't really verify
because my compiler spits out error about memcpy like in case 1. In
my patterns, I append data with "LL" for double long word.
struct key {
unsigned long long *pattern;
} dataPattern[] = {
0x0000000000000000LL,
0xFFFFFFFFFFFFFFFFLL,
0x5555555555555555LL,
0xAAAAAAAAAAAAAAAALL,
0xCCCCCCCCCCCCCCCCLL,
0x3333333333333333LL,
0xEEEEEEEEEEEEEEEELL,
0x7777777777777777LL,
0x0000000000000001LL,
0xFFFFFFFFFFFFFFFELL,
0xABCDEF0123456789LL
};
Actually I also have another 3rd question indicated below:
int sizeOfStruct = sizeof(struct key); // Here size is 4 bytes
int totalSize = sizeof(dataPattern); //Here sizeof returns
number bytes (44) . Question: Should it return 88 bytes (11 patterns
* 8 bytes each) instead of 44 ?
Thanks,
Victor
I have 2 problems:
First, I want to grep one pattern at a time from the pattern group
below:
unsigned long long i;
unsigned long long *dataPatternPtr[] = {
0xa0a00000000000aaLL,
0xFFFFFFFFFFFFFFFFLL,
0x5555555555555555LL,
0xAAAAAAAAAAAAAAAALL,
0xCCCCCCCCCCCCCCCCLL,
0x3333333333333333LL,
0xEEEEEEEEEEEEEEEELL,
0x7777777777777777LL,
0x0000000000000001LL,
0xFFFFFFFFFFFFFFFELL,
0xABCDEF0123456789LL,
};
unsigned long long seed = *(dataPatternPtr + 2); // This one
works during compile
unsigned long long seed = *(dataPatternPtr + i); // *********
ERROR ****** But why does this one not work?
But when I compiled, I received this kind of error:
/projects/svdc/aurora.validation/work/vhnguyen/aurora_validation/uboot/
examples/zzzmain.c:295: undefined reference to `memcpy'
make[1]: *** [zzzmain] Error 1
Does anyone know why? It seems memcpy is not found in #include files
but what library memcpy should reside in?
Any best practice to store and retrieve data pattern in my case?
2) I also tried to reduce the above problem to use Struct. In this
case, I assume in order to access pattern # 3, then I should do
*(dataPattern[2].pattern), is it right? I can't really verify
because my compiler spits out error about memcpy like in case 1. In
my patterns, I append data with "LL" for double long word.
struct key {
unsigned long long *pattern;
} dataPattern[] = {
0x0000000000000000LL,
0xFFFFFFFFFFFFFFFFLL,
0x5555555555555555LL,
0xAAAAAAAAAAAAAAAALL,
0xCCCCCCCCCCCCCCCCLL,
0x3333333333333333LL,
0xEEEEEEEEEEEEEEEELL,
0x7777777777777777LL,
0x0000000000000001LL,
0xFFFFFFFFFFFFFFFELL,
0xABCDEF0123456789LL
};
Actually I also have another 3rd question indicated below:
int sizeOfStruct = sizeof(struct key); // Here size is 4 bytes
int totalSize = sizeof(dataPattern); //Here sizeof returns
number bytes (44) . Question: Should it return 88 bytes (11 patterns
* 8 bytes each) instead of 44 ?
Thanks,
Victor