LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC] is CONFIG_DEBUG_STACK_USAGE supported on STACK_GROWSUP arches ?
@ 2008-03-05 13:09 Eric Dumazet
  0 siblings, 0 replies; only message in thread
From: Eric Dumazet @ 2008-03-05 13:09 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: linux kernel

Hi Kyle

I was wondering how following code could work on PARISC :

kernel/sched.c

#ifdef CONFIG_DEBUG_STACK_USAGE
        {
                unsigned long *n = end_of_stack(p);
                while (!*n)
                        n++;
                free = (unsigned long)n - (unsigned long)end_of_stack(p);
        }
#endif


I am trying to define a bytes_free_in_stack() function, and was about to 
code something like :

/*
 * Only called in process context
 */
static inline unsigned long bytes_free_in_stack()
{
#ifdef CONFIG_STACK_GROWSUP
   unsigned long free = (unsigned long)end_of_stack(current) - (unsigned 
long)&free;
#else
   unsigned long free = (unsigned long)&free - (unsigned 
long)end_of_stack(current);
#endif
  return free;
}

but I realize it wont work on PARISC (and more generally on 
STACK_GROWSUP arches)

Thank you
Eric




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-05 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 13:09 [RFC] is CONFIG_DEBUG_STACK_USAGE supported on STACK_GROWSUP arches ? Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).