aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/amd-iommu.h
diff options
context:
space:
mode:
authorWei Wang <wei.wang2@amd.com>2012-01-12 13:48:57 +0100
committerWei Wang <wei.wang2@amd.com>2012-01-12 13:48:57 +0100
commit7ec332ba83b835e802e186c860aceccbaf3fd1c6 (patch)
tree8a0f75694876cb222b48371fd94552b1e06eb103 /xen/include/asm-x86/amd-iommu.h
parent88236844fcf743405eda2ad5fd4dcbb1a8ab6d9a (diff)
downloadxen-7ec332ba83b835e802e186c860aceccbaf3fd1c6.tar.gz
xen-7ec332ba83b835e802e186c860aceccbaf3fd1c6.tar.bz2
xen-7ec332ba83b835e802e186c860aceccbaf3fd1c6.zip
amd iommu: Refactoring iommu ring buffer definition
Introduce struct ring_buffer to represent iommu cmd buffer, event log and ppr log Signed-off-by: Wei Wang <wei.wang2@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/include/asm-x86/amd-iommu.h')
-rw-r--r--xen/include/asm-x86/amd-iommu.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/xen/include/asm-x86/amd-iommu.h b/xen/include/asm-x86/amd-iommu.h
index 876d9b998a..77afabae42 100644
--- a/xen/include/asm-x86/amd-iommu.h
+++ b/xen/include/asm-x86/amd-iommu.h
@@ -30,12 +30,42 @@
extern struct list_head amd_iommu_head;
+#pragma pack(1)
+typedef struct event_entry
+{
+ uint32_t data[4];
+} event_entry_t;
+
+typedef struct ppr_entry
+{
+ uint32_t data[4];
+} ppr_entry_t;
+
+typedef struct cmd_entry
+{
+ uint32_t data[4];
+} cmd_entry_t;
+
+typedef struct dev_entry
+{
+ uint32_t data[8];
+} dev_entry_t;
+#pragma pack()
+
struct table_struct {
void *buffer;
unsigned long entries;
unsigned long alloc_size;
};
+struct ring_buffer {
+ void *buffer;
+ unsigned long entries;
+ unsigned long alloc_size;
+ uint32_t tail;
+ uint32_t head;
+};
+
typedef struct iommu_cap {
uint32_t header; /* offset 00h */
uint32_t base_low; /* offset 04h */
@@ -60,10 +90,8 @@ struct amd_iommu {
unsigned long mmio_base_phys;
struct table_struct dev_table;
- struct table_struct cmd_buffer;
- u32 cmd_buffer_tail;
- struct table_struct event_log;
- u32 event_log_head;
+ struct ring_buffer cmd_buffer;
+ struct ring_buffer event_log;
int exclusion_enable;
int exclusion_allow_all;