Lines Matching refs:address
26 FlashMemory::Address address, in Check() argument
29 if (Status status = error.Check(address, size); !status.ok()) { in Check()
60 Status FakeFlashMemory::Erase(Address address, size_t num_sectors) { in Erase() argument
61 if (address % sector_size_bytes() != 0) { in Erase()
64 unsigned(address)); in Erase()
67 const size_t sector_id = address / sector_size_bytes(); in Erase()
68 if (address / sector_size_bytes() + num_sectors > sector_count()) { in Erase()
72 unsigned(address), in Erase()
78 &buffer_[address], int(kErasedValue), sector_size_bytes() * num_sectors); in Erase()
82 StatusWithSize FakeFlashMemory::Read(Address address, in Read() argument
84 if (address + output.size() >= sector_count() * size_bytes()) { in Read()
89 Status status = FlashError::Check(read_errors_, address, output.size()); in Read()
90 std::memcpy(output.data(), &buffer_[address], output.size()); in Read()
94 StatusWithSize FakeFlashMemory::Write(Address address, in Write() argument
96 if (address % alignment_bytes() != 0 || in Write()
99 unsigned(address), in Write()
105 if (data.size() > sector_size_bytes() - (address % sector_size_bytes())) { in Write()
107 unsigned(address), in Write()
112 if (address + data.size() > sector_count() * sector_size_bytes()) { in Write()
115 unsigned(address), in Write()
123 if (buffer_[address + i] != kErasedValue) { in Write()
125 unsigned(address)); in Write()
131 Status status = FlashError::Check(write_errors_, address, data.size()); in Write()
132 std::memcpy(&buffer_[address], data.data(), data.size()); in Write()
136 std::byte* FakeFlashMemory::FlashAddressToMcuAddress(Address address) const { in FlashAddressToMcuAddress()
137 if (address > sector_count() * sector_size_bytes()) { in FlashAddressToMcuAddress()
141 unsigned(address), in FlashAddressToMcuAddress()
145 return buffer_.data() + address; in FlashAddressToMcuAddress()