aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/pmem.c4
-rw-r--r--common/tcb.c6
-rw-r--r--common/uapi/proc.c1
-rw-r--r--include/apos/mem.h4
-rw-r--r--include/apos/tcb.h6
-rw-r--r--include/apos/vmem.h6
6 files changed, 13 insertions, 14 deletions
diff --git a/common/pmem.c b/common/pmem.c
index 2b2fb00..748a1c8 100644
--- a/common/pmem.c
+++ b/common/pmem.c
@@ -36,6 +36,10 @@
#include <apos/bits.h> /* is_nset etc */
#include <libfdt.h>
+/* \todo add memory page counting?
+ * To make sure memory is not overcommited at clone, for example.
+ */
+
/**
* Loop through all page usage bits in current bitmap.
*
diff --git a/common/tcb.c b/common/tcb.c
index 9768eb0..94abef7 100644
--- a/common/tcb.c
+++ b/common/tcb.c
@@ -170,7 +170,7 @@ struct tcb *create_thread(struct tcb *p)
}
/**
- * Copy process, setting up COW.
+ * Copy process.
*
* @param p Parent process.
* @param n New process.
@@ -178,9 +178,7 @@ struct tcb *create_thread(struct tcb *p)
*/
static stat_t __copy_proc(struct tcb *p, struct tcb *n)
{
- /** \todo Copy memory regions, and mark them MR_COW, as well as copy
- * bm_branch tree but with VM_W off, also at some point write COW
- * handler */
+ /** \todo Copy memory regions as well as copy */
return OK;
}
diff --git a/common/uapi/proc.c b/common/uapi/proc.c
index a48b7eb..c8078db 100644
--- a/common/uapi/proc.c
+++ b/common/uapi/proc.c
@@ -85,6 +85,7 @@ SYSCALL_DEFINE2(exec)(sys_arg_t bin, sys_arg_t interp){
/**
* Kill syscall handler.
*
+ * @param tid Thread to kill.
* \todo Implement.
*
* @return No?
diff --git a/include/apos/mem.h b/include/apos/mem.h
index 512f1e7..0eed025 100644
--- a/include/apos/mem.h
+++ b/include/apos/mem.h
@@ -217,10 +217,8 @@
#define MR_SHARED (1 << 9)
/** Owner of shared region. */
#define MR_OWNED (1 << 10)
-/** Copy on write. */
-#define MR_COW (1 << 11)
/** Don't free memory on clear. */
-#define MR_KEEP (1 << 12)
+#define MR_KEEP (1 << 11)
/** @} */
diff --git a/include/apos/tcb.h b/include/apos/tcb.h
index 72dcc98..63bf037 100644
--- a/include/apos/tcb.h
+++ b/include/apos/tcb.h
@@ -62,7 +62,7 @@ struct tcb_ctx {
};
/** Enum for notification states. */
-enum tcb_notify_state {
+enum tcb_notify {
/** Thread has notifcations queued. */
NOTIFY_QUEUED,
@@ -178,11 +178,9 @@ struct tcb *create_thread(struct tcb *p);
* Create a new process.
*
* Sets up a new thread in a new process context. If there is a parent thread,
- * its memory regions are copied but made COW.
+ * its memory regions are copied.
* \see create_thread().
*
- * \todo COW handling.
- *
* @param p Parent process.
* @return Pointer to created \ref tcb.
*/
diff --git a/include/apos/vmem.h b/include/apos/vmem.h
index ba5fb84..eb901a8 100644
--- a/include/apos/vmem.h
+++ b/include/apos/vmem.h
@@ -151,9 +151,9 @@ stat_t alloc_shared_wrapper(struct vmem *b, pm_t *offset, vm_t vaddr,
vmflags_t flags, enum mm_order order, void *data);
/**
- * User virtual memory COW copying worker callback for \ref map_fill_region().
+ * User virtual memory copying worker callback for \ref map_fill_region().
*
- * Currently unused, but intention is to set up COW copy of some other virtual
+ * Currently unused, but intention is to set up copy of some other virtual
* memory region, likely passed through \c data?
*
* @param b Virtual memory to work in.
@@ -214,7 +214,7 @@ stat_t free_uvmem_wrapper(struct vmem *b, pm_t *offset, vm_t vaddr,
map_fill_region(b, &alloc_shared_wrapper, 0, start, bytes, flags, data)
/**
- * Convenience wrapper for \ref map_fill_region() when COW copying a region.
+ * Convenience wrapper for \ref map_fill_region() when copying a region.
*
* @param b Virtual memory to work in.
* @param start Start of virtual memory region to map.