@@ -27,7 +27,7 @@ mod x86_64;
27
27
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
28
28
pub use x86_64:: * ;
29
29
30
- #[ cfg( target_arch = "aarch64" ) ]
30
+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
31
31
pub mod fdt;
32
32
33
33
use std:: cmp:: max;
@@ -43,7 +43,7 @@ pub enum Error {
43
43
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
44
44
Pvh ( pvh:: Error ) ,
45
45
/// Errors specific to device tree boot configuration.
46
- #[ cfg( target_arch = "aarch64" ) ]
46
+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
47
47
Fdt ( fdt:: Error ) ,
48
48
49
49
/// Boot parameter was specified without its starting address in guest memory.
@@ -62,7 +62,7 @@ impl fmt::Display for Error {
62
62
Linux ( ref _e) => "failed to configure boot parameter by Linux Boot protocol." ,
63
63
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
64
64
Pvh ( ref _e) => "failed to configure boot parameter by PVH." ,
65
- #[ cfg( target_arch = "aarch64" ) ]
65
+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
66
66
Fdt ( ref _e) => "failed to configure boot parameter by FDT." ,
67
67
68
68
MissingStartAddress => {
@@ -84,7 +84,7 @@ impl std::error::Error for Error {
84
84
Linux ( ref e) => Some ( e) ,
85
85
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
86
86
Pvh ( ref e) => Some ( e) ,
87
- #[ cfg( target_arch = "aarch64" ) ]
87
+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
88
88
Fdt ( ref e) => Some ( e) ,
89
89
90
90
MissingStartAddress => None ,
@@ -176,7 +176,7 @@ impl BootParams {
176
176
177
177
/// Sets or overwrites the boot sections and associated memory address.
178
178
///
179
- /// Unused on `aarch64` and for the Linux boot protocol.
179
+ /// Unused on `aarch64` and `riscv64` for the Linux boot protocol.
180
180
/// For the PVH boot protocol, the sections specify the memory map table in
181
181
/// [`hvm_memmap_table_entry`] structs.
182
182
///
@@ -286,7 +286,7 @@ impl BootParams {
286
286
287
287
/// Sets or overwrites the boot modules and associated memory address.
288
288
///
289
- /// Unused on `aarch64` and for the Linux boot protocol.
289
+ /// Unused on `aarch64` and `riscv64` for the Linux boot protocol.
290
290
/// For the PVH boot protocol, the modules are specified in [`hvm_modlist_entry`] structs.
291
291
///
292
292
/// # Arguments
@@ -498,7 +498,7 @@ mod tests {
498
498
) ;
499
499
}
500
500
501
- #[ cfg( target_arch = "aarch64" ) ]
501
+ #[ cfg( any ( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
502
502
// FDT
503
503
assert_eq ! (
504
504
format!( "{}" , Error :: Fdt ( fdt:: Error :: WriteFDTToMemory ) ) ,
0 commit comments