Subversion Repositories HelenOS

Rev

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

Rev 201 Rev 204
Line 38... Line 38...
38
 * value of EE.
38
 * value of EE.
39
 */
39
 */
40
static inline pri_t cpu_priority_low(void) {
40
static inline pri_t cpu_priority_low(void) {
41
    pri_t v;
41
    pri_t v;
42
    __asm__ volatile (
42
    __asm__ volatile (
43
        "\n"
43
        "mfmsr %0\n"
-
 
44
        "mfmsr %%r31\n"
-
 
45
        "ori %%r31, %%r31, 1 << 15\n"
-
 
46
        "mtmsr %%r31\n"
44
        : "=r" (v)
47
        : "=r" (v)
-
 
48
        :
-
 
49
        : "%r31"
45
    );
50
    );
46
    return v;
51
    return v;
47
}
52
}
48
 
53
 
49
/** Set priority level high
54
/** Set priority level high
Line 52... Line 57...
52
 * value of EE.
57
 * value of EE.
53
 */
58
 */
54
static inline pri_t cpu_priority_high(void) {
59
static inline pri_t cpu_priority_high(void) {
55
    pri_t v;
60
    pri_t v;
56
    __asm__ volatile (
61
    __asm__ volatile (
57
        "\n"
62
        "mfmsr %0\n"
-
 
63
        "mfmsr %%r31\n"
-
 
64
        "rlwinm %%r31, %%r31, 0, 17, 15\n"
-
 
65
        "mtmsr %%r31\n"
58
        : "=r" (v)
66
        : "=r" (v)
-
 
67
        :
-
 
68
        : "%r31"
59
    );
69
    );
60
    return v;
70
    return v;
61
}
71
}
62
 
72
 
63
/** Restore priority level
73
/** Restore priority level
64
 *
74
 *
65
 * Restore EE.
75
 * Restore EE.
66
 */
76
 */
67
static inline void cpu_priority_restore(pri_t pri) {
77
static inline void cpu_priority_restore(pri_t pri) {
68
    __asm__ volatile (
78
    __asm__ volatile (
-
 
79
        "mfmsr %%r31\n"
-
 
80
        "rlwimi  %0, %%r31, 0, 17, 15\n"
69
        "\n"
81
        "mtmsr %0\n"
70
        : : "r" (pri)
82
        : "=r" (pri)
-
 
83
        : "0" (pri)
-
 
84
        : "%r31"
71
    );
85
    );
72
}
86
}
73
 
87
 
74
/* TODO: implement the real stuff */
88
/* TODO: implement the real stuff */
75
static inline __address get_stack_base(void)
89
static inline __address get_stack_base(void)