about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-08-27 18:26:36 -0700
committerMichael Bebenita <mbebenita@mozilla.com>2010-09-07 18:41:07 -0700
commitf8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9 (patch)
tree84daaf59d1eb899021e681927e1103cf08b91dd5 /src/rt/rust_kernel.h
parentffdb5fc8582c77eef7b3a30859eaa216872525a4 (diff)
downloadrust-f8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9.tar.gz
rust-f8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9.zip
Added a few utility classes, cleaned up the include order of .h files, and started to make the Rust kernel own domain message queues rather than the Rust domains themselves.
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
new file mode 100644
index 00000000000..478d030c177
--- /dev/null
+++ b/src/rt/rust_kernel.h
@@ -0,0 +1,21 @@
+#ifndef RUST_KERNEL_H
+#define RUST_KERNEL_H
+
+/**
+ * A global object shared by all domains.
+ */
+class rust_kernel {
+    memory_region &_region;
+    rust_log _log;
+public:
+    synchronized_indexed_list<rust_dom> domains;
+    synchronized_indexed_list<lock_free_queue<rust_message*> > message_queues;
+    rust_kernel(rust_srv *srv);
+    void register_domain(rust_dom *dom);
+    void deregister_domain(rust_dom *dom);
+    void log_all_domain_state();
+    void log(uint32_t type_bits, char const *fmt, ...);
+    virtual ~rust_kernel();
+};
+
+#endif /* RUST_KERNEL_H */