This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

stack check support on embedded targets



Hi,

I would like to add stack check support for RTEMS tasks/threads.  This is an
run-time environment for embedded CPUs (about a dozen now) without an
MMU.  The generic stack probe code seems to assume that an MMU will
catch an access of an invalid address.  On RTEMS, the test for stack in 
range
is portable and quite simple.  The valid stack range is in the thread 
control block.
So one can write a short portable C routine to catch the fault;

void check_sp( void *sp current_sp );
  if current_sp is NOT in range
    ERROR

Any thoughts on how to generically add support for calling a probe routine
with the current stack pointer as a single argument?  It would be
fabulous if this could be added in such a way that all targets would support
it instantly.

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]