summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJuergen Beisert <jbe@pengutronix.de>2011-11-24 13:43:45 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-28 09:23:24 +0100
commit0748a120fbf2786c45f23234a07406ac5a9d2fd2 (patch)
tree99ac8c4779a2e495a3aefbe8ffd9fc3bf35144ac /include
parent0084116bcc281051fa756661579a17f374a6de0a (diff)
downloadbarebox-0748a120fbf2786c45f23234a07406ac5a9d2fd2.tar.gz
barebox-0748a120fbf2786c45f23234a07406ac5a9d2fd2.tar.xz
ATA/DISK: Share important constants and structures
Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/disks.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/disks.h b/include/disks.h
new file mode 100644
index 0000000000..ec136d4ee4
--- /dev/null
+++ b/include/disks.h
@@ -0,0 +1,39 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef DISKS_H
+#define DISKS_H
+
+struct block_device;
+
+/** Size of one sector in bytes */
+#define SECTOR_SIZE 512
+
+/** Size of one sector in bit shift */
+#define SECTOR_SHIFT 9
+
+/**
+ * Description of one partition table entry (D*S type)
+ */
+struct partition_entry {
+ uint8_t boot_indicator; /*! Maybe marked as an active partition */
+ uint8_t chs_begin[3]; /*! Start of the partition in cylinders, heads and sectors */
+ uint8_t type; /*! Filesystem type */
+ uint8_t chs_end[3]; /*! End of the partition in cylinders, heads and sectors */
+ uint32_t partition_start; /*! Start of the partition in LBA notation */
+ uint32_t partition_size; /*! Start of the partition in LBA notation */
+} __attribute__ ((packed));
+
+#endif /* DISKS_H */