Subversion Repositories HelenOS

Rev

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

Rev 2927 Rev 2955
Line 49... Line 49...
49
#define CS_ENTER_BARRIER()  asm volatile ("" ::: "memory")
49
#define CS_ENTER_BARRIER()  asm volatile ("" ::: "memory")
50
#define CS_LEAVE_BARRIER()  asm volatile ("" ::: "memory")
50
#define CS_LEAVE_BARRIER()  asm volatile ("" ::: "memory")
51
 
51
 
52
static inline void cpuid_serialization(void)
52
static inline void cpuid_serialization(void)
53
{
53
{
-
 
54
#ifndef __PIC__
54
    asm volatile (
55
    asm volatile (
55
        "xorl %%eax, %%eax\n"
56
        "xorl %%eax, %%eax\n"
56
        "cpuid\n"
57
        "cpuid\n"
57
        ::: "eax", "ebx", "ecx", "edx", "memory"
58
        ::: "eax", "ebx", "ecx", "edx", "memory"
58
    );
59
    );
-
 
60
#else
-
 
61
    /* Must not clobber PIC register ebx */
-
 
62
    asm volatile (
-
 
63
        "movl %%ebx, %%esi\n"
-
 
64
        "xorl %%eax, %%eax\n"
-
 
65
        "cpuid\n"
-
 
66
        "movl %%esi, %%ebx\n"
-
 
67
        ::: "eax", "ecx", "edx", "esi", "memory"
-
 
68
    );
-
 
69
#endif
59
}
70
}
60
 
71
 
61
#ifdef CONFIG_FENCES_P4
72
#ifdef CONFIG_FENCES_P4
62
#   define memory_barrier()     asm volatile ("mfence\n" ::: "memory")
73
#   define memory_barrier()     asm volatile ("mfence\n" ::: "memory")
63
#   define read_barrier()       asm volatile ("lfence\n" ::: "memory")
74
#   define read_barrier()       asm volatile ("lfence\n" ::: "memory")