lkml.org 
[lkml]   [2002]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] generic show_stack facility
    This patch adds a prototype for show_stack to sched.h and exports
    it. Andrea's VM updates want this, as does Tux and I think it's a facility
    we want to proive genericly.

    Note that some architectures (e.g. ia64) have a conflicting prototype and
    some (e.g. sparc) don't have show_stack at all, but I think -pre5 is early
    enough in the 2.4.19 cycle to let the maintainers fix it.

    Could you apply the patch to your tree?

    Christoph

    diff -uNr -Xdontdiff ../master/linux-2.4.19-pre4/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
    --- ../master/linux-2.4.19-pre4/arch/i386/kernel/irq.c Wed Nov 7 20:09:56 2001
    +++ linux/arch/i386/kernel/irq.c Fri Mar 29 15:55:39 2002
    @@ -192,8 +192,6 @@
    unsigned char global_irq_holder = NO_PROC_ID;
    unsigned volatile long global_irq_lock; /* pendantic: long for set_bit --RR */

    -extern void show_stack(unsigned long* esp);
    -
    static void show(char * str)
    {
    int i;
    @@ -224,7 +222,7 @@
    }
    esp &= ~(THREAD_SIZE-1);
    esp += sizeof(struct task_struct);
    - show_stack((void*)esp);
    + show_stack((void *)esp);
    }
    printk("\nCPU %d:",cpu);
    show_stack(NULL);
    diff -uNr -Xdontdiff ../master/linux-2.4.19-pre4/arch/ia64/kernel/irq.c linux/arch/ia64/kernel/irq.c
    --- ../master/linux-2.4.19-pre4/arch/ia64/kernel/irq.c Thu Mar 21 15:24:10 2002
    +++ linux/arch/ia64/kernel/irq.c Fri Mar 29 15:56:13 2002
    @@ -192,8 +192,6 @@
    unsigned int global_irq_holder = NO_PROC_ID;
    unsigned volatile long global_irq_lock; /* pedantic: long for set_bit --RR */

    -extern void show_stack(unsigned long* esp);
    -
    static void show(char * str)
    {
    int i;
    diff -uNr -Xdontdiff ../master/linux-2.4.19-pre4/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
    --- ../master/linux-2.4.19-pre4/arch/mips/kernel/traps.c Thu Mar 21 15:24:13 2002
    +++ linux/arch/mips/kernel/traps.c Fri Mar 29 15:53:53 2002
    @@ -182,12 +182,12 @@
    * This routine abuses get_user()/put_user() to reference pointers
    * with at least a bit of error checking ...
    */
    -void show_stack(unsigned int *sp)
    +void show_stack(unsigned long *sp)
    {
    int i;
    - unsigned int *stack;
    + unsigned long *stack;

    - stack = sp ? sp : (unsigned int *)&sp;
    + stack = sp ? sp : (unsigned long *)&sp;
    i = 0;

    printk("Stack:");
    diff -uNr -Xdontdiff ../master/linux-2.4.19-pre4/include/linux/sched.h linux/include/linux/sched.h
    --- ../master/linux-2.4.19-pre4/include/linux/sched.h Thu Mar 21 15:24:23 2002
    +++ linux/include/linux/sched.h Fri Mar 29 15:59:51 2002
    @@ -145,6 +145,7 @@
    extern void sched_init(void);
    extern void init_idle(void);
    extern void show_state(void);
    +extern void show_stack(unsigned long *esp);
    extern void cpu_init (void);
    extern void trap_init(void);
    extern void update_process_times(int user);
    diff -uNr -Xdontdiff ../master/linux-2.4.19-pre4/kernel/ksyms.c linux/kernel/ksyms.c
    --- ../master/linux-2.4.19-pre4/kernel/ksyms.c Thu Mar 21 15:24:23 2002
    +++ linux/kernel/ksyms.c Fri Mar 29 15:52:20 2002
    @@ -487,6 +487,7 @@
    EXPORT_SYMBOL(seq_release);
    EXPORT_SYMBOL(seq_read);
    EXPORT_SYMBOL(seq_lseek);
    +EXPORT_SYMBOL(show_stack);

    /* Program loader interfaces */
    EXPORT_SYMBOL(setup_arg_pages);
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:25    [W:0.025 / U:61.888 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site