Subversion Repositories Kolibri OS

Rev

Rev 862 | Rev 888 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 862 Rev 886
Line 35... Line 35...
35
static inline eflags_t safe_cli(void)
35
static inline eflags_t safe_cli(void)
36
{
36
{
37
  eflags_t tmp;
37
  eflags_t tmp;
38
	asm volatile (
38
	asm volatile (
39
    "pushf\n\t"
39
    "pushfl\n\t"
40
    "pop %0\n\t"
40
    "popl %0\n\t"
41
		"cli\n"
41
		"cli\n"
42
    : "=r" (tmp)
42
    : "=r" (tmp)
43
	);
43
	);
44
  return tmp;
44
  return tmp;
45
}
45
}
Line 46... Line 46...
46
 
46
 
47
static inline void safe_sti(eflags_t efl)
47
static inline void safe_sti(eflags_t efl)
48
{
48
{
49
	asm volatile (
49
	asm volatile (
50
    "push %0\n\t"
50
    "pushl %0\n\t"
51
		"popf\n"
51
    "popfl\n"
52
    : : "r" (efl)
52
    : : "r" (efl)
53
	);
53
	);
Line 54... Line 54...
54
}
54
}
55
 
55
 
56
static inline count_t fnzb(u32_t arg)
56
static inline count_t fnzb(u32_t arg)
57
{
57
{
58
  count_t n;
58
  count_t n;
59
  asm volatile ("xor %0, %0 \n\t"
59
  asm volatile ("xorl %0, %0 \n\t"
60
                "bsr %0, %1"
60
                "bsr %1, %0"
61
                :"=&r" (n)
61
                :"=&r" (n)
62
                :"r"(arg)
62
                :"r"(arg)
63
                );
63
                );
Line 64... Line 64...
64
	return n;
64
	return n;
65
}
65
}
66
 
66
 
67
static inline count_t _bsf(u32_t arg)
67
static inline count_t _bsf(u32_t arg)
68
{
68
{
69
  count_t n;
69
  count_t n;
70
  asm volatile ("xor %0, %0 \n\t"
70
  asm volatile ("xorl %0, %0 \n\t"
71
                "bsf %0, %1"
71
                "bsf %1, %0"
72
                :"=&r" (n)
72
                :"=&r" (n)
73
                :"r"(arg)
73
                :"r"(arg)