]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/pt-mbr: add functio to store le
authorKarel Zak <kzak@redhat.com>
Tue, 18 Jun 2013 13:06:48 +0000 (15:06 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Sep 2013 14:47:02 +0000 (16:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/pt-mbr.h

index eef940b5768901127eac3046c5857359f3aaf76d..6a6510af4085558644d50bd4614e056dbca1c904 100644 (file)
@@ -18,6 +18,14 @@ static inline unsigned int __dos_assemble4le(const unsigned char *p)
        return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
 }
 
+static inline void __dos_store_4le(unsigned char *p, unsigned int val)
+{
+       p[0] = (val & 0xff);
+       p[1] = ((val >> 8) & 0xff);
+       p[2] = ((val >> 16) & 0xff);
+       p[3] = ((val >> 24) & 0xff);
+}
+
 static inline unsigned int dos_partition_start(struct dos_partition *p)
 {
        return __dos_assemble4le(&(p->start_sect[0]));