Commit 3ab146c9 authored by Russell King's avatar Russell King

[ARM] Cleanup some quirks.

- Ensure FIQs are enabled when cpu_idle() is called.
- Remove unused members of irq_cpustat_t.
- Remove unnecessary #ifndef CONFIG_SMP...#endif around irq_exit()
  macro.
- Rename __stf/__clf such that it stresses that they affect only
  local state (as per local_irq_xxx).
- Move THREAD_SIZE such that it can be used in current_thread_info()
parent 1c854f6f
......@@ -97,6 +97,8 @@ void default_idle(void)
*/
void cpu_idle(void)
{
local_fiq_enable();
/* endless idle loop with no priority at all */
while (1) {
void (*idle)(void) = pm_idle;
......
......@@ -8,10 +8,6 @@
typedef struct {
unsigned int __softirq_pending;
unsigned int __local_irq_count;
unsigned int __local_bh_count;
unsigned int __syscall_count;
struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
......@@ -52,7 +48,6 @@ typedef struct {
#define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
#ifndef CONFIG_SMP
extern asmlinkage void __do_softirq(void);
#define irq_exit() \
......@@ -62,6 +57,5 @@ extern asmlinkage void __do_softirq(void);
__do_softirq(); \
preempt_enable_no_resched(); \
} while (0)
#endif
#endif /* __ASM_HARDIRQ_H */
......@@ -282,7 +282,7 @@ do { \
/*
* Enable FIQs
*/
#define __stf() \
#define local_fiq_enable() \
({ \
unsigned long temp; \
__asm__ __volatile__( \
......@@ -297,7 +297,7 @@ do { \
/*
* Disable FIQs
*/
#define __clf() \
#define local_fiq_disable() \
({ \
unsigned long temp; \
__asm__ __volatile__( \
......@@ -331,6 +331,13 @@ do { \
: "r" (x) \
: "memory", "cc")
#define irqs_disabled() \
({ \
unsigned long flags; \
local_save_flags(flags); \
flags & PSR_I_BIT; \
})
#ifdef CONFIG_SMP
#error SMP not supported
......@@ -346,16 +353,6 @@ do { \
#define smp_wmb() barrier()
#define smp_read_barrier_depends() do { } while(0)
#define clf() __clf()
#define stf() __stf()
#define irqs_disabled() \
({ \
unsigned long flags; \
local_save_flags(flags); \
flags & PSR_I_BIT; \
})
#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
/*
* On the StrongARM, "swp" is terminally broken since it bypasses the
......
......@@ -76,6 +76,8 @@ struct thread_info {
#define init_thread_info (init_thread_union.thread_info)
#define init_stack (init_thread_union.stack)
#define THREAD_SIZE 8192
/*
* how to get the thread information struct from C
*/
......@@ -84,11 +86,9 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__;
static inline struct thread_info *current_thread_info(void)
{
register unsigned long sp asm ("sp");
return (struct thread_info *)(sp & ~0x1fff);
return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
}
#define THREAD_SIZE (8192)
extern struct thread_info *alloc_thread_info(struct task_struct *task);
extern void free_thread_info(struct thread_info *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment