summary refs log tree commit diff
path: root/x86_64/src/fdt.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-01-28 15:33:21 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-07 03:02:08 -0800
commite54b33834c6adba8921947330583afa19fbd100a (patch)
treeccf80ca0673a001b8f55837e169c8ecee9fd6459 /x86_64/src/fdt.rs
parent26ac928925e006b82c7b563803689529197ee824 (diff)
downloadcrosvm-e54b33834c6adba8921947330583afa19fbd100a.tar
crosvm-e54b33834c6adba8921947330583afa19fbd100a.tar.gz
crosvm-e54b33834c6adba8921947330583afa19fbd100a.tar.bz2
crosvm-e54b33834c6adba8921947330583afa19fbd100a.tar.lz
crosvm-e54b33834c6adba8921947330583afa19fbd100a.tar.xz
crosvm-e54b33834c6adba8921947330583afa19fbd100a.tar.zst
crosvm-e54b33834c6adba8921947330583afa19fbd100a.zip
x86_64: return fdt size from create_fdt()
This will allow placement of the initrd after the end of the device tree
blob in the next patch.

This also moves the load of the fdt into setup_system_memory() so that
the position of the initrd can be calculated (in the next patch) before
calling configure_system().

BUG=None
TEST=Boot Termina on x86-64

Change-Id: I6dcfce3aa48ae0932157a40fa28ea9fb384263c8
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1443634
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'x86_64/src/fdt.rs')
-rw-r--r--x86_64/src/fdt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/x86_64/src/fdt.rs b/x86_64/src/fdt.rs
index afbb602..4f3084f 100644
--- a/x86_64/src/fdt.rs
+++ b/x86_64/src/fdt.rs
@@ -29,7 +29,7 @@ pub fn create_fdt(
     guest_mem: &GuestMemory,
     fdt_load_offset: u64,
     android_fstab: &mut File,
-) -> Result<(), Box<Error>> {
+) -> Result<usize, Box<Error>> {
     // Reserve space for the setup_data
     let fdt_data_size = fdt_max_size - mem::size_of::<setup_data>();
 
@@ -87,5 +87,5 @@ pub fn create_fdt(
     if written < fdt_data_size {
         return Err(Box::new(Error::FdtGuestMemoryWriteError));
     }
-    Ok(())
+    Ok(fdt_data_size)
 }