summaryrefslogtreecommitdiff
path: root/src/kernel/mem
diff options
context:
space:
mode:
authordzwdz2022-05-15 14:20:48 +0200
committerdzwdz2022-05-15 14:20:48 +0200
commit24de8f53ef292afc7e0e3908292f111db12e08dd (patch)
tree50e6868797197366f535b0391ce1bb4888113715 /src/kernel/mem
parent31d654e6503229c52172d72eaa018e1f274b6d48 (diff)
kernel/mem: remove virt_cpy2kmalloc
Diffstat (limited to 'src/kernel/mem')
-rw-r--r--src/kernel/mem/virt.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/kernel/mem/virt.h b/src/kernel/mem/virt.h
index b858bdd..7d95b3b 100644
--- a/src/kernel/mem/virt.h
+++ b/src/kernel/mem/virt.h
@@ -39,15 +39,3 @@ static inline bool virt_cpy_from(struct pagedir *src_pages, // virtual -> physic
void *dest, const void __user *src, size_t length) {
return virt_cpy(NULL, (userptr_t)dest, src_pages, src, length);
}
-
-/** Copies a chunk of virtual memory to a newly kmalloc'd buffer. */
-static inline void *virt_cpy2kmalloc(struct pagedir *src_pages,
- const void __user *src, size_t length) {
- void *buf = kmalloc(length);
- if (virt_cpy_from(src_pages, buf, src, length)) {
- return buf;
- } else {
- kfree(buf);
- return NULL;
- }
-}