Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218705
b: refs/heads/master
c: 9f200d3
h: refs/heads/master
i:
  218703: c20cf45
v: v3
  • Loading branch information
Akira Takeuchi authored and David Howells committed Oct 27, 2010
1 parent a73d6a0 commit ff1d99a
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f59f7d23c912f10ff8767b354a4c5f672a99d76
refs/heads/master: 9f200d3fed9ca34e94ee03df049f7dcd71538acf
77 changes: 77 additions & 0 deletions trunk/arch/mn10300/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,82 @@ static inline void arch_safe_halt(void)
: "cc");
}

static inline void arch_local_cli(void)
{
asm volatile(
" and %0,epsw \n"
" nop \n"
" nop \n"
" nop \n"
:
: "i"(~EPSW_IE)
: "memory"
);
}

static inline unsigned long arch_local_cli_save(void)
{
unsigned long flags = arch_local_save_flags();
arch_local_cli();
return flags;
}

static inline void arch_local_sti(void)
{
asm volatile(
" or %0,epsw \n"
:
: "i"(EPSW_IE)
: "memory");
}

static inline void arch_local_change_intr_mask_level(unsigned long level)
{
asm volatile(
" and %0,epsw \n"
" or %1,epsw \n"
:
: "i"(~EPSW_IM), "i"(EPSW_IE | level)
: "cc", "memory");
}

#else /* !__ASSEMBLY__ */

#define LOCAL_SAVE_FLAGS(reg) \
mov epsw,reg

#define LOCAL_IRQ_DISABLE \
and ~EPSW_IM,epsw; \
or EPSW_IE|MN10300_CLI_LEVEL,epsw; \
nop; \
nop; \
nop

#define LOCAL_IRQ_ENABLE \
or EPSW_IE|EPSW_IM_7,epsw

#define LOCAL_IRQ_RESTORE(reg) \
mov reg,epsw

#define LOCAL_CLI_SAVE(reg) \
mov epsw,reg; \
and ~EPSW_IE,epsw; \
nop; \
nop; \
nop

#define LOCAL_CLI \
and ~EPSW_IE,epsw; \
nop; \
nop; \
nop

#define LOCAL_STI \
or EPSW_IE,epsw

#define LOCAL_CHANGE_INTR_MASK_LEVEL(level) \
and ~EPSW_IM,epsw; \
or EPSW_IE|(level),epsw

#endif /* __ASSEMBLY__ */
#endif /* _ASM_IRQFLAGS_H */

0 comments on commit ff1d99a

Please sign in to comment.