sel4/arch/arm/arch/aarch64/
fault.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// Copyright 2023, Colias Group, LLC
//
// SPDX-License-Identifier: MIT
//

use crate::{UnknownSyscall, Word};

impl UnknownSyscall {
    pub fn spsr(&self) -> Word {
        self.inner().get_SPSR()
    }

    pub fn gpr(&self, ix: usize) -> Word {
        match ix {
            0 => self.inner().get_X0(),
            1 => self.inner().get_X1(),
            2 => self.inner().get_X2(),
            3 => self.inner().get_X3(),
            4 => self.inner().get_X4(),
            5 => self.inner().get_X5(),
            6 => self.inner().get_X6(),
            7 => self.inner().get_X7(),
            _ => panic!(),
        }
    }
}