summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Zeising <zeising@daemonic.se>2019-06-15 00:06:54 +0200
committerNiclas Zeising <zeising@daemonic.se>2019-07-10 18:52:20 +0200
commitb6de3c42cdc8fdb3acdd0b0a119e8848f1339950 (patch)
treecc06b4ace71a9f58974c05ab20e1068c95c3a516
parent735c8a5f6649d1b13fdc932f1b0b1e9e94512949 (diff)
freebsd_pci: Fix types in write functions
Fix the type used in write functions to match the size of the write. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
-rw-r--r--src/freebsd_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index c1f8e1e..ddb615b 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -652,7 +652,7 @@ pci_device_freebsd_write32( struct pci_io_handle *handle, uint32_t reg,
#if defined(__i386__) || defined(__amd64__)
outl( handle->base + reg, data );
#else
- *(uint16_t *)((uintptr_t)handle->memory + reg) = data;
+ *(uint32_t *)((uintptr_t)handle->memory + reg) = data;
#endif
}
@@ -663,7 +663,7 @@ pci_device_freebsd_write16( struct pci_io_handle *handle, uint32_t reg,
#if defined(__i386__) || defined(__amd64__)
outw( handle->base + reg, data );
#else
- *(uint8_t *)((uintptr_t)handle->memory + reg) = data;
+ *(uint16_t *)((uintptr_t)handle->memory + reg) = data;
#endif
}
@@ -674,7 +674,7 @@ pci_device_freebsd_write8( struct pci_io_handle *handle, uint32_t reg,
#if defined(__i386__) || defined(__amd64__)
outb( handle->base + reg, data );
#else
- *(uint32_t *)((uintptr_t)handle->memory + reg) = data;
+ *(uint8_t *)((uintptr_t)handle->memory + reg) = data;
#endif
}