|  | @@ -1,7 +1,8 @@
 | 
											
												
													
														|  |  //! Assembly instructions
 |  |  //! Assembly instructions
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  macro_rules! instruction {
 |  |  macro_rules! instruction {
 | 
											
												
													
														|  | -    ($fnname:ident, $asm:expr, $asm_fn:ident) => (
 |  | 
 | 
											
												
													
														|  | 
 |  | +    ($(#[$attr:meta])*, $fnname:ident, $asm:expr, $asm_fn:ident) => (
 | 
											
												
													
														|  | 
 |  | +        $(#[$attr])*
 | 
											
												
													
														|  |          #[inline]
 |  |          #[inline]
 | 
											
												
													
														|  |          pub unsafe fn $fnname() {
 |  |          pub unsafe fn $fnname() {
 | 
											
												
													
														|  |              match () {
 |  |              match () {
 | 
											
										
											
												
													
														|  | @@ -25,12 +26,35 @@ macro_rules! instruction {
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -/// Priviledged ISA Instructions
 |  | 
 | 
											
												
													
														|  | -instruction!(ebreak, "ebreak", __ebreak);
 |  | 
 | 
											
												
													
														|  | -instruction!(wfi, "wfi", __wfi);
 |  | 
 | 
											
												
													
														|  | -instruction!(sfence_vma_all, "sfence.vma", __sfence_vma_all);
 |  | 
 | 
											
												
													
														|  | 
 |  | +instruction!(
 | 
											
												
													
														|  | 
 |  | +    /// `EBREAK` instruction wrapper
 | 
											
												
													
														|  | 
 |  | +    ///
 | 
											
												
													
														|  | 
 |  | +    /// Generates a breakpoint exception.
 | 
											
												
													
														|  | 
 |  | +    , ebreak, "ebreak", __ebreak);
 | 
											
												
													
														|  | 
 |  | +instruction!(
 | 
											
												
													
														|  | 
 |  | +    /// `WFI` instruction wrapper
 | 
											
												
													
														|  | 
 |  | +    ///
 | 
											
												
													
														|  | 
 |  | +    /// Provides a hint to the implementation that the current hart can be stalled until an interrupt might need servicing.
 | 
											
												
													
														|  | 
 |  | +    /// The WFI instruction is just a hint, and a legal implementation is to implement WFI as a NOP.
 | 
											
												
													
														|  | 
 |  | +    , wfi, "wfi", __wfi);
 | 
											
												
													
														|  | 
 |  | +instruction!(
 | 
											
												
													
														|  | 
 |  | +    /// `SFENCE.VMA` instruction wrapper (all address spaces and page table levels)
 | 
											
												
													
														|  | 
 |  | +    ///
 | 
											
												
													
														|  | 
 |  | +    /// Synchronizes updates to in-memory memory-management data structures with current execution.
 | 
											
												
													
														|  | 
 |  | +    /// Instruction execution causes implicit reads and writes to these data structures; however, these implicit references
 | 
											
												
													
														|  | 
 |  | +    /// are ordinarily not ordered with respect to loads and stores in the instruction stream.
 | 
											
												
													
														|  | 
 |  | +    /// Executing an `SFENCE.VMA` instruction guarantees that any stores in the instruction stream prior to the
 | 
											
												
													
														|  | 
 |  | +    /// `SFENCE.VMA` are ordered before all implicit references subsequent to the `SFENCE.VMA`.
 | 
											
												
													
														|  | 
 |  | +    , sfence_vma_all, "sfence.vma", __sfence_vma_all);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +/// `SFENCE.VMA` instruction wrapper
 | 
											
												
													
														|  | 
 |  | +///
 | 
											
												
													
														|  | 
 |  | +/// Synchronizes updates to in-memory memory-management data structures with current execution.
 | 
											
												
													
														|  | 
 |  | +/// Instruction execution causes implicit reads and writes to these data structures; however, these implicit references
 | 
											
												
													
														|  | 
 |  | +/// are ordinarily not ordered with respect to loads and stores in the instruction stream.
 | 
											
												
													
														|  | 
 |  | +/// Executing an `SFENCE.VMA` instruction guarantees that any stores in the instruction stream prior to the
 | 
											
												
													
														|  | 
 |  | +/// `SFENCE.VMA` are ordered before all implicit references subsequent to the `SFENCE.VMA`.
 | 
											
												
													
														|  |  #[inline]
 |  |  #[inline]
 | 
											
												
													
														|  |  #[allow(unused_variables)]
 |  |  #[allow(unused_variables)]
 | 
											
												
													
														|  |  pub unsafe fn sfence_vma(asid: usize, addr: usize) {
 |  |  pub unsafe fn sfence_vma(asid: usize, addr: usize) {
 |