start implementing io_mapping
authorjsg <jsg@openbsd.org>
Wed, 20 Mar 2024 02:44:57 +0000 (02:44 +0000)
committerjsg <jsg@openbsd.org>
Wed, 20 Mar 2024 02:44:57 +0000 (02:44 +0000)
sys/dev/pci/drm/include/linux/io-mapping.h

index 7a49ffe..87930d2 100644 (file)
@@ -3,4 +3,34 @@
 #ifndef _LINUX_IO_MAPPING_H
 #define _LINUX_IO_MAPPING_H
 
+#include <linux/types.h>
+
+struct io_mapping {
+       resource_size_t base;
+       unsigned long size;
+       void *iomem;
+};
+
+static inline void *
+io_mapping_map_wc(struct io_mapping *map, unsigned long off, unsigned long size)
+{
+       return ((uint8_t *)map->iomem + off);
+}
+
+static inline void
+io_mapping_unmap(void *va)
+{
+}
+
+static inline void *
+io_mapping_map_local_wc(struct io_mapping *map, unsigned long off)
+{
+       return ((uint8_t *)map->iomem + off);
+}
+
+static inline void
+io_mapping_unmap_local(void *va)
+{
+}
+
 #endif