MIPS: add support for 64 bit addressing
Prepare for upcoming mips64 support. This patch add mips64 address support. Signed-off-by: Zhizhou Zhang <etou.zh@gmail.com> [daniel.schwierzeck@gmail.com: prefer _MIPS_SZLONG in posix_types.h to fix some warnings] Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
cb0a6a1ecc
commit
090854c826
|
@ -136,7 +136,7 @@
|
||||||
cannot access physical memory directly from core */
|
cannot access physical memory directly from core */
|
||||||
#define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
|
#define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
|
||||||
#else /* !CONFIG_SOC_AU1X00 */
|
#else /* !CONFIG_SOC_AU1X00 */
|
||||||
#define UNCACHED_SDRAM(a) KSEG1ADDR(a)
|
#define UNCACHED_SDRAM(a) CKSEG1ADDR(a)
|
||||||
#endif /* CONFIG_SOC_AU1X00 */
|
#endif /* CONFIG_SOC_AU1X00 */
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
|
|
|
@ -120,12 +120,20 @@ static inline void set_io_port_base(unsigned long base)
|
||||||
*/
|
*/
|
||||||
extern inline phys_addr_t virt_to_phys(volatile void * address)
|
extern inline phys_addr_t virt_to_phys(volatile void * address)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_64BIT
|
||||||
return CPHYSADDR(address);
|
return CPHYSADDR(address);
|
||||||
|
#else
|
||||||
|
return XPHYSADDR(address);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern inline void * phys_to_virt(unsigned long address)
|
extern inline void * phys_to_virt(unsigned long address)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_64BIT
|
||||||
return (void *)KSEG0ADDR(address);
|
return (void *)KSEG0ADDR(address);
|
||||||
|
#else
|
||||||
|
return (void *)CKSEG0ADDR(address);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -133,12 +141,20 @@ extern inline void * phys_to_virt(unsigned long address)
|
||||||
*/
|
*/
|
||||||
extern inline unsigned long virt_to_bus(volatile void * address)
|
extern inline unsigned long virt_to_bus(volatile void * address)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_64BIT
|
||||||
return CPHYSADDR(address);
|
return CPHYSADDR(address);
|
||||||
|
#else
|
||||||
|
return XPHYSADDR(address);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern inline void * bus_to_virt(unsigned long address)
|
extern inline void * bus_to_virt(unsigned long address)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_64BIT
|
||||||
return (void *)KSEG0ADDR(address);
|
return (void *)KSEG0ADDR(address);
|
||||||
|
#else
|
||||||
|
return (void *)CKSEG0ADDR(address);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -24,9 +24,15 @@ typedef int __kernel_pid_t;
|
||||||
typedef int __kernel_ipc_pid_t;
|
typedef int __kernel_ipc_pid_t;
|
||||||
typedef int __kernel_uid_t;
|
typedef int __kernel_uid_t;
|
||||||
typedef int __kernel_gid_t;
|
typedef int __kernel_gid_t;
|
||||||
|
#if _MIPS_SZLONG != 64
|
||||||
typedef unsigned int __kernel_size_t;
|
typedef unsigned int __kernel_size_t;
|
||||||
typedef int __kernel_ssize_t;
|
typedef int __kernel_ssize_t;
|
||||||
typedef int __kernel_ptrdiff_t;
|
typedef int __kernel_ptrdiff_t;
|
||||||
|
#else
|
||||||
|
typedef unsigned long __kernel_size_t;
|
||||||
|
typedef long __kernel_ssize_t;
|
||||||
|
typedef long __kernel_ptrdiff_t;
|
||||||
|
#endif
|
||||||
typedef long __kernel_time_t;
|
typedef long __kernel_time_t;
|
||||||
typedef long __kernel_suseconds_t;
|
typedef long __kernel_suseconds_t;
|
||||||
typedef long __kernel_clock_t;
|
typedef long __kernel_clock_t;
|
||||||
|
|
Loading…
Reference in New Issue