Some aarch64 register struct updates
This commit is contained in:
@@ -126,6 +126,7 @@ impl InterruptStack {
|
||||
/// Saves all registers to a struct used by the proc:
|
||||
/// scheme to read/write registers.
|
||||
pub fn save(&self, all: &mut IntRegisters) {
|
||||
/*TODO: aarch64 registers
|
||||
all.elr_el1 = self.iret.elr_el1;
|
||||
all.tpidr_el0 = self.iret.tpidr_el0;
|
||||
all.tpidrro_el0 = self.iret.tpidrro_el0;
|
||||
@@ -133,6 +134,7 @@ impl InterruptStack {
|
||||
all.esr_el1 = self.iret.esr_el1;
|
||||
all.sp_el0 = self.iret.sp_el0;
|
||||
all.padding = 0;
|
||||
*/
|
||||
all.x30 = self.preserved.x30;
|
||||
all.x29 = self.preserved.x29;
|
||||
all.x28 = self.preserved.x28;
|
||||
@@ -165,16 +167,18 @@ impl InterruptStack {
|
||||
all.x1 = self.scratch.x1;
|
||||
all.x0 = self.scratch.x0;
|
||||
}
|
||||
|
||||
|
||||
/// Loads all registers from a struct used by the proc:
|
||||
/// scheme to read/write registers.
|
||||
pub fn load(&mut self, all: &IntRegisters) {
|
||||
/*TODO: aarch64 registers
|
||||
self.iret.elr_el1 = all.elr_el1;
|
||||
self.iret.tpidr_el0 = all.tpidr_el0;
|
||||
self.iret.tpidrro_el0 = all.tpidrro_el0;
|
||||
self.iret.spsr_el1 = all.spsr_el1;
|
||||
self.iret.esr_el1 = all.esr_el1;
|
||||
self.iret.sp_el0 = all.sp_el0;
|
||||
*/
|
||||
self.preserved.x30 = all.x30;
|
||||
self.preserved.x29 = all.x29;
|
||||
self.preserved.x28 = all.x28;
|
||||
|
||||
@@ -398,10 +398,13 @@ impl ProcScheme {
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
fn read_env_regs(&self, info: &Info) -> Result<EnvRegisters> {
|
||||
//TODO: Support other archs
|
||||
Err(Error::new(EINVAL))
|
||||
//TODO: aarch64 EnvRegisters
|
||||
Ok(EnvRegisters {
|
||||
tpidr_el0: 0,
|
||||
tpidrro_el0: 0,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86")]
|
||||
@@ -453,10 +456,10 @@ impl ProcScheme {
|
||||
Ok(EnvRegisters { fsbase: fsbase as _, gsbase: gsbase as _ })
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
fn write_env_regs(&self, info: &Info, regs: EnvRegisters) -> Result<()> {
|
||||
//TODO: Support other archs
|
||||
Err(Error::new(EINVAL))
|
||||
//TODO: aarch64 EnvRegisters
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86")]
|
||||
|
||||
Reference in New Issue
Block a user