-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This converts the irq handling in the Blackfin arch from the old irq.h / system.h method to the new irqflags.h. A stepping stone on the way to other tracing functionality. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
- Loading branch information
Mike Frysinger
committed
Jun 13, 2009
1 parent
538067c
commit 8f86001
Showing
4 changed files
with
77 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* interface to Blackfin CEC | ||
* | ||
* Copyright 2009 Analog Devices Inc. | ||
* Licensed under the GPL-2 or later. | ||
*/ | ||
|
||
#ifndef __ASM_BFIN_IRQFLAGS_H__ | ||
#define __ASM_BFIN_IRQFLAGS_H__ | ||
|
||
#ifdef CONFIG_SMP | ||
# include <asm/pda.h> | ||
# include <asm/processor.h> | ||
/* Forward decl needed due to cdef inter dependencies */ | ||
static inline uint32_t __pure bfin_dspid(void); | ||
# define blackfin_core_id() (bfin_dspid() & 0xff) | ||
# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask | ||
#else | ||
extern unsigned long bfin_irq_flags; | ||
#endif | ||
|
||
static inline void bfin_sti(unsigned long flags) | ||
{ | ||
asm volatile("sti %0;" : : "d" (flags)); | ||
} | ||
|
||
static inline unsigned long bfin_cli(void) | ||
{ | ||
unsigned long flags; | ||
asm volatile("cli %0;" : "=d" (flags)); | ||
return flags; | ||
} | ||
|
||
static inline void raw_local_irq_disable(void) | ||
{ | ||
bfin_cli(); | ||
} | ||
static inline void raw_local_irq_enable(void) | ||
{ | ||
bfin_sti(bfin_irq_flags); | ||
} | ||
|
||
#define raw_local_save_flags(flags) do { (flags) = bfin_read_IMASK(); } while (0) | ||
|
||
#define raw_irqs_disabled_flags(flags) (((flags) & ~0x3f) == 0) | ||
|
||
static inline void raw_local_irq_restore(unsigned long flags) | ||
{ | ||
if (!raw_irqs_disabled_flags(flags)) | ||
raw_local_irq_enable(); | ||
} | ||
|
||
static inline unsigned long __raw_local_irq_save(void) | ||
{ | ||
unsigned long flags = bfin_cli(); | ||
#ifdef CONFIG_DEBUG_HWERR | ||
bfin_sti(0x3f); | ||
#endif | ||
return flags; | ||
} | ||
#define raw_local_irq_save(flags) do { (flags) = __raw_local_irq_save(); } while (0) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters