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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-or32/] [or32-hf.h] - Rev 1774

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

/*
 * or32 helper functions
 *
 */
 
#ifndef _OR32_OR32_HF_H
#define _OR32_OR32_HF_H
 
#include <linux/config.h>
 
#include <asm/processor.h>        // pt_regs
 
static __inline__ void check_stack(struct pt_regs *regs, const char *file,
				   const char *function, int line)
{
#ifdef CONFIG_DEBUG_STACKOVERFLOW
	unsigned long esp;
	extern int show_stack(unsigned long *esp);
	extern void show_registers(struct pt_regs *regs);
 
	__asm__ __volatile__("l.andi %0,r1,%1" : "=r" (esp) : "K" (8191));
	if (unlikely(esp < (sizeof(struct task_struct) + 1024))) {
 
		printk("%s:%d: %s(): stack overflow: %ld\n",
		       file, line, function,
		       esp - sizeof(struct task_struct));
		__asm__ __volatile__ ("l.addi %0,r1,%1" : "=r" (esp) : "K" (0));
		show_registers(regs);
		show_stack((unsigned long *)esp);
		__asm__ __volatile__("l.nop 1");
	}
#endif
}
 
#endif /* _OR32_OR32_HF_H */
 

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

powered by: WebSVN 2.1.0

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