Re: [Etherboot-developers] 5.1: virt_to_bus
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: <ebi...@ln...> - 2002-12-30 04:23:19
|
ke...@us... writes: > Eric, I'm going to have a go at reintroducing virt_to_bus in some > drivers. I gather I should use virt_to_bus whenever a hardware register > is loaded with an address. That is, I should do: > > outl(virt_to_bus(buffer), ioaddr+...); > > but > > memcpy(nic->packet, buffer, len); > > and > > buffer[i] = '\0'; > > remain unchanged? Correct. There are 3 types of addresses. virtual address that ``&'' returns. physical address that refer to different memory from the cpus perspective. bus addresses that refer to memory from the devices perspective. On x86 we currently only have distinct virtual addresses and physical/bus addresses. Keeping the distinction between physical and bus addresses, while not strictly necessary makes portability much easier. In summary address that are sent to devices should be the result of virt_to_bus. Just about everything else can be left as is. Eric |