cx23882: fixes 64 bit warnings
This commit is contained in:
@@ -244,7 +244,9 @@ cx23882_int(void *data)
|
|||||||
|
|
||||||
if (mstat & (PCI_INT_STAT_HST_INT | PCI_INT_STAT_VIP_INT | PCI_INT_STAT_AUD_INT | PCI_INT_STAT_VID_INT)) {
|
if (mstat & (PCI_INT_STAT_HST_INT | PCI_INT_STAT_VIP_INT | PCI_INT_STAT_AUD_INT | PCI_INT_STAT_VID_INT)) {
|
||||||
// serious error, these bits should not be set
|
// serious error, these bits should not be set
|
||||||
dprintf("cx23882_int error: msk 0x%08lx, stat 0x%08lx, mstat 0x%08lx\n", reg_read32(REG_PCI_INT_MSK), reg_read32(REG_PCI_INT_STAT), mstat);
|
dprintf("cx23882_int error: msk 0x%08" B_PRIx32 ", stat 0x%08" B_PRIx32
|
||||||
|
", mstat 0x%08" B_PRIx32 "\n", reg_read32(REG_PCI_INT_MSK),
|
||||||
|
reg_read32(REG_PCI_INT_STAT), mstat);
|
||||||
reg_write32(REG_PCI_INT_MSK, 0);
|
reg_write32(REG_PCI_INT_MSK, 0);
|
||||||
return B_HANDLED_INTERRUPT;
|
return B_HANDLED_INTERRUPT;
|
||||||
}
|
}
|
||||||
@@ -254,7 +256,7 @@ cx23882_int(void *data)
|
|||||||
reg_write32(REG_PCI_INT_STAT, wmstat);
|
reg_write32(REG_PCI_INT_STAT, wmstat);
|
||||||
|
|
||||||
if (wmstat)
|
if (wmstat)
|
||||||
dprintf("cx23882_int got 0x%08lx\n", wmstat);
|
dprintf("cx23882_int got 0x%08" B_PRIx32 "\n", wmstat);
|
||||||
|
|
||||||
if (mstat & PCI_INT_STAT_TS_INT) {
|
if (mstat & PCI_INT_STAT_TS_INT) {
|
||||||
cx23882_mpegts_int(device);
|
cx23882_mpegts_int(device);
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ typedef struct {
|
|||||||
|
|
||||||
area_id dma_buf1_area;
|
area_id dma_buf1_area;
|
||||||
void * dma_buf1_virt;
|
void * dma_buf1_virt;
|
||||||
void * dma_buf1_phys;
|
phys_addr_t dma_buf1_phys;
|
||||||
area_id dma_buf2_area;
|
area_id dma_buf2_area;
|
||||||
void * dma_buf2_virt;
|
void * dma_buf2_virt;
|
||||||
void * dma_buf2_phys;
|
phys_addr_t dma_buf2_phys;
|
||||||
|
|
||||||
sem_id capture_sem;
|
sem_id capture_sem;
|
||||||
void * capture_data;
|
void * capture_data;
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ dtt7592_set_frequency(i2c_bus *bus, uint32 frequency, dvb_bandwidth_t bandwidth)
|
|||||||
if (divider > 0x7fff)
|
if (divider > 0x7fff)
|
||||||
divider = 0x7fff;
|
divider = 0x7fff;
|
||||||
|
|
||||||
TRACE("dtt7592_set_frequency frequency %ld, divider 0x%lx (%ld)\n", frequency, divider, divider);
|
TRACE("dtt7592_set_frequency frequency %" B_PRId32 ", divider 0x%"
|
||||||
|
B_PRIx32 " (%" B_PRId32 ")\n", frequency, divider, divider);
|
||||||
|
|
||||||
data[0] = divider >> 8;
|
data[0] = divider >> 8;
|
||||||
data[1] = (uint8)divider;
|
data[1] = (uint8)divider;
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ interface_attach(void **cookie, const pci_info *info)
|
|||||||
|
|
||||||
// adjust PCI latency timer
|
// adjust PCI latency timer
|
||||||
val = gPci->read_pci_config(device->pci_info->bus, device->pci_info->device, device->pci_info->function, PCI_latency, 1);
|
val = gPci->read_pci_config(device->pci_info->bus, device->pci_info->device, device->pci_info->function, PCI_latency, 1);
|
||||||
TRACE("PCI latency is %02lx, changing to %02x\n", val, PCI_LATENCY);
|
TRACE("PCI latency is %02" B_PRIx32 ", changing to %02x\n", val,
|
||||||
|
PCI_LATENCY);
|
||||||
gPci->write_pci_config(device->pci_info->bus, device->pci_info->device, device->pci_info->function, PCI_latency, 1, PCI_LATENCY);
|
gPci->write_pci_config(device->pci_info->bus, device->pci_info->device, device->pci_info->function, PCI_latency, 1, PCI_LATENCY);
|
||||||
|
|
||||||
// get IRQ
|
// get IRQ
|
||||||
@@ -113,8 +114,9 @@ interface_attach(void **cookie, const pci_info *info)
|
|||||||
dprintf("cx23882: Error, no memory space assigned\n");
|
dprintf("cx23882: Error, no memory space assigned\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
TRACE("hardware register address %p\n", (void *) val);
|
TRACE("hardware register address 0x%" B_PRIx32 "\n", val);
|
||||||
device->regs_area = map_mem(&device->regs, (void *)val, 16777216 /* 16 MB */, 0, "cx23882 registers");
|
device->regs_area = map_mem(&device->regs, (addr_t)val,
|
||||||
|
16777216 /* 16 MB */, 0, "cx23882 registers");
|
||||||
if (device->regs_area < B_OK) {
|
if (device->regs_area < B_OK) {
|
||||||
dprintf("cx23882: Error, can't map hardware registers\n");
|
dprintf("cx23882: Error, can't map hardware registers\n");
|
||||||
goto err;
|
goto err;
|
||||||
|
|||||||
@@ -37,47 +37,49 @@
|
|||||||
|
|
||||||
|
|
||||||
area_id
|
area_id
|
||||||
map_mem(void **virt, void *phy, size_t size, uint32 protection,
|
map_mem(void **virt, phys_addr_t phy, size_t size, uint32 protection,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
uint32 offset;
|
uint32 offset;
|
||||||
void *phyadr;
|
phys_addr_t phyadr;
|
||||||
void *mapadr;
|
void *mapadr;
|
||||||
area_id area;
|
area_id area;
|
||||||
|
|
||||||
TRACE("mapping physical address %p with %ld bytes for %s\n", phy, size,
|
TRACE("mapping physical address %" B_PRIxPHYSADDR " with %ld bytes for %s\n",
|
||||||
name);
|
phy, size, name);
|
||||||
|
|
||||||
offset = (uint32)phy & (B_PAGE_SIZE - 1);
|
offset = (uint32)phy & (B_PAGE_SIZE - 1);
|
||||||
phyadr = (char *)phy - offset;
|
phyadr = phy - offset;
|
||||||
size = ROUNDUP(size + offset, B_PAGE_SIZE);
|
size = ROUNDUP(size + offset, B_PAGE_SIZE);
|
||||||
area = map_physical_memory(name, (addr_t)phyadr, size,
|
area = map_physical_memory(name, phyadr, size,
|
||||||
B_ANY_KERNEL_BLOCK_ADDRESS, protection, &mapadr);
|
B_ANY_KERNEL_BLOCK_ADDRESS, protection, &mapadr);
|
||||||
if (area < B_OK) {
|
if (area < B_OK) {
|
||||||
TRACE("mapping '%s' failed, error 0x%lx (%s)\n", name, area, strerror(area));
|
TRACE("mapping '%s' failed, error 0x%" B_PRIx32 " (%s)\n", name, area,
|
||||||
|
strerror(area));
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
*virt = (char *)mapadr + offset;
|
*virt = (char *)mapadr + offset;
|
||||||
|
|
||||||
TRACE("physical = %p, virtual = %p, offset = %ld, phyadr = %p, mapadr = %p, size = %ld, area = 0x%08lx\n",
|
TRACE("physical = %" B_PRIxPHYSADDR ", virtual = %p, offset = %" B_PRIu32
|
||||||
phy, *virt, offset, phyadr, mapadr, size, area);
|
", phyadr = %" B_PRIxPHYSADDR ", mapadr = %p, size = %" B_PRIuSIZE
|
||||||
|
", area = 0x%08" B_PRIx32 "\n", phy, *virt, offset, phyadr, mapadr,
|
||||||
|
size, area);
|
||||||
|
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
area_id
|
area_id
|
||||||
alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
|
alloc_mem(void **virt, phys_addr_t *phy, size_t size, uint32 protection,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
// TODO: phy should be phys_addr_t*!
|
|
||||||
physical_entry pe;
|
physical_entry pe;
|
||||||
void * virtadr;
|
void * virtadr;
|
||||||
area_id areaid;
|
area_id areaid;
|
||||||
status_t rv;
|
status_t rv;
|
||||||
|
|
||||||
TRACE("allocating %ld bytes for %s\n", size, name);
|
TRACE("allocating %" B_PRIuSIZE " bytes for %s\n", size, name);
|
||||||
|
|
||||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||||
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
@@ -97,7 +99,8 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
|
|||||||
if (virt)
|
if (virt)
|
||||||
*virt = virtadr;
|
*virt = virtadr;
|
||||||
if (phy)
|
if (phy)
|
||||||
*phy = (void*)(addr_t)pe.address;
|
*phy = pe.address;
|
||||||
TRACE("area = %ld, size = %ld, virt = %p, phy = %" B_PRIxPHYSADDR "\n", areaid, size, virtadr, pe.address);
|
TRACE("area = %" B_PRId32 ", size = %" B_PRIuSIZE ", virt = %p, phy = %"
|
||||||
|
B_PRIxPHYSADDR "\n", areaid, size, virtadr, pe.address);
|
||||||
return areaid;
|
return areaid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,10 @@
|
|||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
area_id map_mem(void **virt, void *phy, size_t size, uint32 protection, const char *name);
|
area_id map_mem(void **virt, phys_addr_t phy, size_t size, uint32 protection,
|
||||||
area_id alloc_mem(void **virt, void **phy, size_t size, uint32 protection, const char *name);
|
const char *name);
|
||||||
|
area_id alloc_mem(void **virt, phys_addr_t *phy, size_t size, uint32 protection,
|
||||||
|
const char *name);
|
||||||
|
|
||||||
// generic macro for rounding, can only be used for power of 2 blocksize
|
// generic macro for rounding, can only be used for power of 2 blocksize
|
||||||
#define ROUNDUP(size, blocksize) (((size) + (blocksize) - 1) & ~((blocksize) - 1))
|
#define ROUNDUP(size, blocksize) (((size) + (blocksize) - 1) & ~((blocksize) - 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user