* identity-mapped.
*/
if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) )
- return phys_addr;
+ return ( ( userptr_t ) phys_addr );
/* In a 32-bit build, subtract virt_offset */
- return ( phys_addr - virt_offset );
+ return ( ( userptr_t ) ( phys_addr - virt_offset ) );
}
/**
*/
static inline __always_inline unsigned long
UACCESS_INLINE ( librm, user_to_phys ) ( userptr_t userptr, off_t offset ) {
- unsigned long addr = ( userptr + offset );
+ unsigned long addr = ( ( unsigned long ) ( userptr + offset ) );
/* In a 64-bit build, any virtual address in the low 4GB is
* directly usable as a physical address, since the low 4GB is
#define EM_ALIGN ( 4 * 1024 )
/** Equivalent of NOWHERE for user pointers */
-#define UNOWHERE ( ~UNULL )
+#define UNOWHERE ( ( userptr_t ) ~( ( intptr_t ) 0 ) )
/** An external memory block */
struct external_memory {
next_page_addr += GOLAN_PAGE_SIZE ) {
addr = next_page_addr;
if (GOLAN_PAGE_MASK & user_to_phys(addr, 0)) {
- DBGC (golan ,"Addr not Page alligned [%lx %lx]\n", user_to_phys(addr, 0), addr);
+ DBGC (golan ,"Addr not Page alligned [%lx]\n", user_to_phys(addr, 0));
}
mailbox->mblock.data[j] = USR_2_BE64_BUS(addr);
}
* virtual address will suffice for the purpose of determining
* alignment.
*/
- return ( userptr + offset );
+ return ( ( unsigned long ) ( userptr + offset ) );
}
/**
UACCESS_INLINE ( linux, phys_to_user ) ( physaddr_t phys_addr ) {
/* For symmetry with the stub user_to_phys() */
- return phys_addr;
+ return ( ( userptr_t ) phys_addr );
}
static inline __always_inline userptr_t
static inline __always_inline userptr_t
UACCESS_INLINE ( flat, phys_to_user ) ( unsigned long phys_addr ) {
- return phys_addr;
+ return ( ( userptr_t ) phys_addr );
}
static inline __always_inline unsigned long
UACCESS_INLINE ( flat, user_to_phys ) ( userptr_t userptr, off_t offset ) {
- return ( userptr + offset );
+ return ( ( unsigned long ) ( userptr + offset ) );
}
static inline __always_inline userptr_t
*/
/** Equivalent of NOWHERE for user pointers */
-#define UNOWHERE ( ~UNULL )
+#define UNOWHERE ( ( userptr_t ) ~( ( intptr_t ) 0 ) )
/**
* Reallocate external memory