mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-23 22:18:17 +00:00
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:
parent
482a4dcc02
commit
d79007ae70
@ -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
|
* Note:Input parameter nr shall be less than 64. If nr>=64, it will
|
||||||
* be truncated.
|
* 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;
|
uint16_t nr;
|
||||||
int32_t ret=0;
|
int32_t ret=0;
|
||||||
nr = nr_arg & 0x3fU;
|
nr = nr_arg & 0x3fU;
|
||||||
asm volatile("btq %q2,%1\n\tsbbl %0, %0"
|
asm volatile("btq %q2,%1\n\tsbbl %0, %0"
|
||||||
: "=r" (ret), "=m" (*addr)
|
: "=r" (ret)
|
||||||
: "r" ((uint64_t)nr)
|
: "m" (*addr), "r" ((uint64_t)nr)
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
return (ret != 0);
|
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;
|
uint16_t nr;
|
||||||
int32_t ret=0;
|
int32_t ret=0;
|
||||||
nr = nr_arg & 0x1fU;
|
nr = nr_arg & 0x1fU;
|
||||||
asm volatile("btl %2,%1\n\tsbbl %0, %0"
|
asm volatile("btl %2,%1\n\tsbbl %0, %0"
|
||||||
: "=r" (ret), "=m" (*addr)
|
: "=r" (ret)
|
||||||
: "r" ((uint32_t)nr)
|
: "m" (*addr), "r" ((uint32_t)nr)
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
return (ret != 0);
|
return (ret != 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user