struct mmio_instruction inst;
u32 val;
- inst = mmio_parse(rip, pg_structs, is_write);
+ inst = x86_mmio_parse(rip, pg_structs, is_write);
if (inst.inst_len == 0)
return 0;
if (inst.access_size != 4) {
/**
* @ingroup IO
- * @defgroup PIO x86 I/O Accessors
+ * @defgroup IO-X86 x86
* @{
*/
--- /dev/null
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Copyright (c) Siemens AG, 2014
+ *
+ * Authors:
+ * Jan Kiszka <jan.kiszka@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ */
+
+#include <jailhouse/paging.h>
+
+/**
+ * @ingroup IO
+ * @addtogroup IO-X86 x86
+ * @{
+ */
+
+/** Information about MMIO instruction performing an access. */
+struct mmio_instruction {
+ /** Length of the MMIO access instruction, 0 for invalid or unsupported
+ * access. */
+ unsigned int inst_len;
+ /** Size of the access. */
+ unsigned int access_size;
+ /** Number of the register that holds the output value or should
+ * receive the input. */
+ unsigned int reg_num;
+};
+
+/**
+ * Parse instruction causing an intercepted MMIO access on a cell CPU.
+ * @param pc Program counter of the access instruction.
+ * @param pg_structs Currently active guest (cell) paging structures.
+ * @param is_write True if write access, false for read.
+ *
+ * @return MMIO instruction information. mmio_instruction::inst_len is 0 on
+ * invalid or unsupported access.
+ */
+struct mmio_instruction x86_mmio_parse(unsigned long pc,
+ const struct guest_paging_structures *pg_structs, bool is_write);
+
+/** @} */
return ctx_maybe_get_bytes(ctx, pc, pg);
}
-struct mmio_instruction
-mmio_parse(unsigned long pc, const struct guest_paging_structures *pg_structs,
- bool is_write)
+struct mmio_instruction x86_mmio_parse(unsigned long pc,
+ const struct guest_paging_structures *pg_structs, bool is_write)
{
struct parse_context ctx = { .remaining = X86_MAX_INST_LEN };
struct mmio_instruction inst = { .inst_len = 0 };
if (!vcpu_get_guest_paging_structs(&pg_structs))
goto invalid_access;
- inst = mmio_parse(x_state.rip, &pg_structs, pf->is_write);
+ inst = x86_mmio_parse(x_state.rip, &pg_structs, pf->is_write);
if (!inst.inst_len || inst.access_size != 4)
goto invalid_access;
#ifndef _JAILHOUSE_MMIO_H
#define _JAILHOUSE_MMIO_H
-#include <jailhouse/paging.h>
+#include <jailhouse/types.h>
+#include <asm/mmio.h>
/**
* @defgroup IO I/O Access Subsystem
*
- * This subsystem provides accessors to I/O and supports the interpretation of
- * intercepted I/O accesses of cells.
+ * This subsystem provides accessors to I/O and supports the interpretation and
+ * handling of intercepted I/O accesses performed by cells.
*
* @{
*/
-/** Information about MMIO instruction performing an access. */
-struct mmio_instruction {
- /** Length of the MMIO access instruction, 0 for invalid or unsupported
- * access. */
- unsigned int inst_len;
- /** Size of the access. */
- unsigned int access_size;
- /** Architecture-specific number of the register that holds the output
- * value or should receive the input. */
- unsigned int reg_num;
-};
-
/**
* Define MMIO read accessor.
* @param size Access size.
}
/** @} */
-/**
- * Parse instruction causing an intercepted MMIO access on a cell CPU.
- * @param pc Program counter of the access instruction.
- * @param pg_structs Currently active guest (cell) paging structures.
- * @param is_write True if write access, false for read.
- *
- * @return MMIO instruction information. mmio_instruction::inst_len is 0 on
- * invalid or unsupported access.
- */
-struct mmio_instruction
-mmio_parse(unsigned long pc, const struct guest_paging_structures *pg_structs,
- bool is_write);
-
/** @} */
#endif /* !_JAILHOUSE_MMIO_H */