Subversion Repositories HelenOS

Rev

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

Rev 353 Rev 356
Line 36... Line 36...
36
 
36
 
37
extern void paging_on(void);
37
extern void paging_on(void);
38
 
38
 
39
extern void interrupt_handlers(void);
39
extern void interrupt_handlers(void);
40
 
40
 
41
extern __u8 inb(int port);
-
 
42
extern __u16 inw(int port);
-
 
43
extern __u32 inl(int port);
-
 
44
 
-
 
45
extern void enable_l_apic_in_msr(void);
41
extern void enable_l_apic_in_msr(void);
46
 
42
 
47
 
43
 
48
void asm_delay_loop(__u32 t);
44
void asm_delay_loop(__u32 t);
49
void asm_fake_loop(__u32 t);
45
void asm_fake_loop(__u32 t);
Line 96... Line 92...
96
 * @param port Port to write to
92
 * @param port Port to write to
97
 * @param val Value to write
93
 * @param val Value to write
98
 */
94
 */
99
static inline void outw(__u16 port, __u16 val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }
95
static inline void outw(__u16 port, __u16 val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }
100
 
96
 
101
 
-
 
102
 
-
 
103
/** Double word to port
97
/** Double word to port
104
 *
98
 *
105
 * Output double word to port
99
 * Output double word to port
106
 *
100
 *
107
 * @param port Port to write to
101
 * @param port Port to write to
108
 * @param val Value to write
102
 * @param val Value to write
109
 */
103
 */
110
static inline void outl(__u16 port, __u32 val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }
104
static inline void outl(__u16 port, __u32 val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }
111
 
105
 
-
 
106
/** Byte from port
-
 
107
 *
-
 
108
 * Get byte from port
-
 
109
 *
-
 
110
 * @param port Port to read from
-
 
111
 * @return Value read
-
 
112
 */
-
 
113
static inline __u8 inb(__u16 port) { __u8 val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }
-
 
114
 
-
 
115
/** Word from port
-
 
116
 *
-
 
117
 * Get word from port
-
 
118
 *
-
 
119
 * @param port Port to read from
-
 
120
 * @return Value read
-
 
121
 */
-
 
122
static inline __u16 inw(__u16 port) { __u16 val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }
-
 
123
 
-
 
124
/** Double word from port
-
 
125
 *
-
 
126
 * Get double word from port
-
 
127
 *
-
 
128
 * @param port Port to read from
-
 
129
 * @return Value read
-
 
130
 */
-
 
131
static inline __u32 inl(__u16 port) { __u32 val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }
-
 
132
 
112
/** Set priority level low
133
/** Set priority level low
113
 *
134
 *
114
 * Enable interrupts and return previous
135
 * Enable interrupts and return previous
115
 * value of EFLAGS.
136
 * value of EFLAGS.
116
 */
137
 */