Beispiel #1
0
unsigned long
search_exception_table(unsigned long addr)
{
	unsigned long ret;

#ifndef CONFIG_MODULES
        addr &= 0x7fffffff;  /* remove amode bit from address */
	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
	if (ret) return FIX_PSW(ret);
#else
	/* The kernel is the last "module" -- no need to treat it special.  */
	struct module *mp;
        addr &= 0x7fffffff;  /* remove amode bit from address */
	for (mp = module_list; mp != NULL; mp = mp->next) {
		if (mp->ex_table_start == NULL)
			continue;
		ret = search_one_table(mp->ex_table_start,
				       mp->ex_table_end - 1, addr);
		if (ret) return FIX_PSW(ret);
	}
#endif

	return 0;
}
static unsigned
search_exception_table_without_gp(unsigned long addr)
{
	unsigned ret;

#ifndef CONFIG_MODULES
	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table - 1,
			       addr - gp);
#else
	extern spinlock_t modlist_lock;
	unsigned long flags;
	/* The kernel is the last "module" -- no need to treat it special. */
	struct module *mp;

	ret = 0;
	spin_lock_irqsave(&modlist_lock, flags);
	for (mp = module_list; mp ; mp = mp->next) {
		if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
			continue;
		ret = search_one_table(mp->ex_table_start,
				       mp->ex_table_end - 1, addr - mp->gp);
		if (ret)
			break;
	}
	spin_unlock_irqrestore(&modlist_lock, flags);
#endif

	return ret;
}
unsigned long search_exception_table(unsigned long addr)
{
	unsigned long ret = 0;

#ifndef CONFIG_MODULES
	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
	return ret;
#else
	unsigned long flags;
	/* The kernel is the last "module" -- no need to treat it special.  */
	struct module *mp;

	spin_lock_irqsave(&modlist_lock, flags);
	for (mp = module_list; mp != NULL; mp = mp->next) {
		if (mp->ex_table_start == NULL)
			continue;
		ret = search_one_table(mp->ex_table_start,
				       mp->ex_table_end - 1, addr);
		if (ret)
			break;
	}
	spin_unlock_irqrestore(&modlist_lock, flags);
	return ret;
#endif
}
unsigned
search_exception_table(unsigned long addr, unsigned long exc_gp)
{
	unsigned ret;

#ifndef CONFIG_MODULES
	ret = search_one_table(__start___ex_table, __stop___ex_table - 1,
			       addr - exc_gp);
	if (ret) return ret;
#else
	extern spinlock_t modlist_lock;
	unsigned long flags;
	/* The kernel is the last "module" -- no need to treat it special. */
	struct module *mp;

	ret = 0;
	spin_lock_irqsave(&modlist_lock, flags);
	for (mp = module_list; mp ; mp = mp->next) {
		if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
			continue;
		ret = search_one_table(mp->ex_table_start,
				       mp->ex_table_end - 1, addr - exc_gp);
		if (ret)
			break;
	}
	spin_unlock_irqrestore(&modlist_lock, flags);
	if (ret) return ret;
#endif

	/*
	 * The search failed with the exception gp. To be safe, try the
	 * old method before giving up.
	 */
	ret = search_exception_table_without_gp(addr);
	if (ret) {
		printk(KERN_ALERT "%s: [%lx] EX_TABLE search fail with"
		       "exc frame GP, success with raw GP\n",
		       current->comm, addr);
		return ret;
	}

	return 0;
}
Beispiel #5
0
static inline unsigned long
search_dbe_table(unsigned long addr)
{
	unsigned long ret;

	/* There is only the kernel to search.  */
	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
	if (ret) return ret;

	return 0;
}
Beispiel #6
0
unsigned long
search_exception_table(unsigned long addr)
{
	unsigned long ret;

	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
	if (ex_tab_message)
		printf("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret);
	if (ret) return ret;

	return 0;
}
unsigned long
search_exception_table(unsigned long addr)
{
	unsigned long ret;

#ifndef CONFIG_MODULES
	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
	if (ret) return ret;
#else
	/* The kernel is the last "module" -- no need to treat it special.  */
	struct module *mp;
	for (mp = module_list; mp != NULL; mp = mp->next) {
		if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
			continue;
		ret = search_one_table(mp->ex_table_start,
				       mp->ex_table_end - 1, addr);
		if (ret) return ret;
	}
#endif

	return 0;
}
Beispiel #8
0
struct exception_fixup
search_exception_table (unsigned long addr)
{
	const struct exception_table_entry *entry;
	struct exception_fixup fix = { 0 };

#ifndef CONFIG_MODULES
	/* There is only the kernel to search.  */
	entry = search_one_table(__start___ex_table, __stop___ex_table - 1, addr, main_gp);
	if (entry)
		fix.cont = entry->cont + main_gp;
	return fix;
#else
	struct archdata *archdata;
	struct module *mp;
	unsigned long flags;
	
	/* The kernel is the last "module" -- no need to treat it special. */
	spin_lock_irqsave(&modlist_lock, flags);
	for (mp = module_list; mp; mp = mp->next) {
		if (!mp->ex_table_start)
			continue;
		archdata = (struct archdata *) mp->archdata_start;
		if (!archdata)
			continue;
		entry = search_one_table(mp->ex_table_start, mp->ex_table_end - 1,
					 addr, (unsigned long) archdata->gp);
		if (entry) {
			fix.cont = entry->cont + (unsigned long) archdata->gp;
			break;
		}
	}
	spin_unlock_irqrestore(&modlist_lock, flags);
#endif
	return fix;
}
const struct exception_table_entry *
search_exception_table (unsigned long addr)
{
#ifndef CONFIG_MODULES
	/* There is only the kernel to search.  */
	return search_one_table(__start___ex_table, 
                                __stop___ex_table - 1, 
                                addr);
#else
	/* The kernel is the last "module" -- no need to treat it special. */
	struct module *mp;

	for (mp = module_list; mp ; mp = mp->next) {
		const struct exception_table_entry *ret;
		if (!mp->ex_table_start)
			continue;
		ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1,
				       addr);
		if (ret)
			return ret;
	}
	return 0;
#endif
}
unsigned long
search_exception_table(unsigned long addr)
{
	unsigned long ret;

	/* There is only the kernel to search.  */
	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
	/* if the serial port does not hang in exception, printf can be used */
#if !defined(CONFIG_SYS_SERIAL_HANG_IN_EXCEPTION)
	if (ex_tab_message)
		debug("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret);
#endif
	if (ret) return ret;

	return 0;
}