Skip to content

Commit d5ce528

Browse files
committed
Blackfin: convert irq/process to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1 parent 415f92d commit d5ce528

4 files changed

Lines changed: 30 additions & 75 deletions

File tree

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,11 @@
11
#ifndef __BFIN_HARDIRQ_H
22
#define __BFIN_HARDIRQ_H
33

4-
#include <linux/cache.h>
5-
#include <linux/threads.h>
6-
#include <asm/irq.h>
7-
8-
typedef struct {
9-
unsigned int __softirq_pending;
10-
unsigned int __syscall_count;
11-
struct task_struct *__ksoftirqd_task;
12-
} ____cacheline_aligned irq_cpustat_t;
13-
14-
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
15-
16-
/*
17-
* We put the hardirq and softirq counter into the preemption
18-
* counter. The bitmask has the following meaning:
19-
*
20-
* - bits 0-7 are the preemption count (max preemption depth: 256)
21-
* - bits 8-15 are the softirq count (max # of softirqs: 256)
22-
* - bits 16-23 are the hardirq count (max # of hardirqs: 256)
23-
*
24-
* - ( bit 26 is the PREEMPT_ACTIVE flag. )
25-
*
26-
* PREEMPT_MASK: 0x000000ff
27-
* HARDIRQ_MASK: 0x0000ff00
28-
* SOFTIRQ_MASK: 0x00ff0000
29-
*/
30-
31-
#if NR_IRQS > 256
32-
#define HARDIRQ_BITS 9
33-
#else
34-
#define HARDIRQ_BITS 8
35-
#endif
36-
37-
#ifdef NR_IRQS
38-
# if (1 << HARDIRQ_BITS) < NR_IRQS
39-
# error HARDIRQ_BITS is too low!
40-
# endif
41-
#endif
42-
434
#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
445

456
extern void ack_bad_irq(unsigned int irq);
7+
#define ack_bad_irq ack_bad_irq
8+
9+
#include <asm-generic/hardirq.h>
4610

4711
#endif

‎arch/blackfin/include/asm/irq.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
: "d" (bfin_irq_flags) \
4646
)
4747

48-
static inline int irq_canonicalize(int irq)
49-
{
50-
return irq;
51-
}
48+
#include <asm-generic/irq.h>
5249

5350
#endif /* _BFIN_IRQ_H_ */

‎arch/blackfin/include/asm/processor.h‎

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
*/
88
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
99

10+
#include <asm/ptrace.h>
1011
#include <asm/blackfin.h>
11-
#include <asm/segment.h>
12-
#include <linux/compiler.h>
1312

1413
static inline unsigned long rdusp(void)
1514
{
@@ -59,36 +58,8 @@ struct thread_struct {
5958
PS_S, 0, 0 \
6059
}
6160

62-
/*
63-
* Do necessary setup to start up a newly executed thread.
64-
*
65-
* pass the data segment into user programs if it exists,
66-
* it can't hurt anything as far as I can tell
67-
*/
68-
#ifndef CONFIG_SMP
69-
#define start_thread(_regs, _pc, _usp) \
70-
do { \
71-
set_fs(USER_DS); \
72-
(_regs)->pc = (_pc); \
73-
if (current->mm) \
74-
(_regs)->p5 = current->mm->start_data; \
75-
task_thread_info(current)->l1_task_info.stack_start \
76-
= (void *)current->mm->context.stack_start; \
77-
task_thread_info(current)->l1_task_info.lowest_sp = (void *)(_usp); \
78-
memcpy(L1_SCRATCH_TASK_INFO, &task_thread_info(current)->l1_task_info, \
79-
sizeof(*L1_SCRATCH_TASK_INFO)); \
80-
wrusp(_usp); \
81-
} while(0)
82-
#else
83-
#define start_thread(_regs, _pc, _usp) \
84-
do { \
85-
set_fs(USER_DS); \
86-
(_regs)->pc = (_pc); \
87-
if (current->mm) \
88-
(_regs)->p5 = current->mm->start_data; \
89-
wrusp(_usp); \
90-
} while (0)
91-
#endif
61+
extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
62+
unsigned long new_sp);
9263

9364
/* Forward declaration, a strange C thing */
9465
struct task_struct;

‎arch/blackfin/kernel/process.c‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,29 @@ pid_t kernel_thread(int (*fn) (void *), void *arg, unsigned long flags)
160160
}
161161
EXPORT_SYMBOL(kernel_thread);
162162

163+
/*
164+
* Do necessary setup to start up a newly executed thread.
165+
*
166+
* pass the data segment into user programs if it exists,
167+
* it can't hurt anything as far as I can tell
168+
*/
169+
void start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
170+
{
171+
set_fs(USER_DS);
172+
regs->pc = new_ip;
173+
if (current->mm)
174+
regs->p5 = current->mm->start_data;
175+
#ifdef CONFIG_SMP
176+
task_thread_info(current)->l1_task_info.stack_start =
177+
(void *)current->mm->context.stack_start;
178+
task_thread_info(current)->l1_task_info.lowest_sp = (void *)new_sp;
179+
memcpy(L1_SCRATCH_TASK_INFO, &task_thread_info(current)->l1_task_info,
180+
sizeof(*L1_SCRATCH_TASK_INFO));
181+
#endif
182+
wrusp(new_sp);
183+
}
184+
EXPORT_SYMBOL_GPL(start_thread);
185+
163186
void flush_thread(void)
164187
{
165188
}

0 commit comments

Comments
 (0)