io.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
#ifndef ETHERBOOT_IO_H
#define ETHERBOOT_IO_H
/* Don't require identity mapped physical memory,
* osloader.c is the only valid user at the moment.
*/
static inline unsigned long virt_to_phys(volatile const void *virt_addr)
{
return ((unsigned long)virt_addr);
}
static inline void *phys_to_virt(unsigned long phys_addr)
{
return (void *)(phys_addr);
}
/* virt_to_bus converts an addresss inside of etherboot [_start, _end]
* into a memory address cards can use.
*/
#define virt_to_bus virt_to_phys
/* bus_to_virt reverses virt_to_bus, the address must be output
* from virt_to_bus to be valid. This function does not work on
* all bus addresses.
*/
#define bus_to_virt phys_to_virt
/* ioremap converts a random 32bit bus address into something
* etherboot can access.
*/
{
return bus_to_virt(bus_addr);
}
/* iounmap cleans up anything ioremap had to setup */
{
return;
}
/* In physical mode the offset of uncached pages */
#define PHYS_BASE (0x8000000000000000UL)
/* Memory mapped IO primitives, we avoid the cache... */
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
size_t i;
for(i = 0; i < n; i++) {
dp++;
src++;
}
}
{
size_t i;
for(i = 0; i < n; i++) {
sp++;
dest++;
}
}
/* IO space IO primitives, Itanium has a strange architectural mapping... */
extern unsigned long io_base;
#define __ia64_io_addr(port) ((void *)(PHYS_BASE | io_base | (((port) >> 2) << 12) | ((port) & 0xfff)))
{
__ia64_mf_a();
return result;
}
{
__ia64_mf_a();
return result;
}
{
__ia64_mf_a();
return result;
}
{
__ia64_mf_a();
}
{
__ia64_mf_a();
}
{
__ia64_mf_a();
}
{
__ia64_mf_a();
while(count--)
__ia64_mf_a();
}
{
__ia64_mf_a();
while(count--)
__ia64_mf_a();
}
{
__ia64_mf_a();
while(count--)
__ia64_mf_a();
}
{
while (count--)
__ia64_mf_a();
}
{
while (count--)
__ia64_mf_a();
}
{
while (count--)
__ia64_mf_a();
}
static inline unsigned long ia64_get_kr0(void)
{
unsigned long r;
asm volatile ("mov %0=ar.k0" : "=r"(r));
return r;
}
#endif /* ETHERBOOT_IO_H */