mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-28 18:10:21 +00:00
Sync dfs lwp (#8123)
This commit is contained in:
@@ -20,12 +20,8 @@
|
||||
#define MM_FAULT_STATUS_OK_MAPPED 1
|
||||
#define MM_FAULT_STATUS_UNRECOVERABLE 4
|
||||
|
||||
struct rt_mm_fault_res
|
||||
{
|
||||
void *vaddr;
|
||||
rt_size_t size;
|
||||
int status;
|
||||
};
|
||||
#define MM_FAULT_FIXABLE_FALSE 0
|
||||
#define MM_FAULT_FIXABLE_TRUE 1
|
||||
|
||||
enum rt_mm_fault_op
|
||||
{
|
||||
@@ -36,10 +32,41 @@ enum rt_mm_fault_op
|
||||
|
||||
enum rt_mm_fault_type
|
||||
{
|
||||
/**
|
||||
* Occurs when an instruction attempts to access a memory address that it
|
||||
* does not have permission to access
|
||||
*/
|
||||
MM_FAULT_TYPE_ACCESS_FAULT,
|
||||
|
||||
/**
|
||||
* Occurs when a load or store instruction accesses a virtual memory
|
||||
* address that is not currently mapped to a physical memory page
|
||||
*/
|
||||
MM_FAULT_TYPE_PAGE_FAULT,
|
||||
|
||||
/**
|
||||
* Occurs like a SIGBUS
|
||||
*/
|
||||
MM_FAULT_TYPE_BUS_ERROR,
|
||||
|
||||
MM_FAULT_TYPE_GENERIC,
|
||||
__PRIVATE_PAGE_INSERT,
|
||||
};
|
||||
|
||||
enum rt_mm_hint_prefetch
|
||||
{
|
||||
MM_FAULT_HINT_PREFETCH_NONE,
|
||||
MM_FAULT_HINT_PREFETCH_READY,
|
||||
};
|
||||
|
||||
struct rt_mm_fault_res
|
||||
{
|
||||
void *vaddr;
|
||||
rt_size_t size;
|
||||
int status;
|
||||
|
||||
/* hint for prefetch strategy */
|
||||
enum rt_mm_hint_prefetch hint;
|
||||
};
|
||||
|
||||
struct rt_aspace_fault_msg
|
||||
@@ -52,8 +79,36 @@ struct rt_aspace_fault_msg
|
||||
struct rt_mm_fault_res response;
|
||||
};
|
||||
|
||||
struct rt_aspace_io_msg
|
||||
{
|
||||
/* offset in varea */
|
||||
rt_size_t off;
|
||||
/* fault address in target address space */
|
||||
void *fault_vaddr;
|
||||
/* read/write buffer in kernel space */
|
||||
void *buffer_vaddr;
|
||||
|
||||
struct rt_mm_fault_res response;
|
||||
};
|
||||
|
||||
rt_inline void rt_mm_fault_res_init(struct rt_mm_fault_res *res)
|
||||
{
|
||||
res->vaddr = RT_NULL;
|
||||
res->size = 0;
|
||||
res->hint = MM_FAULT_HINT_PREFETCH_NONE;
|
||||
res->status = MM_FAULT_STATUS_UNRECOVERABLE;
|
||||
}
|
||||
|
||||
rt_inline void rt_mm_io_msg_init(struct rt_aspace_io_msg *io, rt_size_t off, void *fault_vaddr, void *buffer_vaddr)
|
||||
{
|
||||
io->off = off;
|
||||
io->fault_vaddr = fault_vaddr;
|
||||
io->buffer_vaddr = buffer_vaddr;
|
||||
rt_mm_fault_res_init(&io->response);
|
||||
}
|
||||
|
||||
struct rt_aspace;
|
||||
/* MMU base page fault handler, return 1 is fixable */
|
||||
/* MMU base page fault handler, MM_FAULT_FIXABLE_TRUE/MM_FAULT_FIXABLE_FALSE will be returned */
|
||||
int rt_aspace_fault_try_fix(struct rt_aspace *aspace, struct rt_aspace_fault_msg *msg);
|
||||
|
||||
#endif /* __MM_FAULT_H__ */
|
||||
|
||||
Reference in New Issue
Block a user