Changeset 6c4eedf in mainline for uspace/lib/fdisk/include/types/fdisk.h
- Timestamp:
- 2017-09-13T20:14:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 120d5bc
- Parents:
- 1d40c93d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fdisk/include/types/fdisk.h
r1d40c93d r6c4eedf 38 38 39 39 #include <adt/list.h> 40 #include <cap.h> 40 41 #include <loc.h> 41 42 #include <stdint.h> … … 43 44 #include <types/vol.h> 44 45 #include <vbd.h> 45 46 /** Capacity unit */47 typedef enum {48 cu_byte = 0,49 cu_kbyte,50 cu_mbyte,51 cu_gbyte,52 cu_tbyte,53 cu_pbyte,54 cu_ebyte,55 cu_zbyte,56 cu_ybyte57 } fdisk_cunit_t;58 59 /** Which of values within the precision of the capacity */60 typedef enum {61 /** The nominal (middling) value */62 fcv_nom,63 /** The minimum value */64 fcv_min,65 /** The maximum value */66 fcv_max67 } fdisk_cvsel_t;68 46 69 47 typedef enum { … … 85 63 86 64 #define CU_LIMIT (cu_ybyte + 1) 87 88 /** Partition capacity.89 *90 * Partition capacity represents both value and precision.91 * It is a decimal floating point value combined with a decimal92 * capacity unit. There is an integer mantisa @c m which in combination93 * with the number of decimal positions @c dp gives a decimal floating-point94 * number. E.g. for m = 1025 and dp = 2 the number is 10.25. If the unit95 * cunit = cu_kbyte, the capacity is 10.25 kByte, i.e. 10 250 bytes.96 *97 * Note that 1.000 kByte is equivalent to 1000 Byte, but 1 kByte is less98 * precise.99 */100 typedef struct {101 /** Mantisa */102 uint64_t m;103 /** Decimal positions */104 unsigned dp;105 /** Capacity unit */106 fdisk_cunit_t cunit;107 } fdisk_cap_t;108 65 109 66 /** List of devices available for managing by fdisk */ … … 169 126 link_t llog_ba; 170 127 /** Capacity */ 171 fdisk_cap_t capacity;128 cap_spec_t capacity; 172 129 /** Partition kind */ 173 130 label_pkind_t pkind; … … 193 150 typedef struct { 194 151 /** Desired capacity */ 195 fdisk_cap_t capacity;152 cap_spec_t capacity; 196 153 /** Partition kind */ 197 154 label_pkind_t pkind; … … 205 162 typedef struct { 206 163 /** Capacity */ 207 fdisk_cap_t capacity;164 cap_spec_t capacity; 208 165 /** Partition kind */ 209 166 label_pkind_t pkind;
Note:
See TracChangeset
for help on using the changeset viewer.