2022-12-03 12:07:44 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2021-01-30 lizhirui first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rthw.h>
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
#include <riscv.h>
|
2023-01-09 10:08:55 +08:00
|
|
|
#include <stdint.h>
|
2022-12-03 12:07:44 +08:00
|
|
|
#include <stdlib.h>
|
2023-01-09 10:08:55 +08:00
|
|
|
#include <string.h>
|
2022-12-03 12:07:44 +08:00
|
|
|
|
|
|
|
#include "riscv_mmu.h"
|
|
|
|
|
2024-02-21 11:45:04 +08:00
|
|
|
void mmu_enable_user_page_access(void)
|
2022-12-03 12:07:44 +08:00
|
|
|
{
|
|
|
|
set_csr(sstatus, SSTATUS_SUM);
|
|
|
|
}
|
|
|
|
|
2024-02-21 11:45:04 +08:00
|
|
|
void mmu_disable_user_page_access(void)
|
2022-12-03 12:07:44 +08:00
|
|
|
{
|
|
|
|
clear_csr(sstatus, SSTATUS_SUM);
|
|
|
|
}
|