Subversion Repositories HelenOS

Rev

Rev 1268 | Rev 1374 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1268 Rev 1283
Line 37... Line 37...
37
 * Enable interrupts and return previous
37
 * Enable interrupts and return previous
38
 * value of EE.
38
 * value of EE.
39
 *
39
 *
40
 * @return Old interrupt priority level.
40
 * @return Old interrupt priority level.
41
 */
41
 */
42
static inline ipl_t interrupts_enable(void) {
42
static inline ipl_t interrupts_enable(void)
-
 
43
{
43
    ipl_t v;
44
    ipl_t v;
44
    ipl_t tmp;
45
    ipl_t tmp;
45
   
46
   
46
    asm volatile (
47
    asm volatile (
47
        "mfmsr %0\n"
48
        "mfmsr %0\n"
Line 58... Line 59...
58
 * Disable interrupts and return previous
59
 * Disable interrupts and return previous
59
 * value of EE.
60
 * value of EE.
60
 *
61
 *
61
 * @return Old interrupt priority level.
62
 * @return Old interrupt priority level.
62
 */
63
 */
63
static inline ipl_t interrupts_disable(void) {
64
static inline ipl_t interrupts_disable(void)
-
 
65
{
64
    ipl_t v;
66
    ipl_t v;
65
    ipl_t tmp;
67
    ipl_t tmp;
66
   
68
   
67
    asm volatile (
69
    asm volatile (
68
        "mfmsr %0\n"
70
        "mfmsr %0\n"
Line 78... Line 80...
78
 *
80
 *
79
 * Restore EE.
81
 * Restore EE.
80
 *
82
 *
81
 * @param ipl Saved interrupt priority level.
83
 * @param ipl Saved interrupt priority level.
82
 */
84
 */
83
static inline void interrupts_restore(ipl_t ipl) {
85
static inline void interrupts_restore(ipl_t ipl)
-
 
86
{
84
    ipl_t tmp;
87
    ipl_t tmp;
85
   
88
   
86
    asm volatile (
89
    asm volatile (
87
        "mfmsr %1\n"
90
        "mfmsr %1\n"
88
        "rlwimi  %0, %1, 0, 17, 15\n"
91
        "rlwimi  %0, %1, 0, 17, 15\n"
Line 90... Line 93...
90
        "beq 0f\n"
93
        "beq 0f\n"
91
        "mtmsr %0\n"
94
        "mtmsr %0\n"
92
        "0:\n"
95
        "0:\n"
93
        : "=r" (ipl), "=r" (tmp)
96
        : "=r" (ipl), "=r" (tmp)
94
        : "0" (ipl)
97
        : "0" (ipl)
-
 
98
        : "cr0"
95
    );
99
    );
96
}
100
}
97
 
101
 
98
/** Return interrupt priority level.
102
/** Return interrupt priority level.
99
 *
103
 *
100
 * Return EE.
104
 * Return EE.
101
 *
105
 *
102
 * @return Current interrupt priority level.
106
 * @return Current interrupt priority level.
103
 */
107
 */
104
static inline ipl_t interrupts_read(void) {
108
static inline ipl_t interrupts_read(void)
-
 
109
{
105
    ipl_t v;
110
    ipl_t v;
106
   
111
   
107
    asm volatile (
112
    asm volatile (
108
        "mfmsr %0\n"
113
        "mfmsr %0\n"
109
        : "=r" (v)
114
        : "=r" (v)