summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Mayle <fmayle@google.com>2023-10-15 20:30:09 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-10-15 20:30:09 +0000
commit6ad18956f4ef0b949caa65e023d8b86a97491cb6 (patch)
treeb3ce11e9ecc1042355ac4ac283ce3007d1403c77
parent05abd9ebd96d426f1abafd4275d84563dbdfcfbb (diff)
parent150990fbe47a62394100fb76948096e349d84b8d (diff)
downloadmkbootimg-6ad18956f4ef0b949caa65e023d8b86a97491cb6.tar.gz
Upgrade zerocopy to 0.7.5 am: a1658dea78 am: 7b6153f2da am: f6d52cbdd3 am: b97040fe78 am: 150990fbe4
Original change: https://android-review.googlesource.com/c/platform/system/tools/mkbootimg/+/2786436 Change-Id: I3cae53a03741527c4043e41afa9c6e9ae54e5ad1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xrust/bindgen.sh4
-rw-r--r--rust/bootimg_priv.rs18
2 files changed, 11 insertions, 11 deletions
diff --git a/rust/bindgen.sh b/rust/bindgen.sh
index b854d10..6e75618 100755
--- a/rust/bindgen.sh
+++ b/rust/bindgen.sh
@@ -38,7 +38,7 @@ BLOCKED_TYPES_RE="__.+|.?int.+"
# generated rust bindings really don't need.
BLOCKED_ITEMS_RE="_.+|.?INT.+|PTR.+|ATOMIC.+|.+SOURCE|.+_H|SIG_.+|SIZE_.+|.?CHAR.+"
CUSTOM_STRUCT_RE="(vendor_)?(boot_img_hdr|ramdisk_table_entry)_v\d+"
-CUSTOM_STRUCT_DERIVES="AsBytes,FromBytes,PartialEq,Copy,Clone,Debug"
+CUSTOM_STRUCT_DERIVES="AsBytes,FromBytes,FromZeroes,PartialEq,Copy,Clone,Debug"
BINDGEN_FLAGS="--use-core --with-derive-default"
BOOTIMG_PRIV=${BOOTIMG_DIR}/rust/bootimg_priv.rs
@@ -69,7 +69,7 @@ cat << EOF | cat - ${SCRATCH_DIR}/bootimg_gen.rs > ${BOOTIMG_PRIV}
// See the License for the specific language governing permissions and
// limitations under the License.
-use zerocopy::{AsBytes, FromBytes};
+use zerocopy::{AsBytes, FromBytes, FromZeroes};
EOF
diff --git a/rust/bootimg_priv.rs b/rust/bootimg_priv.rs
index fbd883c..15fd0d9 100644
--- a/rust/bootimg_priv.rs
+++ b/rust/bootimg_priv.rs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-use zerocopy::{AsBytes, FromBytes};
+use zerocopy::{AsBytes, FromBytes, FromZeroes};
/* automatically generated by rust-bindgen 0.65.1 */
@@ -32,7 +32,7 @@ pub const VENDOR_RAMDISK_TYPE_DLKM: u32 = 3;
pub const VENDOR_RAMDISK_NAME_SIZE: u32 = 32;
pub const VENDOR_RAMDISK_TABLE_ENTRY_BOARD_ID_SIZE: u32 = 16;
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct boot_img_hdr_v0 {
pub magic: [u8; 8usize],
pub kernel_size: u32,
@@ -151,7 +151,7 @@ impl Default for boot_img_hdr_v0 {
}
pub type boot_img_hdr = boot_img_hdr_v0;
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct boot_img_hdr_v1 {
pub _base: boot_img_hdr_v0,
pub recovery_dtbo_size: u32,
@@ -208,7 +208,7 @@ impl Default for boot_img_hdr_v1 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct boot_img_hdr_v2 {
pub _base: boot_img_hdr_v1,
pub dtb_size: u32,
@@ -249,7 +249,7 @@ impl Default for boot_img_hdr_v2 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct boot_img_hdr_v3 {
pub magic: [u8; 8usize],
pub kernel_size: u32,
@@ -325,7 +325,7 @@ impl Default for boot_img_hdr_v3 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct vendor_boot_img_hdr_v3 {
pub magic: [u8; 8usize],
pub header_version: u32,
@@ -471,7 +471,7 @@ impl Default for vendor_boot_img_hdr_v3 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct boot_img_hdr_v4 {
pub _base: boot_img_hdr_v3,
pub signature_size: u32,
@@ -506,7 +506,7 @@ impl Default for boot_img_hdr_v4 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct vendor_boot_img_hdr_v4 {
pub _base: vendor_boot_img_hdr_v3,
pub vendor_ramdisk_table_size: u32,
@@ -584,7 +584,7 @@ impl Default for vendor_boot_img_hdr_v4 {
}
}
#[repr(C, packed)]
-#[derive(AsBytes, FromBytes, PartialEq, Copy, Clone, Debug)]
+#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Copy, Clone, Debug)]
pub struct vendor_ramdisk_table_entry_v4 {
pub ramdisk_size: u32,
pub ramdisk_offset: u32,