Subversion Repositories HelenOS-historic

Rev

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

Rev 200 Rev 206
Line 32... Line 32...
32
#include <arch/types.h>
32
#include <arch/types.h>
33
#include <config.h>
33
#include <config.h>
34
 
34
 
35
 
35
 
36
void asm_delay_loop(__u32 t);
36
void asm_delay_loop(__u32 t);
-
 
37
void asm_fake_loop(__u32 t);
-
 
38
 
37
 
39
 
38
/* TODO: implement the real stuff */
40
/* TODO: implement the real stuff */
39
static inline __address get_stack_base(void)
41
static inline __address get_stack_base(void)
40
{
42
{
41
    return NULL;
43
    return NULL;
Line 52... Line 54...
52
        "mov %0, %%dx;"
54
        "mov %0, %%dx;"
53
        "inb %%dx,%%al;"
55
        "inb %%dx,%%al;"
54
        "mov %%al, %1;"
56
        "mov %%al, %1;"
55
        :"=m"(out)
57
        :"=m"(out)
56
        :"m"(port)
58
        :"m"(port)
57
        :"dx","al"
59
        :"%dx","%al"
58
        );
60
        );
59
    return out;
61
    return out;
60
}
62
}
61
 
63
 
62
static inline __u8 outb(__u16 port,__u8 b)
64
static inline __u8 outb(__u16 port,__u8 b)
Line 65... Line 67...
65
        "mov %0,%%dx;"
67
        "mov %0,%%dx;"
66
        "mov %1,%%al;"
68
        "mov %1,%%al;"
67
        "outb %%al,%%dx;"
69
        "outb %%al,%%dx;"
68
        :
70
        :
69
        :"m"( port), "m" (b)
71
        :"m"( port), "m" (b)
70
        :"dx","al"
72
        :"%dx","%al"
71
        );
73
        );
72
}
74
}
73
 
75
 
74
/** Set priority level low
76
/** Set priority level low
75
 *
77
 *
Line 113... Line 115...
113
        "popfq\n"
115
        "popfq\n"
114
        : : "r" (pri)
116
        : : "r" (pri)
115
        );
117
        );
116
}
118
}
117
 
119
 
-
 
120
/** Return raw priority level
-
 
121
 *
-
 
122
 * Return EFLAFS.
-
 
123
 */
-
 
124
static inline pri_t cpu_priority_read(void) {
-
 
125
    pri_t v;
-
 
126
    __asm__ volatile (
-
 
127
        "pushfq\n"
-
 
128
        "popq %0\n"
-
 
129
        : "=r" (v)
-
 
130
    );
-
 
131
    return v;
-
 
132
}
-
 
133
 
-
 
134
extern size_t interrupt_handler_size;
-
 
135
extern void interrupt_handlers(void);
118
 
136
 
119
#endif
137
#endif