@@ -27,7 +27,7 @@ mod x86_64;
2727#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
2828pub use x86_64:: * ;
2929
30- #[ cfg( target_arch = "aarch64" ) ]
30+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
3131pub mod fdt;
3232
3333use std:: cmp:: max;
@@ -43,7 +43,7 @@ pub enum Error {
4343 #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
4444 Pvh ( pvh:: Error ) ,
4545 /// Errors specific to device tree boot configuration.
46- #[ cfg( target_arch = "aarch64" ) ]
46+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
4747 Fdt ( fdt:: Error ) ,
4848
4949 /// Boot parameter was specified without its starting address in guest memory.
@@ -62,7 +62,7 @@ impl fmt::Display for Error {
6262 Linux ( ref _e) => "failed to configure boot parameter by Linux Boot protocol." ,
6363 #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
6464 Pvh ( ref _e) => "failed to configure boot parameter by PVH." ,
65- #[ cfg( target_arch = "aarch64" ) ]
65+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
6666 Fdt ( ref _e) => "failed to configure boot parameter by FDT." ,
6767
6868 MissingStartAddress => {
@@ -84,7 +84,7 @@ impl std::error::Error for Error {
8484 Linux ( ref e) => Some ( e) ,
8585 #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
8686 Pvh ( ref e) => Some ( e) ,
87- #[ cfg( target_arch = "aarch64" ) ]
87+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
8888 Fdt ( ref e) => Some ( e) ,
8989
9090 MissingStartAddress => None ,
@@ -176,7 +176,7 @@ impl BootParams {
176176
177177 /// Sets or overwrites the boot sections and associated memory address.
178178 ///
179- /// Unused on `aarch64` and for the Linux boot protocol.
179+ /// Unused on `aarch64` and `riscv64` for the Linux boot protocol.
180180 /// For the PVH boot protocol, the sections specify the memory map table in
181181 /// [`hvm_memmap_table_entry`] structs.
182182 ///
@@ -286,7 +286,7 @@ impl BootParams {
286286
287287 /// Sets or overwrites the boot modules and associated memory address.
288288 ///
289- /// Unused on `aarch64` and for the Linux boot protocol.
289+ /// Unused on `aarch64` and `riscv64` for the Linux boot protocol.
290290 /// For the PVH boot protocol, the modules are specified in [`hvm_modlist_entry`] structs.
291291 ///
292292 /// # Arguments
@@ -498,7 +498,7 @@ mod tests {
498498 ) ;
499499 }
500500
501- #[ cfg( target_arch = "aarch64" ) ]
501+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
502502 // FDT
503503 assert_eq ! (
504504 format!( "{}" , Error :: Fdt ( fdt:: Error :: WriteFDTToMemory ) ) ,
0 commit comments