interrupt_control.S
4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "os_type.h"
#if 1//ndef RTOS_ENABLE
//#include "xtensa_rtos.h"
#include <xtensa/config/core.h>
#include "xtensa_context.h"
//#define INT_DISABLE XCHAL_EXCM_LEVEL /* Disable interrupts value */
#define INT_DISABLE 3 /* Disable interrupts value */
#define INT_ENABLE 0x0 /* Enable interrupt value */
.text
/* .section .interrupt_control_text, "ax"*/
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_interrupt_control */
/* 5.1 */
/* AUTHOR */
/* */
/* */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for changing the interrupt lockout */
/* posture of the system. */
/* */
/* INPUT */
/* */
/* new_posture New interrupt lockout posture */
/* */
/* OUTPUT */
/* */
/* old_posture Old interrupt lockout posture */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* Application Code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 10-10-2006 Ross Morley Initial Version 5.0 */
/* 04-02-2007 Ross Morley Modified comment(s), */
/* resulting in version 5.1 */
/* */
/**************************************************************************/
// UINT _tx_interrupt_control(unsigned long new_posture)
// {
.section .internal_ram_1_text, "ax"
.globl _interrupt_control
.type _interrupt_control, @function
.align 4
_interrupt_control:
ENTRY0
rsr a3, PS /* old PS */
#if PS_INTLEVEL_SHIFT != 0
ssli a2, a2, PS_INTLEVEL_SHIFT /* param is new intlevel */
#endif
movi a5, PS_INTLEVEL_MASK
and a4, a2, a5 /* new INTLEVEL field of PS */
and a2, a3, a5 /* old INTLEVEL field of PS */
sub a3, a3, a2 /* remove old INTLEVEL field */
add a3, a3, a4 /* insert new INTLEVEL field */
wsr a3, PS /* write it to PS */
#if PS_INTLEVEL_SHIFT != 0
srli a2, a2, PS_INTLEVEL_SHIFT /* return old intlevel */
#endif
rsync /* wait till new level effective */
RET0
// }
#endif