52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
From a4c6fc90385b6be5cab7d9b70d234ebeef87a8cf Mon Sep 17 00:00:00 2001
|
|
From: Martchus <martchus@gmx.net>
|
|
Date: Thu, 1 Nov 2018 04:59:59 +0000
|
|
Subject: [PATCH 2/5] Cast pointer to uintptr_t instead of uint32_t
|
|
|
|
For compatibility with aarch64
|
|
---
|
|
mailbox.c | 4 ++--
|
|
ws2811.c | 4 ++--
|
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/mailbox.c b/mailbox.c
|
|
index f42e04a..23f7d5a 100644
|
|
--- a/mailbox.c
|
|
+++ b/mailbox.c
|
|
@@ -67,8 +67,8 @@ void *mapmem(uint32_t base, uint32_t size, const char *mem_dev) {
|
|
}
|
|
|
|
void *unmapmem(void *addr, uint32_t size) {
|
|
- uint32_t pagemask = ~0UL ^ (getpagesize() - 1);
|
|
- uint32_t baseaddr = (uint32_t)addr & pagemask;
|
|
+ uintptr_t pagemask = ~0UL ^ (getpagesize() - 1);
|
|
+ uintptr_t baseaddr = (uintptr_t)addr & pagemask;
|
|
int s;
|
|
|
|
s = munmap((void *)baseaddr, size);
|
|
diff --git a/ws2811.c b/ws2811.c
|
|
index 6ac82bf..63e50fe 100644
|
|
--- a/ws2811.c
|
|
+++ b/ws2811.c
|
|
@@ -392,7 +392,7 @@ static int setup_pwm(ws2811_t *ws2811)
|
|
|
|
dma_cb->source_ad = addr_to_bus(device, device->pxl_raw);
|
|
|
|
- dma_cb->dest_ad = (uint32_t)&((pwm_t *)PWM_PERIPH_PHYS)->fif1;
|
|
+ dma_cb->dest_ad = (uintptr_t)&((pwm_t *)PWM_PERIPH_PHYS)->fif1;
|
|
dma_cb->txfr_len = byte_count;
|
|
dma_cb->stride = 0;
|
|
dma_cb->nextconbk = 0;
|
|
@@ -457,7 +457,7 @@ static int setup_pcm(ws2811_t *ws2811)
|
|
RPI_DMA_TI_SRC_INC; // Increment src addr
|
|
|
|
dma_cb->source_ad = addr_to_bus(device, device->pxl_raw);
|
|
- dma_cb->dest_ad = (uint32_t)&((pcm_t *)PCM_PERIPH_PHYS)->fifo;
|
|
+ dma_cb->dest_ad = (uintptr_t)&((pcm_t *)PCM_PERIPH_PHYS)->fifo;
|
|
dma_cb->txfr_len = byte_count;
|
|
dma_cb->stride = 0;
|
|
dma_cb->nextconbk = 0;
|
|
--
|
|
2.19.1
|
|
|