#define readb(addr)\
({unsigned char val;\
asm volatile( " pfxio 0 \n"\
- " ld %0, [%1] \n"\
+ " ld %0, [%1] \n"\
" ext8d %0, %1 \n"\
:"=r"(val) : "r" (addr)); val;})
#define readw(addr)\
({unsigned short val;\
asm volatile( " pfxio 0 \n"\
- " ld %0, [%1] \n"\
+ " ld %0, [%1] \n"\
" ext16d %0, %1 \n"\
:"=r"(val) : "r" (addr)); val;})
#define readl(addr)\
({unsigned long val;\
asm volatile( " pfxio 0 \n"\
- " ld %0, [%1] \n"\
+ " ld %0, [%1] \n"\
:"=r"(val) : "r" (addr)); val;})
#define writeb(addr,val)\
* that can be used to access the memory range with the caching
* properties specified by "flags".
*/
-typedef unsigned long phys_addr_t;
-
#define MAP_NOCACHE (0)
#define MAP_WRCOMBINE (0)
#define MAP_WRBACK (0)
}
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+ return (phys_addr_t)(vaddr);
+}
+
#endif /* __ASM_NIOS_IO_H_ */