Verified Commit d3cf4db4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Prerequisites for risv64 support

parent 0a79c173
......@@ -285,7 +285,7 @@ macro_rules! pop_special {
ldp x14, x15, [sp], 16
msr tpidrro_el0, x15
msr spsr_el1, x14
ldp x14, x15, [sp], 16
msr elr_el1, x15
msr tpidr_el0, x14
......
......@@ -38,6 +38,7 @@ unsafe fn trigger(irq: u32) {
}
pub unsafe fn acknowledge(_irq: usize) {
// TODO
}
pub unsafe fn irq_handler_com1(irq: u32) {
......
......@@ -9,6 +9,7 @@ pub use goblin::elf32::{header, program_header, section_header, sym};
#[cfg(any(
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "x86_64"
))]
pub use goblin::elf64::{header, program_header, section_header, sym};
......
......@@ -335,7 +335,7 @@ impl Scheme for ProcScheme {
Ok(value)
}
#[cfg(target_arch = "aarch64")]
#[cfg(not(target_arch = "x86_64"))]
fn read(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
//TODO
Err(Error::new(EINVAL))
......
......@@ -18,7 +18,7 @@ fn enforce_root() -> Result<()> {
}
}
#[cfg(target_arch = "aarch64")]
#[cfg(not(target_arch = "x86_64"))]
pub fn iopl(level: usize, stack: &mut InterruptStack) -> Result<usize> {
Err(Error::new(syscall::error::ENOSYS))
}
......
......@@ -124,7 +124,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
SYS_CLONE => {
let b = CloneFlags::from_bits_truncate(b);
#[cfg(target_arch = "aarch64")]
#[cfg(not(target_arch = "x86_64"))]
{
//TODO: CLONE_STACK
let ret = clone(b, bp).map(ContextId::into);
......
......@@ -124,7 +124,7 @@ pub fn clone(flags: CloneFlags, stack_base: usize) -> Result<ContextId> {
}
}
#[cfg(target_arch = "aarch64")]
#[cfg(not(target_arch = "x86_64"))]
{
if let Some(ref stack) = context.kstack {
offset = stack_base - stack.as_ptr() as usize;
......@@ -374,7 +374,7 @@ pub fn clone(flags: CloneFlags, stack_base: usize) -> Result<ContextId> {
new_ktable
};
#[cfg(target_arch = "x86_64")]
#[cfg(not(target_arch = "aarch64"))]
let mut new_ktable = unsafe {
InactivePageTable::from_address(new_utable.address())
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment