First step to move corerequest API from schedule.c
authorleymariv <valmon.leymarie@gmail.com>
Wed, 23 Sep 2015 20:57:59 +0000 (13:57 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 24 Nov 2015 19:48:50 +0000 (14:48 -0500)
This is the first step to refactor the akaros kernel scheduler to move
the core-provisioning and core-allocation APIs into 3 new files:
corerequest.h, coreprov.c and corealloc.c. The corerequest.h file
contains the full API for both allocating and provisioning cores, while
the coreprov.c and corealloc.c files implement the provisiong and
allocation APIs respectively.  We separate these implementation so that
alternate core provisioning and core allocation strategies can be
implemented without duplicating code.

In the next commits we will eventually move the code for provisioning
into coreprov.c and the code for core allocation into corealloc.c

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/corerequest.h [new file with mode: 0644]
kern/src/Kbuild
kern/src/corealloc.c [new file with mode: 0644]
kern/src/coreprov.c [new file with mode: 0644]
kern/src/schedule.c

diff --git a/kern/include/corerequest.h b/kern/include/corerequest.h
new file mode 100644 (file)
index 0000000..ec30345
--- /dev/null
@@ -0,0 +1,8 @@
+/* Copyright (c) 2009, 2012, 2015 The Regents of the University of California
+ * Barret Rhoden <brho@cs.berkeley.edu>
+ * Valmon Leymarie <leymariv@berkeley.edu>
+ * Kevin Klues <klueska@cs.berkeley.edu>
+ * See LICENSE for details.
+ */
+
+#pragma once
index d7c4a8e..9bea5c4 100644 (file)
@@ -16,6 +16,7 @@ obj-y                                         += blockdev.o
 obj-y                                          += ceq.o
 obj-y                                          += colored_caches.o
 obj-y                                          += console.o
+obj-y                                          += coreprov.o
 obj-y                                          += ctype.o
 obj-y                                          += devfs.o
 obj-y                                          += dmapool.o
@@ -28,6 +29,7 @@ obj-y                                         += event.o
 obj-y                                          += ext2fs.o
 obj-y                                          += ex_table.o
 obj-y                                          += fdtap.o
+obj-y                                          += corealloc.o
 obj-y                                          += find_next_bit.o
 obj-y                                          += find_last_bit.o
 obj-y                                          += frontend.o
diff --git a/kern/src/corealloc.c b/kern/src/corealloc.c
new file mode 100644 (file)
index 0000000..e48c0ec
--- /dev/null
@@ -0,0 +1,6 @@
+/* Copyright (c) 2009, 2012, 2015 The Regents of the University of California
+ * Barret Rhoden <brho@cs.berkeley.edu>
+ * Valmon Leymarie <leymariv@berkeley.edu>
+ * Kevin Klues <klueska@cs.berkeley.edu>
+ * See LICENSE for details.
+ */
diff --git a/kern/src/coreprov.c b/kern/src/coreprov.c
new file mode 100644 (file)
index 0000000..6a55a9d
--- /dev/null
@@ -0,0 +1,7 @@
+/* Copyright (c) 2009, 2012, 2015 The Regents of the University of California
+ * Barret Rhoden <brho@cs.berkeley.edu>
+ * Valmon Leymarie <leymariv@berkeley.edu>
+ * Kevin Klues <klueska@cs.berkeley.edu>
+ * See LICENSE for details.
+ */
+
index f4c6394..fc60822 100644 (file)
@@ -5,6 +5,7 @@
  * Scheduling and dispatching. */
 
 #include <schedule.h>
+#include <corerequest.h>
 #include <process.h>
 #include <monitor.h>
 #include <stdio.h>