Commit 9bd5f8f1 authored by Liush's avatar Liush Committed by Anup Patel
Browse files

lib: sbi: Fix 32/64 bits variable compatibility



On RV64,"unsigned long" is 64bit and "unsigned int" is 32bit. So in
function "pmp_get" and "pmp_set", if "pmpcfg_shift >= 32", "0xff << pmpcfg_shift"
will go beyond "unsigned int" width. This patch tries to fix this issue.

In function 'pmp_get':
	cfgmask = (0xff << pmpcfg_shift);
			-->
	cfgmask = (0xffUL << pmpcfg_shift);
In function 'pmp_set':
	cfgmask = ~(0xff << pmpcfg_shift);
			-->
	cfgmask = ~(0xffUL << pmpcfg_shift);

Signed-off-by: default avatarLiush <liush.damon@gmail.com>
Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
parent db56ef36
Supports Markdown
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