Subversion Repositories HelenOS

Rev

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

Rev 1816 Rev 1817
Line 31... Line 31...
31
 
31
 
32
#include <arch/types.h>
32
#include <arch/types.h>
33
#include <macros.h>
33
#include <macros.h>
34
 
34
 
35
 
35
 
-
 
36
typedef uint16_t domid_t;
-
 
37
 
-
 
38
typedef struct {
-
 
39
    uint64_t ptr;  /**< Machine address of PTE */
-
 
40
    uint64_t val;  /**< New contents of PTE */
-
 
41
} mmu_update_t;
-
 
42
 
-
 
43
typedef struct {
-
 
44
    unsigned int cmd;
-
 
45
    union {
-
 
46
        unsigned long mfn;
-
 
47
        unsigned long linear_addr;
-
 
48
    } arg1;
-
 
49
    union {
-
 
50
        unsigned int nr_ents;
-
 
51
        void *vcpumask;
-
 
52
    } arg2;
-
 
53
} mmuext_op_t;
-
 
54
 
-
 
55
 
-
 
56
#define XEN_MMU_UPDATE  1
36
#define XEN_CONSOLE_IO  18
57
#define XEN_CONSOLE_IO  18
-
 
58
#define XEN_MMUEXT_OP   26
37
 
59
 
38
 
60
 
39
/*
61
/*
40
 * Commands for XEN_CONSOLE_IO
62
 * Commands for XEN_CONSOLE_IO
41
 */
63
 */
42
#define CONSOLE_IO_WRITE    0
64
#define CONSOLE_IO_WRITE    0
43
#define CONSOLE_IO_READ     1
65
#define CONSOLE_IO_READ     1
44
 
66
 
45
 
67
 
-
 
68
#define MMUEXT_PIN_L1_TABLE      0
-
 
69
#define MMUEXT_PIN_L2_TABLE      1
-
 
70
#define MMUEXT_PIN_L3_TABLE      2
-
 
71
#define MMUEXT_PIN_L4_TABLE      3
-
 
72
#define MMUEXT_UNPIN_TABLE       4
-
 
73
#define MMUEXT_NEW_BASEPTR       5
-
 
74
#define MMUEXT_TLB_FLUSH_LOCAL   6
-
 
75
#define MMUEXT_INVLPG_LOCAL      7
-
 
76
#define MMUEXT_TLB_FLUSH_MULTI   8
-
 
77
#define MMUEXT_INVLPG_MULTI      9
-
 
78
#define MMUEXT_TLB_FLUSH_ALL    10
-
 
79
#define MMUEXT_INVLPG_ALL       11
-
 
80
#define MMUEXT_FLUSH_CACHE      12
-
 
81
#define MMUEXT_SET_LDT          13
-
 
82
#define MMUEXT_NEW_USER_BASEPTR 15
-
 
83
 
-
 
84
 
-
 
85
#define DOMID_SELF (0x7FF0U)
-
 
86
#define DOMID_IO   (0x7FF1U)
-
 
87
 
-
 
88
 
46
#define hypercall0(id)  \
89
#define hypercall0(id)  \
47
    ({  \
90
    ({  \
48
        unative_t ret;  \
91
        unative_t ret;  \
49
        asm volatile (  \
92
        asm volatile (  \
50
            "call hypercall_page + (" STRING(id) " * 32)\n" \
93
            "call hypercall_page + (" STRING(id) " * 32)\n" \
Line 139... Line 182...
139
        );  \
182
        );  \
140
        ret;    \
183
        ret;    \
141
    })
184
    })
142
 
185
 
143
 
186
 
144
static inline int xen_console_io(const int cmd, const int count, const char *str)
187
static inline int xen_console_io(const unsigned int cmd, const unsigned int count, const char *str)
145
{
188
{
146
    return hypercall3(XEN_CONSOLE_IO, cmd, count, str);
189
    return hypercall3(XEN_CONSOLE_IO, cmd, count, str);
147
}
190
}
148
 
191
 
-
 
192
static inline int xen_mmu_update(const mmu_update_t *req, const unsigned int count, unsigned int *success_count, domid_t domid)
-
 
193
{
-
 
194
    return hypercall4(XEN_MMU_UPDATE, req, count, success_count, domid);
-
 
195
}
-
 
196
 
-
 
197
static inline int xen_mmuext_op(const mmuext_op_t *op, const unsigned int count, unsigned int *success_count, domid_t domid)
-
 
198
{
-
 
199
    return hypercall4(XEN_MMUEXT_OP, op, count, success_count, domid);
-
 
200
}
-
 
201
 
149
#endif
202
#endif