From d49423aea3f6e8edbb24bcc5c434543fc91f2a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 13 Dec 2005 01:49:44 +0000 Subject: [PATCH] Added a wbinvd() macro. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15526 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/arch_cpu.h | 41 ++++++++++++---------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index 36656399e2..9be7d91885 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -124,46 +124,49 @@ struct tss *x86_get_main_tss(void); #define invalidate_TLB(va) \ __asm__("invlpg (%0)" : : "r" (va)) +#define wbinvd() \ + __asm__("wbinvd") + #define out8(value,port) \ -__asm__ ("outb %%al,%%dx" : : "a" (value), "d" (port)) + __asm__ ("outb %%al,%%dx" : : "a" (value), "d" (port)) #define out16(value,port) \ -__asm__ ("outw %%ax,%%dx" : : "a" (value), "d" (port)) + __asm__ ("outw %%ax,%%dx" : : "a" (value), "d" (port)) #define out32(value,port) \ -__asm__ ("outl %%eax,%%dx" : : "a" (value), "d" (port)) + __asm__ ("outl %%eax,%%dx" : : "a" (value), "d" (port)) #define in8(port) ({ \ -uint8 _v; \ -__asm__ volatile ("inb %%dx,%%al" : "=a" (_v) : "d" (port)); \ -_v; \ + uint8 _v; \ + __asm__ volatile ("inb %%dx,%%al" : "=a" (_v) : "d" (port)); \ + _v; \ }) #define in16(port) ({ \ -uint16 _v; \ -__asm__ volatile ("inw %%dx,%%ax":"=a" (_v) : "d" (port)); \ -_v; \ + uint16 _v; \ + __asm__ volatile ("inw %%dx,%%ax":"=a" (_v) : "d" (port)); \ + _v; \ }) #define in32(port) ({ \ -uint32 _v; \ -__asm__ volatile ("inl %%dx,%%eax":"=a" (_v) : "d" (port)); \ -_v; \ + uint32 _v; \ + __asm__ volatile ("inl %%dx,%%eax":"=a" (_v) : "d" (port)); \ + _v; \ }) #define out8_p(value,port) \ -__asm__ ("outb %%al,%%dx\n" \ + __asm__ ("outb %%al,%%dx\n" \ "\tjmp 1f\n" \ "1:\tjmp 1f\n" \ "1:" : : "a" (value), "d" (port)) #define in8_p(port) ({ \ -uint8 _v; \ -__asm__ volatile ("inb %%dx,%%al\n" \ - "\tjmp 1f\n" \ - "1:\tjmp 1f\n" \ - "1:" : "=a" (_v) : "d" (port)); \ -_v; \ + uint8 _v; \ + __asm__ volatile ("inb %%dx,%%al\n" \ + "\tjmp 1f\n" \ + "1:\tjmp 1f\n" \ + "1:" : "=a" (_v) : "d" (port)); \ + _v; \ }) extern segment_descriptor *gGDT;