Home | History | Annotate | Download | only in gptfdisk

Lines Matching refs:chs

612  * Functions that set or get disk metadata (CHS geometry, disk size, *
617 // Read the CHS geometry using OS calls, or if that fails, set to
659 // Converts 64-bit LBA value to MBR-style CHS value. Returns 1 if conversion
660 // was within the range that can be expressed by CHS (including 0, for an
661 // empty partition), 0 if the value is outside that range, and -1 if chs is
663 int BasicMBRData::LBAtoCHS(uint64_t lba, uint8_t * chs) {
669 if (chs != NULL) {
670 // Special case: In case of 0 LBA value, zero out CHS values....
672 chs[0] = chs[1] = chs[2] = UINT8_C(0);
675 // If LBA value is too large for CHS, max out CHS values....
677 chs[0] = 254;
678 chs[1] = chs[2] = 255;
682 // If neither of the above applies, compute CHS values....
690 chs[0] = (uint8_t) head;
694 chs[1] = (uint8_t) ((sector + 1) + (cylinder >> 8) * 64);
695 chs[2] = (uint8_t) (cylinder & UINT64_C(0xFF));
700 } else { // Invalid (NULL) chs pointer
702 } // if CHS pointer valid
1117 // Recomputes the CHS values for the specified partition and adjusts the value.
1118 // Note that this will create a technically incorrect CHS value for EFI GPT (0xEE)
1630 cout << "c\trecompute all CHS values\n";