#define __LUNAIX_ARCH_GENERIC_BITS_H
#define _BITS_GENMASK(h, l) \
- (((1UL << ((h) + 1)) - 1) ^ ((1UL << (l)) - 1))
+ (((1 << ((h) + 1)) - 1) ^ ((1 << (l)) - 1))
#define _BITS_EXTRACT(from, h, l) \
- (((from) & (((1UL << (h + 1)) - 1) ^ ((1UL << l) - 1))) >> l)
+ (((from) & (((1 << (h + 1)) - 1) ^ ((1 << (l)) - 1))) >> (l))
#define _BITS_INSERT(to, from, h, l) \
- (((to) & ~_BITS_GENMASK(h, l)) | (((from) << l) & _BITS_GENMASK(h, l)))
+ (((to) & ~_BITS_GENMASK(h, l)) | (((from) << (l)) & _BITS_GENMASK(h, l)))
+
+#define _BITS_STATIC(val, h, l) \
+ (((val) & _BITS_GENMASK(h, l)) << (l))
#endif /* __LUNAIX_ARCH_BITS_H */
_default void
pmm_arch_init_pool(struct pmem* memory)
{
- fail("unimplemented");
+ pmm_declare_pool(POOL_UNIFIED, 1, memory->list_len);
}
_default ptr_t
{
fail("unimplemented");
}
+
+_default pte_t
+translate_vmr_prot(unsigned int vmr_prot, pte_t pte)
+{
+ pte = pte_mkuser(pte);
+
+ if ((vmr_prot & PROT_WRITE)) {
+ pte = pte_mkwritable(pte);
+ }
+
+ if ((vmr_prot & PROT_EXEC)) {
+ pte = pte_mkexec(pte);
+ }
+ else {
+ pte = pte_mknexec(pte);
+ }
+
+ return pte;
+}
#define __ASM__
-#include <lunaix/syscall.h>
-#include "syscall_nr.inc"
+#include <asm-generic/syscall_nr.inc>
.section .text
.type syscall_hndlr, @function
#define __ASM__
-#include <lunaix/syscall.h>
-#include "syscall_nr.inc"
+#include <asm-generic/syscall_nr.inc>
#include "asm/variants/interrupt64.S.inc"
.section .text