summaryrefslogtreecommitdiffstats
path: root/include/disks.h
blob: e9b72c25075362f0a906f58cea6e042c83f16c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * See file CREDITS for list of people who contributed to this
 * project.
 */

#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));

extern int parse_partition_table(struct block_device*);

#endif /* DISKS_H */