Subversion Repositories HelenOS-historic

Rev

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

Rev 1072 Rev 1186
Line 27... Line 27...
27
 */
27
 */
28
 
28
 
29
#ifndef __amd64_ASM_H__
29
#ifndef __amd64_ASM_H__
30
#define __amd64_ASM_H__
30
#define __amd64_ASM_H__
31
 
31
 
-
 
32
#include <arch/pm.h>
32
#include <arch/types.h>
33
#include <arch/types.h>
33
#include <config.h>
34
#include <config.h>
34
 
35
 
35
extern void asm_delay_loop(__u32 t);
36
extern void asm_delay_loop(__u32 t);
36
extern void asm_fake_loop(__u32 t);
37
extern void asm_fake_loop(__u32 t);
Line 195... Line 196...
195
 *
196
 *
196
 * @param addr Address on a page whose TLB entry is to be invalidated.
197
 * @param addr Address on a page whose TLB entry is to be invalidated.
197
 */
198
 */
198
static inline void invlpg(__address addr)
199
static inline void invlpg(__address addr)
199
{
200
{
200
        __asm__ volatile ("invlpg %0\n" :: "m" (*((__native *)addr)));
201
    __asm__ volatile ("invlpg %0\n" :: "m" (*((__native *)addr)));
-
 
202
}
-
 
203
 
-
 
204
/** Load GDTR register from memory.
-
 
205
 *
-
 
206
 * @param gdtr_reg Address of memory from where to load GDTR.
-
 
207
 */
-
 
208
static inline void gdtr_load(struct ptr_16_64 *gdtr_reg)
-
 
209
{
-
 
210
    __asm__ volatile ("lgdt %0\n" : : "m" (*gdtr_reg));
-
 
211
}
-
 
212
 
-
 
213
/** Store GDTR register to memory.
-
 
214
 *
-
 
215
 * @param gdtr_reg Address of memory to where to load GDTR.
-
 
216
 */
-
 
217
static inline void gdtr_store(struct ptr_16_64 *gdtr_reg)
-
 
218
{
-
 
219
    __asm__ volatile ("sgdt %0\n" : : "m" (*gdtr_reg));
-
 
220
}
-
 
221
 
-
 
222
/** Load IDTR register from memory.
-
 
223
 *
-
 
224
 * @param idtr_reg Address of memory from where to load IDTR.
-
 
225
 */
-
 
226
static inline void idtr_load(struct ptr_16_64 *idtr_reg)
-
 
227
{
-
 
228
    __asm__ volatile ("lidt %0\n" : : "m" (*idtr_reg));
-
 
229
}
-
 
230
 
-
 
231
/** Load TR from descriptor table.
-
 
232
 *
-
 
233
 * @param sel Selector specifying descriptor of TSS segment.
-
 
234
 */
-
 
235
static inline void tr_load(__u16 sel)
-
 
236
{
-
 
237
    __asm__ volatile ("ltr %0" : : "r" (sel));
201
}
238
}
202
 
239
 
203
#define GEN_READ_REG(reg) static inline __native read_ ##reg (void) \
240
#define GEN_READ_REG(reg) static inline __native read_ ##reg (void) \
204
    { \
241
    { \
205
    __native res; \
242
    __native res; \