Add memory barriers.

This commit is contained in:
cl 2004-04-25 18:30:55 +00:00
parent 24cedfbba2
commit b336bf8532
1 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor.h,v 1.5 2004/04/24 18:24:14 cl Exp $ */
/* $NetBSD: hypervisor.h,v 1.6 2004/04/25 18:30:55 cl Exp $ */
/*
*
@ -79,7 +79,7 @@ static inline int HYPERVISOR_set_trap_table(trap_info_t *table)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_set_trap_table),
"b" (table) );
"b" (table) : "memory" );
return ret;
}
@ -90,7 +90,7 @@ static inline int HYPERVISOR_mmu_update(mmu_update_t *req, int count)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_mmu_update),
"b" (req), "c" (count) );
"b" (req), "c" (count) : "memory" );
if (__predict_false(ret < 0))
panic("Failed mmu update: %p, %d", req, count);
@ -104,7 +104,7 @@ static inline int HYPERVISOR_console_write(const char *str, int count)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_console_write),
"b" (str), "c" (count) );
"b" (str), "c" (count) : "memory" );
return ret;
@ -116,7 +116,7 @@ static inline int HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_set_gdt),
"b" (frame_list), "c" (entries) );
"b" (frame_list), "c" (entries) : "memory" );
return ret;
@ -163,7 +163,7 @@ static inline int HYPERVISOR_fpu_taskswitch(void)
int ret;
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_fpu_taskswitch) );
: "=a" (ret) : "0" (__HYPERVISOR_fpu_taskswitch) : "memory" );
return ret;
}
@ -174,7 +174,7 @@ static inline int HYPERVISOR_yield(void)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_sched_op),
"b" (SCHEDOP_yield) );
"b" (SCHEDOP_yield) : "memory" );
return ret;
}
@ -185,7 +185,7 @@ static inline int HYPERVISOR_exit(void)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_sched_op),
"b" (SCHEDOP_exit) );
"b" (SCHEDOP_exit) : "memory" );
return ret;
}
@ -242,7 +242,7 @@ static inline int HYPERVISOR_set_debugreg(int reg, unsigned long value)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_set_debugreg),
"b" (reg), "c" (value) );
"b" (reg), "c" (value) : "memory" );
return ret;
}
@ -253,7 +253,7 @@ static inline unsigned long HYPERVISOR_get_debugreg(int reg)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_get_debugreg),
"b" (reg) );
"b" (reg) : "memory" );
return ret;
}
@ -265,7 +265,7 @@ static inline int HYPERVISOR_update_descriptor(
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_update_descriptor),
"b" (pa), "c" (word1), "d" (word2) );
"b" (pa), "c" (word1), "d" (word2) : "memory" );
return ret;
}
@ -276,7 +276,7 @@ static inline int HYPERVISOR_set_fast_trap(int idx)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_set_fast_trap),
"b" (idx) );
"b" (idx) : "memory" );
return ret;
}
@ -309,7 +309,7 @@ static inline long HYPERVISOR_kbd_op(unsigned char op, unsigned char val)
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_kbd_op),
"b" (op), "c" (val) );
"b" (op), "c" (val) : "memory" );
return ret;
}
@ -321,7 +321,7 @@ static inline int HYPERVISOR_update_va_mapping(
__asm__ __volatile__ (
TRAP_INSTR
: "=a" (ret) : "0" (__HYPERVISOR_update_va_mapping),
"b" (page_nr), "c" (new_val), "d" (flags) );
"b" (page_nr), "c" (new_val), "d" (flags) : "memory" );
if (__predict_false(ret < 0))
panic("Failed update VA mapping: %08lx, %08lx, %08lx",