barrier();
}
-spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(die_lock);
/*
* This function is protected against re-entrancy.
}
static LIST_HEAD(undef_hook);
-static spinlock_t undef_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(undef_lock);
void register_undef_hook(struct undef_hook *hook)
{
*/
asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode)
{
- unsigned int vectors = vectors_base();
-
console_verbose();
printk(KERN_CRIT "Bad mode in %s handler detected: mode %s\n",
handler[reason], processor_modes[proc_mode]);
- /*
- * Dump out the vectors and stub routines. Maybe a better solution
- * would be to dump them out only if we detect that they are corrupted.
- */
- dump_mem(KERN_CRIT "Vectors: ", vectors, vectors + 0x40);
- dump_mem(KERN_CRIT "Stubs: ", vectors + 0x200, vectors + 0x4b8);
-
die("Oops - bad mode", regs, 0);
local_irq_disable();
panic("bad mode");
#define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE)
asmlinkage int arm_syscall(int no, struct pt_regs *regs)
{
+ struct thread_info *thread = current_thread_info();
siginfo_t info;
if ((no >> 16) != 0x9f)
regs->ARM_cpsr |= MODE32_BIT;
return regs->ARM_r0;
+ case NR(set_tls):
+ thread->tp_value = regs->ARM_r0;
+ /*
+ * Our user accessible TLS ptr is located at 0xffff0ffc.
+ * On SMP read access to this address must raise a fault
+ * and be emulated from the data abort handler.
+ * m
+ */
+ *((unsigned long *)0xffff0ffc) = thread->tp_value;
+ return 0;
+
default:
/* Calls 9f00xx..9f07ff are defined to return -ENOSYS
if not implemented, rather than raising SIGILL. This
void __readwrite_bug(const char *fn)
{
- printk("%s called, but not implemented", fn);
+ printk("%s called, but not implemented\n", fn);
BUG();
}
EXPORT_SYMBOL(__readwrite_bug);
void __init trap_init(void)
{
- extern void __trap_init(unsigned long);
- unsigned long base = vectors_base();
-
- __trap_init(base);
- flush_icache_range(base, base + PAGE_SIZE);
- if (base != 0)
- printk(KERN_DEBUG "Relocating machine vectors to 0x%08lx\n",
- base);
+ extern void __trap_init(void);
+
+ __trap_init();
+ flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);
modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
}