1: /*
2: *----------------------------------------------------------------------
3: * T-Kernel 2.0 Software Package
4: *
5: * Copyright 2011 by Ken Sakamura.
6: * This software is distributed under the latest version of T-License 2.x.
7: *----------------------------------------------------------------------
8: *
9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
11: *
12: *----------------------------------------------------------------------
13: */
14:
15: /*
16: * @(#)disint.S (libtk/EM1-D512)
17: *
18: * Enable/disable external interrupt
19: */
20:
21: #include <machine.h>
22: #include <tk/sysdef.h>
23:
24: /*
25: * Disable external interrupt
26: * UINT disint( void )
27: * CPSR interrupt flag is in disabled status.
28: * Return value is CPSR prior to change.
29: */
30: .text
31: .balign 4
32: .globl Csym(disint)
33: .type Csym(disint), %function
34: Csym(disint):
35: mrs r0, cpsr
36: orr ip, r0, #PSR_DI
37: msr cpsr_xc, ip
38: bx lr
39:
40:
41: /*
42: * Enable external interrupt (restore to original state)
43: * UINT enaint( UINT intsts )
44: * Updates CPSR interrupt disabled flag with the intsts interrupt
45: * disabled flag.
46: * CPSR remains unchanged apart from the interrupt disabled flag.
47: * The return value is CPSR prior to change.
48: */
49: .text
50: .balign 4
51: .globl Csym(enaint)
52: .type Csym(enaint), %function
53: Csym(enaint):
54: and r3, r0, #PSR_DI
55: mrs r0, cpsr
56: bic r2, r0, #PSR_DI
57: orr r2, r2, r3
58: msr cpsr_xc, r2
59: bx lr