Skip to content

Commit a35d01b

Browse files
author
Oren Cohen
committed
try another way to check for unpriv access
1 parent a2b8ff5 commit a35d01b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/vmpu/src/mpu_armv8m/vmpu_armv8m_unpriv_access.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ uint32_t vmpu_unpriv_access(uint32_t addr, uint32_t size, uint32_t data)
9595
{
9696
unsigned int tries = 0;
9797
while(1) {
98-
if ((vmpu_unpriv_test_range(addr, UVISOR_UNPRIV_ACCESS_SIZE(size)) & (TT_RESP_NSRW_Msk | TT_RESP_SRVALID_Msk)) == (TT_RESP_NSRW_Msk | TT_RESP_SRVALID_Msk)) {
98+
//if ((vmpu_unpriv_test_range(addr, UVISOR_UNPRIV_ACCESS_SIZE(size)) & (TT_RESP_NSRW_Msk | TT_RESP_SRVALID_Msk)) == (TT_RESP_NSRW_Msk | TT_RESP_SRVALID_Msk)) {
99+
//this should be slower substantualy
100+
if (vmpu_buffer_access_is_ok(g_active_box, addr, UVISOR_UNPRIV_ACCESS_SIZE(size))){
99101
switch(size) {
100102
case UVISOR_UNPRIV_ACCESS_READ(1):
101103
return *((uint8_t *) addr);

0 commit comments

Comments
 (0)