WIP: aarch64

parent ee9a9236
Pipeline #8957 failed with stages
in 1 minute and 35 seconds
use core::{mem, slice};
use core::ops::{Deref, DerefMut};
use super::error::{Error, Result};
pub unsafe fn syscall0(mut a: usize) -> Result<usize> {
......@@ -60,3 +63,47 @@ pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f:
Error::demux(a)
}
//TODO
#[derive(Copy, Clone, Debug, Default)]
#[repr(C)]
pub struct IntRegisters;
impl Deref for IntRegisters {
type Target = [u8];
fn deref(&self) -> &[u8] {
unsafe {
slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::<IntRegisters>())
}
}
}
impl DerefMut for IntRegisters {
fn deref_mut(&mut self) -> &mut [u8] {
unsafe {
slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::<IntRegisters>())
}
}
}
//TODO
#[derive(Clone, Copy, Debug, Default)]
#[repr(packed)]
pub struct FloatRegisters;
impl Deref for FloatRegisters {
type Target = [u8];
fn deref(&self) -> &[u8] {
unsafe {
slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::<FloatRegisters>())
}
}
}
impl DerefMut for FloatRegisters {
fn deref_mut(&mut self) -> &mut [u8] {
unsafe {
slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::<FloatRegisters>())
}
}
}
Markdown is supported
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