mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
kernel: support riscv32imac-unknown-none-elf
With Rust 1.76.0, we no longer support building with `#![no_std]` or `panic = "abort"`, both of which are required within the kernel. As a workaround, go back to building the kernel under `riscv32imac-unknown-none-elf`. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
058db866fe
commit
ed4ec01017
4 changed files with 6 additions and 6 deletions
|
|
@ -16,9 +16,9 @@ mod riscv;
|
||||||
#[cfg(target_arch = "riscv32")]
|
#[cfg(target_arch = "riscv32")]
|
||||||
pub use crate::arch::riscv::*;
|
pub use crate::arch::riscv::*;
|
||||||
|
|
||||||
#[cfg(all(target_arch = "riscv64", not(target_os = "xous")))]
|
#[cfg(all(target_arch = "riscv64", not(baremetal)))]
|
||||||
mod riscv;
|
mod riscv;
|
||||||
#[cfg(all(target_arch = "riscv64", not(target_os = "xous")))]
|
#[cfg(all(target_arch = "riscv64", not(baremetal)))]
|
||||||
pub use riscv::*;
|
pub use riscv::*;
|
||||||
|
|
||||||
#[cfg(all(target_arch = "x86_64", not(any(windows, unix))))]
|
#[cfg(all(target_arch = "x86_64", not(any(windows, unix))))]
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ pub extern "C" fn kmain() {
|
||||||
// Note that at this point, no new direct children of INIT may be created.
|
// Note that at this point, no new direct children of INIT may be created.
|
||||||
let mut pid = None;
|
let mut pid = None;
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "none", target_os = "xous", all(ci, test))))]
|
#[cfg(not(any(baremetal, all(ci, test))))]
|
||||||
{
|
{
|
||||||
use std::panic;
|
use std::panic;
|
||||||
panic::set_hook(Box::new(|arg| {
|
panic::set_hook(Box::new(|arg| {
|
||||||
|
|
|
||||||
|
|
@ -876,7 +876,7 @@ impl SystemServices {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate this process on this CPU
|
// Activate this process on this CPU
|
||||||
#[cfg(not(target_os = "xous"))]
|
#[cfg(not(baremetal))]
|
||||||
process.activate()?;
|
process.activate()?;
|
||||||
ArchProcess::current().set_tid(new_thread)?;
|
ArchProcess::current().set_tid(new_thread)?;
|
||||||
process.current_thread = new_thread as _;
|
process.current_thread = new_thread as _;
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ fn send_message(pid: PID, tid: TID, cid: CID, message: Message) -> SysCallResult
|
||||||
|
|
||||||
// Mark the server's context as "Ready". If this fails, return the context
|
// Mark the server's context as "Ready". If this fails, return the context
|
||||||
// to the blocking list.
|
// to the blocking list.
|
||||||
#[cfg(target_os = "xous")]
|
#[cfg(baremetal)]
|
||||||
ss.ready_thread(server_pid, server_tid).map_err(|e| {
|
ss.ready_thread(server_pid, server_tid).map_err(|e| {
|
||||||
ss.server_from_sidx_mut(sidx)
|
ss.server_from_sidx_mut(sidx)
|
||||||
.expect("server couldn't be located")
|
.expect("server couldn't be located")
|
||||||
|
|
@ -883,7 +883,7 @@ pub fn handle_inner(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallR
|
||||||
SysCall::CreateThread(thread_init) => SystemServices::with_mut(|ss| {
|
SysCall::CreateThread(thread_init) => SystemServices::with_mut(|ss| {
|
||||||
ss.create_thread(pid, thread_init).map(|new_tid| {
|
ss.create_thread(pid, thread_init).map(|new_tid| {
|
||||||
// Set the return value of the existing thread to be the new thread ID
|
// Set the return value of the existing thread to be the new thread ID
|
||||||
if cfg!(target_os = "xous") {
|
if cfg!(baremetal) {
|
||||||
// Immediately switch to the new thread
|
// Immediately switch to the new thread
|
||||||
ss.switch_to_thread(pid, Some(new_tid)).expect("couldn't activate new thread");
|
ss.switch_to_thread(pid, Some(new_tid)).expect("couldn't activate new thread");
|
||||||
ss.set_thread_result(pid, tid, xous_kernel::Result::ThreadID(new_tid))
|
ss.set_thread_result(pid, tid, xous_kernel::Result::ThreadID(new_tid))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue