forked from M-Labs/artiq
1
0
Fork 0

runtime: allow #[cfg(not(has_kernel_cpu))] builds.

This commit is contained in:
whitequark 2017-11-03 16:04:17 +00:00
parent ad8fcb8b86
commit 4835431ac3
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use rpc_queue;
use kernel_proto::{KERNELCPU_EXEC_ADDRESS, KERNELCPU_LAST_ADDRESS, KSUPPORT_HEADER_SIZE}; use kernel_proto::{KERNELCPU_EXEC_ADDRESS, KERNELCPU_LAST_ADDRESS, KSUPPORT_HEADER_SIZE};
#[cfg(has_kernel_cpu)]
pub unsafe fn start() { pub unsafe fn start() {
if csr::kernel_cpu::reset_read() == 0 { if csr::kernel_cpu::reset_read() == 0 {
panic!("attempted to start kernel CPU when it is already running") panic!("attempted to start kernel CPU when it is already running")
@ -27,7 +28,13 @@ pub unsafe fn start() {
rpc_queue::init(); rpc_queue::init();
} }
#[cfg(not(has_kernel_cpu))]
pub unsafe fn start() {
unimplemented!("not(has_kernel_cpu)")
}
pub unsafe fn stop() { pub unsafe fn stop() {
#[cfg(has_kernel_cpu)]
csr::kernel_cpu::reset_write(1); csr::kernel_cpu::reset_write(1);
mailbox::acknowledge(); mailbox::acknowledge();