
Dear Kumar,
In message A9E2917C-2AE1-4666-95F7-5F771055EABB@kernel.crashing.org you wrote:
- what should the prototype of this function look like:
phys_addr_t virt_to_phys (void * addr);
That's what I'd prefer, especially since it can be easily resolved (for example, by an empty macro) where not really needed.
int virt_to_phys(void *p, phys_addr_t *addr);
I think the vast majority of implementations will be just 1:1 mapping,
That's what I think, too.
however there is a question in a dynamic mapping case of how to report back not finding a mapping.
Return "(phys_addr_t)(~0)" ?
- what impact is there on existing use on:
cpu/mips/au1x00_eth.c: fifo_tx[next_tx].addr = (virt_to_phys(packet))| TX_DMA_ENABLE; cpu/mips/au1x00_eth.c: fifo_rx[next_rx].addr = (virt_to_phys(NetRxPackets[next_rx]))|RX_DMA_ENABLE; cpu/mips/au1x00_eth.c: fifo_tx[i].addr = virt_to_phys(&txbuf[0]); cpu/mips/au1x00_eth.c: fifo_rx[i].addr = (virt_to_phys(NetRxPackets[i]))|RX_DMA_ENABLE;
They have to be checked and fixed, like all other uses of virt_to_phys and eventually __virt_to_phys, too.
Best regards,
Wolfgang Denk