mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-28 07:45:32 +00:00
hv: risc-v: use tp register directly for arch_get_pcpu_id
Use tp register directly for arch_get_pcpu_id. This can eliminate the unnecessary mv instruction. Tracked-On: #8791 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
0a8eb09454
commit
3449b62dfb
@@ -117,9 +117,7 @@ struct stack_frame {
|
||||
*/
|
||||
static inline uint16_t arch_get_pcpu_id(void)
|
||||
{
|
||||
uint16_t pcpu_id;
|
||||
|
||||
asm volatile ("mv %0, tp" : "=r" (pcpu_id) : : );
|
||||
register uint16_t pcpu_id asm ("tp");
|
||||
return pcpu_id;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user