Subversion Repositories HelenOS

Rev

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

Rev 2787 Rev 3536
Line 42... Line 42...
42
 
42
 
43
#define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL
43
#define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL
44
 
44
 
45
static inline void  outb(uint64_t port,uint8_t v)
45
static inline void  outb(uint64_t port,uint8_t v)
46
{
46
{
47
    *((char *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 )))) = v;
47
    *((uint8_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 )))) = v;
48
 
48
 
49
    asm volatile ("mf\n" ::: "memory");
49
    asm volatile ("mf\n" ::: "memory");
50
}
50
}
51
 
51
 
-
 
52
static inline void  outw(uint64_t port,uint16_t v)
-
 
53
{
-
 
54
    *((uint16_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 )))) = v;
-
 
55
 
-
 
56
    asm volatile ("mf\n" ::: "memory");
-
 
57
}
-
 
58
 
-
 
59
static inline void  outl(uint64_t port,uint32_t v)
-
 
60
{
-
 
61
    *((uint32_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 )))) = v;
-
 
62
 
-
 
63
    asm volatile ("mf\n" ::: "memory");
-
 
64
}
-
 
65
 
-
 
66
 
52
 
67
 
53
static inline uint8_t inb(uint64_t port)
68
static inline uint8_t inb(uint64_t port)
54
{
69
{
55
    asm volatile ("mf\n" ::: "memory");
70
    asm volatile ("mf\n" ::: "memory");
56
 
71
 
57
    return *((char *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 ))));
72
    return *((uint8_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 ))));
-
 
73
}
-
 
74
 
-
 
75
static inline uint16_t inw(uint64_t port)
-
 
76
{
-
 
77
    asm volatile ("mf\n" ::: "memory");
-
 
78
 
-
 
79
    return *((uint16_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xffE) | ( (port >> 2) << 12 ))));
-
 
80
}
-
 
81
 
-
 
82
static inline uint32_t inl(uint64_t port)
-
 
83
{
-
 
84
    asm volatile ("mf\n" ::: "memory");
-
 
85
 
-
 
86
    return *((uint32_t *)(IA64_IOSPACE_ADDRESS + ( (port & 0xfff) | ( (port >> 2) << 12 ))));
58
}
87
}
59
 
88
 
60
 
89
 
61
 
90
 
62
/** Return base address of current stack
91
/** Return base address of current stack