/src/barebox/include/disks.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
2 | | |
3 | | #ifndef DISKS_H |
4 | | #define DISKS_H |
5 | | |
6 | | #include <linux/types.h> |
7 | | #include <linux/errno.h> |
8 | | |
9 | | struct block_device; |
10 | | |
11 | | /** Minimum size of one sector in bytes */ |
12 | 17.1k | #define MIN_SECTOR_SIZE 512 |
13 | | |
14 | | /** Minimum size of one sector in bit shift */ |
15 | 0 | #define MIN_SECTOR_SHIFT 9 |
16 | | |
17 | | |
18 | | /** Size of one sector in bytes */ |
19 | 620 | #define SECTOR_SIZE 512 |
20 | | |
21 | | /** Size of one sector in bit shift */ |
22 | 12.5M | #define SECTOR_SHIFT 9 |
23 | | |
24 | | /** |
25 | | * Description of one partition table entry (D*S type) |
26 | | */ |
27 | | struct partition_entry { |
28 | | uint8_t boot_indicator; /*! Maybe marked as an active partition */ |
29 | | uint8_t chs_begin[3]; /*! Start of the partition in cylinders, heads and sectors */ |
30 | | uint8_t type; /*! Filesystem type */ |
31 | | uint8_t chs_end[3]; /*! End of the partition in cylinders, heads and sectors */ |
32 | | uint32_t partition_start; /*! Start of the partition in LBA notation */ |
33 | | uint32_t partition_size; /*! Start of the partition in LBA notation */ |
34 | | } __attribute__ ((packed)); |
35 | | |
36 | | extern int parse_partition_table(struct block_device*); |
37 | | |
38 | | #ifdef CONFIG_PARTITION_MANIPULATION |
39 | | int reparse_partition_table(struct block_device *blk); |
40 | | #else |
41 | | static inline int reparse_partition_table(struct block_device *blk) |
42 | 0 | { |
43 | 0 | return -ENOSYS; |
44 | 0 | } Unexecuted instantiation: block.c:reparse_partition_table Unexecuted instantiation: bootm.c:reparse_partition_table Unexecuted instantiation: environment.c:reparse_partition_table Unexecuted instantiation: partitions.c:reparse_partition_table Unexecuted instantiation: dos.c:reparse_partition_table Unexecuted instantiation: efi.c:reparse_partition_table Unexecuted instantiation: state.c:reparse_partition_table Unexecuted instantiation: file-list.c:reparse_partition_table Unexecuted instantiation: bootscan.c:reparse_partition_table Unexecuted instantiation: filetype.c:reparse_partition_table Unexecuted instantiation: ramdisk.c:reparse_partition_table Unexecuted instantiation: bfetch.c:reparse_partition_table Unexecuted instantiation: devfs.c:reparse_partition_table Unexecuted instantiation: fs.c:reparse_partition_table Unexecuted instantiation: fat.c:reparse_partition_table Unexecuted instantiation: ff.c:reparse_partition_table Unexecuted instantiation: fat-diskio.c:reparse_partition_table Unexecuted instantiation: hostfile.c:reparse_partition_table Unexecuted instantiation: fat-pbl.c:reparse_partition_table |
45 | | #endif |
46 | | |
47 | | #endif /* DISKS_H */ |