MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / decodeSectorRecord

Method decodeSectorRecord

arch/brother/decoder.cc:69–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 void decodeSectorRecord() override
70 {
71 if (readRaw32() != BROTHER_SECTOR_RECORD)
72 return;
73
74 const auto& rawbits = readRawBits(32);
75 const auto& bytes = toBytes(rawbits).slice(0, 4);
76
77 ByteReader br(bytes);
78 _sector->logicalCylinder = decode_header_gcr(br.read_be16());
79 _sector->logicalSector = decode_header_gcr(br.read_be16());
80
81 /* Sanity check the values read; there's no header checksum and
82 * occasionally we get garbage due to bit errors. */
83 if (_sector->logicalSector > 11)
84 return;
85 if (_sector->logicalCylinder > 79)
86 return;
87
88 _sector->status = Sector::DATA_MISSING;
89 }
90
91 void decodeDataRecord() override
92 {

Callers

nothing calls this directly

Calls 4

decode_header_gcrFunction · 0.85
sliceMethod · 0.80
read_be16Method · 0.80
toBytesFunction · 0.50

Tested by

no test coverage detected