Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: Stack usage during exception

$
0
0

Hi,

We're using SYS/BIOS 6.33 and are taking an exception during an HWI. It appears the exception handler is overwriting the system stack instead of growing it. Can somebody summarize for me how the stack is used if we take an exception during an HWI?

 

I see in a newer version of SYS/BIOS, 6.35.04.50 that there's a new configuration opiton named Exception_useInternalBuffer. Not sure what version this was first added. It's description is this:

 
configException_useInternalBuffer  // module-wide

If true, the exception context is saved to an internal buffer. If false, the exception context is saved to the bottom of the isr stack and no memory for the internal buffer is allocated

What does it mean "saved to the bottom of the isr stack"? Does it overwrite valid stack data?

Finally, we're pretty far along in our project and won't likely switch to a newer version of SYS/BIOS. What if we patched our 6.33 version of Exception.c for c64p family? And added in the below snippet of code? Would there be any adverse side effects elsewhere? I suspose we'd have to modify the Execption_module object definiton. Maybe we could just hard code where this buffer is.

 

 Look like this feature is added later on, since our verion (6.33.02.31) does not have this config option:

 I also compare exception.c for c64p family. Ver 6.37 sysbios look like this:

  

if (Exception_useInternalBuffer) {

                        Exception_module->excPtr = (Char *)

                            (((UInt32)Exception_module->contextBuf +

                               Exception_sizeContextBuf - 8) & ~0x7);

                    }

                    else {

                        Exception_module->excPtr = ti_sysbios_family_c64p_Hwi_getIsrStackAddress();

                    }

               

 

Our version look like this. 

Exception_module->isrStack = ti_sysbios_family_c64p_Hwi_getIsrStackAddress();

 

 

 

 


Viewing all articles
Browse latest Browse all 25965

Trending Articles