Subversion Repositories HelenOS

Rev

Rev 4345 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4345 Rev 4346
Line 67... Line 67...
67
    asm volatile ("hlt\n");
67
    asm volatile ("hlt\n");
68
}
68
}
69
 
69
 
70
static inline void cpu_halt(void)
70
static inline void cpu_halt(void)
71
{
71
{
72
    asm volatile ("hlt\n");
72
    asm volatile (
-
 
73
        "0:\n"
-
 
74
        "   hlt\n"
-
 
75
        "   jmp 0b\n"
-
 
76
    );
73
}
77
}
74
 
78
 
75
 
79
 
76
/** Byte from port
80
/** Byte from port
77
 *
81
 *
Line 336... Line 340...
336
/** Load GDTR register from memory.
340
/** Load GDTR register from memory.
337
 *
341
 *
338
 * @param gdtr_reg Address of memory from where to load GDTR.
342
 * @param gdtr_reg Address of memory from where to load GDTR.
339
 *
343
 *
340
 */
344
 */
341
static inline void gdtr_load(struct ptr_16_64 *gdtr_reg)
345
static inline void gdtr_load(ptr_16_64_t *gdtr_reg)
342
{
346
{
343
    asm volatile (
347
    asm volatile (
344
        "lgdtq %[gdtr_reg]\n"
348
        "lgdtq %[gdtr_reg]\n"
345
        :: [gdtr_reg] "m" (*gdtr_reg)
349
        :: [gdtr_reg] "m" (*gdtr_reg)
346
    );
350
    );
Line 349... Line 353...
349
/** Store GDTR register to memory.
353
/** Store GDTR register to memory.
350
 *
354
 *
351
 * @param gdtr_reg Address of memory to where to load GDTR.
355
 * @param gdtr_reg Address of memory to where to load GDTR.
352
 *
356
 *
353
 */
357
 */
354
static inline void gdtr_store(struct ptr_16_64 *gdtr_reg)
358
static inline void gdtr_store(ptr_16_64_t *gdtr_reg)
355
{
359
{
356
    asm volatile (
360
    asm volatile (
357
        "sgdtq %[gdtr_reg]\n"
361
        "sgdtq %[gdtr_reg]\n"
358
        :: [gdtr_reg] "m" (*gdtr_reg)
362
        :: [gdtr_reg] "m" (*gdtr_reg)
359
    );
363
    );
Line 362... Line 366...
362
/** Load IDTR register from memory.
366
/** Load IDTR register from memory.
363
 *
367
 *
364
 * @param idtr_reg Address of memory from where to load IDTR.
368
 * @param idtr_reg Address of memory from where to load IDTR.
365
 *
369
 *
366
 */
370
 */
367
static inline void idtr_load(struct ptr_16_64 *idtr_reg)
371
static inline void idtr_load(ptr_16_64_t *idtr_reg)
368
{
372
{
369
    asm volatile (
373
    asm volatile (
370
        "lidtq %[idtr_reg]\n"
374
        "lidtq %[idtr_reg]\n"
371
        :: [idtr_reg] "m" (*idtr_reg));
375
        :: [idtr_reg] "m" (*idtr_reg));
372
}
376
}