diff options
-rw-r--r-- | char.h | 1 | ||||
-rw-r--r-- | harddoomdev.c | 1 | ||||
-rw-r--r-- | pci.c | 1 | ||||
-rw-r--r-- | pci.h | 8 | ||||
-rw-r--r-- | private_data.h | 26 | ||||
-rw-r--r-- | surface.c | 1 | ||||
-rw-r--r-- | util.h | 1 |
7 files changed, 30 insertions, 9 deletions
@@ -4,6 +4,7 @@ #include <linux/pci.h> #include "pci.h" +#include "private_data.h" int new_doomdev(struct pci_dev *dev); void destroy_doomdev(struct doom_data *doom_data); diff --git a/harddoomdev.c b/harddoomdev.c index f903b10..00ef6f7 100644 --- a/harddoomdev.c +++ b/harddoomdev.c @@ -3,6 +3,7 @@ #include "harddoom.h" #include "doomcode.h" #include "pci.h" +#include "private_data.h" void doomdev_write(void __iomem *iomem, size_t addr, uint32_t data) { @@ -7,6 +7,7 @@ #include "harddoom.h" #include "util.h" #include "harddoomdev.h" +#include "private_data.h" int init_pci(struct pci_dev *dev) { struct doom_data *doom_data; @@ -1,14 +1,6 @@ #ifndef PCI_H #define PCI_H -#include <linux/device.h> - -struct doom_data { - struct cdev *cdev; - struct device *device; - void __iomem *iomem; -}; - int pci_init(void); void pci_cleanup(void); diff --git a/private_data.h b/private_data.h new file mode 100644 index 0000000..38148bd --- /dev/null +++ b/private_data.h @@ -0,0 +1,26 @@ +#ifndef PRIVATE_DATA_H +#define PRIVATE_DATA_H + +#include <linux/device.h> +#include <linux/cdev.h> + +struct doom_data { + struct cdev cdev; + struct device *device; + struct device *pci_device; + void __iomem *iomem; +}; + +struct surface_data { + struct doom_data *doom_data; + + int surface_size; + int pages; + + uint8_t *surface_cpu; + uint32_t *page_table_cpu; + dma_addr_t surface_dev; + dma_addr_t page_table_dev; +}; + +#endif @@ -2,6 +2,7 @@ #include <linux/file.h> #include <linux/fs.h> +#include "private_data.h" #include "surface.h" long surface_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) @@ -16,6 +16,5 @@ goto label; \ } \ }) - #endif |