From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Sherrill To: gcc-help@gcc.gnu.org Subject: stack check support on embedded targets Date: Fri, 06 Jul 2001 09:19:00 -0000 Message-id: <3B45E4EE.9040709@OARcorp.com> X-SW-Source: 2001-07/msg00095.html 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