内核对象支持权限

This commit is contained in:
zhangzheng
2023-09-09 14:39:48 +08:00
parent 639dea1145
commit 74ae8c7a49
25 changed files with 226 additions and 104 deletions

View File

@@ -55,3 +55,23 @@ static inline syscall_prot_t syscall_prot_create(uint8_t op, uint8_t prot, obj_h
.obj_inx = obj_inx,
};
}
typedef union vpage
{
umword_t raw;
struct
{
umword_t attrs : 4; //!< 权限
umword_t : 8; //!< 保留
umword_t addr : (WORD_BITS - 12); //!< 地址
};
} vpage_t;
static inline vpage_t vpage_create_raw(umword_t raw)
{
return (vpage_t){.raw = raw};
}
static inline vpage_t vpage_create_raw3(umword_t attrs, umword_t resv, umword_t addr)
{
return (vpage_t){.attrs = attrs, .addr = addr};
}