Commit 589ba3d8 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Expose shifts in virt_to_phys to the compiler.

parent 24485ae2
...@@ -65,13 +65,13 @@ static inline void * phys_to_virt(unsigned long address) ...@@ -65,13 +65,13 @@ static inline void * phys_to_virt(unsigned long address)
#else #else
static inline unsigned long virt_to_phys(void *address) static inline unsigned long virt_to_phys(void *address)
{ {
unsigned long phys; unsigned long phys = (unsigned long)address;
__asm__ ( /* Sign-extend from bit 41. */
"sll %1, 63-40, %0\n" phys <<= (64 - 41);
"sra %0, 63-40, %0\n" phys = (long)phys >> (64 - 41);
: "=r" (phys) : "r" (address));
/* Crop to the physical address width of the processor. */
phys &= (1ul << hwrpb->pa_bits) - 1; phys &= (1ul << hwrpb->pa_bits) - 1;
return phys; return phys;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment