OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-or32/] [or32-hf.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
/*
2
 * or32 helper functions
3
 *
4
 */
5
 
6
#ifndef _OR32_OR32_HF_H
7
#define _OR32_OR32_HF_H
8
 
9
#include <linux/config.h>
10
 
11
#include <asm/processor.h>        // pt_regs
12
 
13
static __inline__ void check_stack(struct pt_regs *regs, const char *file,
14
                                   const char *function, int line)
15
{
16
#ifdef CONFIG_DEBUG_STACKOVERFLOW
17
        unsigned long esp;
18
        extern int show_stack(unsigned long *esp);
19
        extern void show_registers(struct pt_regs *regs);
20
 
21
        __asm__ __volatile__("l.andi %0,r1,%1" : "=r" (esp) : "K" (8191));
22
        if (unlikely(esp < (sizeof(struct task_struct) + 1024))) {
23
 
24
                printk("%s:%d: %s(): stack overflow: %ld\n",
25
                       file, line, function,
26
                       esp - sizeof(struct task_struct));
27
                __asm__ __volatile__ ("l.addi %0,r1,%1" : "=r" (esp) : "K" (0));
28
                show_registers(regs);
29
                show_stack((unsigned long *)esp);
30
                __asm__ __volatile__("l.nop 1");
31
        }
32
#endif
33
}
34
 
35
#endif /* _OR32_OR32_HF_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.