Subversion Repositories HelenOS

Rev

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

Rev 3479 Rev 3593
Line 40... Line 40...
40
#include <typedefs.h>
40
#include <typedefs.h>
41
#include <align.h>
41
#include <align.h>
42
#include <arch/register.h>
42
#include <arch/register.h>
43
#include <config.h>
43
#include <config.h>
44
#include <arch/stack.h>
44
#include <arch/stack.h>
-
 
45
#include <arch/barrier.h>
-
 
46
 
-
 
47
static inline void outb(ioport_t port, uint8_t v)
-
 
48
{
-
 
49
    *((volatile uint8_t *)(port)) = v;
-
 
50
    memory_barrier();
-
 
51
}
-
 
52
 
-
 
53
static inline void outw(ioport_t port, uint16_t v)
-
 
54
{
-
 
55
    *((volatile uint16_t *)(port)) = v;
-
 
56
    memory_barrier();
-
 
57
}
-
 
58
 
-
 
59
static inline void outl(ioport_t port, uint32_t v)
-
 
60
{
-
 
61
    *((volatile uint32_t *)(port)) = v;
-
 
62
    memory_barrier();
-
 
63
}
-
 
64
 
-
 
65
static inline uint8_t inb(ioport_t port)
-
 
66
{
-
 
67
    uint8_t rv;
-
 
68
 
-
 
69
    rv = *((volatile uint8_t *)(port));
-
 
70
    memory_barrier();
-
 
71
 
-
 
72
    return rv;
-
 
73
}
-
 
74
 
-
 
75
static inline uint16_t inw(ioport_t port)
-
 
76
{
-
 
77
    uint16_t rv;
-
 
78
 
-
 
79
    rv = *((volatile uint16_t *)(port));
-
 
80
    memory_barrier();
-
 
81
 
-
 
82
    return rv;
-
 
83
}
-
 
84
 
-
 
85
static inline uint32_t inl(ioport_t port)
-
 
86
{
-
 
87
    uint32_t rv;
-
 
88
 
-
 
89
    rv = *((volatile uint32_t *)(port));
-
 
90
    memory_barrier();
-
 
91
 
-
 
92
    return rv;
-
 
93
}
45
 
94
 
46
/** Read Processor State register.
95
/** Read Processor State register.
47
 *
96
 *
48
 * @return Value of PSTATE register.
97
 * @return Value of PSTATE register.
49
 */
98
 */