Hello and a happy new year,
I'm working on a kernel-module. It is necessary to do a numeric calculation of some parameter to set up the device correctly.
The function works perfectly but the gcc
compiler (I'm using kbuild) gives me the warning:
warning: the frame size of 1232 bytes is larger than 1024 bytes [-Wframe-larger-than=]
If I'm right this means that space local variables exceed a limitation given by the machine the module compiled on.
There are some questions now:
- Does this warning refer to the whole memory space needed for the module, this explicit function or this function and its sub-functions?
- How critical is this?
- I don't see a way to reduce the needed memory. Are there some suggestions to handle this? Any how-to?
Maybe it is helpful: The calculation uses a 64bit fixed-point-arithmetic. All the functions of this library are inline
functions.
Thanks in advance
Alex
Following the advice from @Tsyvarev the problem could reduce to the allocation in a function as this example shows (I know that the code doesn't make sense - it's only for showing how I declare the variables inside the functions):
uint8_t getVal ( uint8_t )
{
uint64_t ar1[128] = {0};
uint64_t ar2[128] = {0};
uint8_t val;
// a much of stuff
return val;
}
void fun ( void )
{
uint64_t ar1[128] = {0};
uint64_t ar2[128] = {0};
uint8_t cnt;
for(cnt=0; cnt<128; cnt++)
{
ar1[cnt] = getVal(cnt);
ar1[cnt] = getVal(cnt);
}
}