[<prev] [next>] [day] [month] [year] [list]
Message-ID: <47CE9B70.6090707@cosmosbay.com>
Date:	Wed, 05 Mar 2008 14:09:04 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Kyle McMartin <kyle@...artin.ca>
Cc:	linux kernel <linux-kernel@...r.kernel.org>
Subject: [RFC] is CONFIG_DEBUG_STACK_USAGE supported on STACK_GROWSUP arches
  ?
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
