HV:add const to bitmap_test parameter addr

bitmap_test parameter addr should be read-only,
the addr is in the asm code "output" region,
change it to the "input" region.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Huihuang Shi 2018-10-23 11:45:50 +08:00 committed by wenlingz
parent 482a4dcc02
commit d79007ae70

View File

@ -231,26 +231,26 @@ build_bitmap_clear(bitmap32_clear_lock, "l", uint32_t, BUS_LOCK)
* Note:Input parameter nr shall be less than 64. If nr>=64, it will
* be truncated.
*/
static inline bool bitmap_test(uint16_t nr_arg, volatile uint64_t *addr)
static inline bool bitmap_test(uint16_t nr_arg, const volatile uint64_t *addr)
{
uint16_t nr;
int32_t ret=0;
nr = nr_arg & 0x3fU;
asm volatile("btq %q2,%1\n\tsbbl %0, %0"
: "=r" (ret), "=m" (*addr)
: "r" ((uint64_t)nr)
: "=r" (ret)
: "m" (*addr), "r" ((uint64_t)nr)
: "cc", "memory");
return (ret != 0);
}
static inline bool bitmap32_test(uint16_t nr_arg, volatile uint32_t *addr)
static inline bool bitmap32_test(uint16_t nr_arg, const volatile uint32_t *addr)
{
uint16_t nr;
int32_t ret=0;
nr = nr_arg & 0x1fU;
asm volatile("btl %2,%1\n\tsbbl %0, %0"
: "=r" (ret), "=m" (*addr)
: "r" ((uint32_t)nr)
: "=r" (ret)
: "m" (*addr), "r" ((uint32_t)nr)
: "cc", "memory");
return (ret != 0);
}