Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154943504
D16628.id46415.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D16628.id46415.diff
View Options
Index: sys/riscv/include/vmparam.h
===================================================================
--- sys/riscv/include/vmparam.h
+++ sys/riscv/include/vmparam.h
@@ -223,10 +223,7 @@
#define VM_INITIAL_PAGEIN 16
#endif
-/*
- * RISCVTODO
- * #define UMA_MD_SMALL_ALLOC
- */
+#define UMA_MD_SMALL_ALLOC
#ifndef LOCORE
extern vm_paddr_t dmap_phys_base;
Index: sys/riscv/riscv/uma_machdep.c
===================================================================
--- sys/riscv/riscv/uma_machdep.c
+++ sys/riscv/riscv/uma_machdep.c
@@ -32,6 +32,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/systm.h>
+#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
@@ -44,13 +45,39 @@
uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags,
int wait)
{
+ vm_page_t m;
+ vm_paddr_t pa;
+ void *va;
- panic("uma_small_alloc");
+ *flags = UMA_SLAB_PRIV;
+ m = vm_page_alloc_domain(NULL, 0, domain,
+ malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED);
+ if (m == NULL)
+ return (NULL);
+ pa = m->phys_addr;
+#if 0
+ /* RISCVTODO: minidump */
+ if ((wait & M_NODUMP) == 0)
+ dump_add_page(pa);
+#endif
+ va = (void *)PHYS_TO_DMAP(pa);
+ if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
+ bzero(va, PAGE_SIZE);
+ return (va);
}
void
uma_small_free(void *mem, vm_size_t size, u_int8_t flags)
{
+ vm_page_t m;
+ vm_paddr_t pa;
- panic("uma_small_free");
+ pa = DMAP_TO_PHYS((vm_offset_t)mem);
+#if 0
+ /* RISCVTODO: minidump */
+ dump_drop_page(pa);
+#endif
+ m = PHYS_TO_VM_PAGE(pa);
+ vm_page_unwire_noq(m);
+ vm_page_free(m);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 5:47 AM (19 m, 51 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32557123
Default Alt Text
D16628.id46415.diff (1 KB)
Attached To
Mode
D16628: Enable UMA_MD_SMALL_ALLOC
Attached
Detach File
Event Timeline
Log In to Comment