|
| 1 | +// SPDX-License-Identifier: Apache-2.0 OR MIT |
| 2 | +// |
| 3 | +// Copyright (c) 2021 by the author(s) |
| 4 | +// |
| 5 | +// Author(s): |
| 6 | +// - Andre Richter <andre.o.richter@gmail.com> |
| 7 | + |
| 8 | +//! Physical Address Register - EL1 |
| 9 | +//! |
| 10 | +//! Returns the output address (OA) from an Address translation instruction that executed |
| 11 | +//! successfully, or fault information if the instruction did not execute successfully. |
| 12 | +
|
| 13 | +use register::{cpu::RegisterReadWrite, register_bitfields}; |
| 14 | + |
| 15 | +register_bitfields! {u64, |
| 16 | + pub PAR_EL1 [ |
| 17 | + /// Output address. The output address (OA) corresponding to the supplied input address. |
| 18 | + /// This field returns address bits[47:12]. |
| 19 | + /// |
| 20 | + /// When ARMv8.2-LPA is implemented, and 52-bit addresses and a 64KB translation granule are |
| 21 | + /// in use, the PA[51:48] bits form the upper part of the address value. Otherwise the |
| 22 | + /// PA[51:48] bits are RES0. |
| 23 | + /// |
| 24 | + /// For implementations with fewer than 48 physical address bits, the corresponding upper |
| 25 | + /// bits in this field are RES0. |
| 26 | + /// |
| 27 | + /// This field resets to an architecturally UNKNOWN value. |
| 28 | + PA OFFSET(12) NUMBITS(36) [], |
| 29 | + |
| 30 | + /// Indicates whether the instruction performed a successful address translation. |
| 31 | + /// |
| 32 | + /// 0 Address translation completed successfully. |
| 33 | + /// |
| 34 | + /// 1 Address translation aborted. |
| 35 | + /// |
| 36 | + /// This field resets to an architecturally UNKNOWN value. |
| 37 | + F OFFSET(0) NUMBITS(1) [ |
| 38 | + TranslationSuccessfull = 0, |
| 39 | + TranslationAborted = 1 |
| 40 | + ] |
| 41 | + ] |
| 42 | +} |
| 43 | + |
| 44 | +pub struct Reg; |
| 45 | + |
| 46 | +impl RegisterReadWrite<u64, PAR_EL1::Register> for Reg { |
| 47 | + sys_coproc_read_raw!(u64, "PAR_EL1", "x"); |
| 48 | + sys_coproc_write_raw!(u64, "PAR_EL1", "x"); |
| 49 | +} |
| 50 | + |
| 51 | +pub static PAR_EL1: Reg = Reg {}; |
0 commit comments