MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / GetDeviceTreeRanges

Method GetDeviceTreeRanges

cpp/hal/sbc_version.cpp:123–134  ·  view source on GitHub ↗

The following functions are only used on the Raspberry Pi (imported from bcm_host.c)

Source from the content-addressed store, hash-verified

121// The following functions are only used on the Raspberry Pi
122// (imported from bcm_host.c)
123uint32_t SBC_Version::GetDeviceTreeRanges(const char *filename, uint32_t offset)
124{
125 uint32_t address = ~0;
126 if (FILE *fp = fopen(filename, "rb"); fp) {
127 fseek(fp, offset, SEEK_SET);
128 if (array<uint8_t, 4> buf; fread(buf.data(), 1, buf.size(), fp) == buf.size()) {
129 address = (int)buf[0] << 24 | (int)buf[1] << 16 | (int)buf[2] << 8 | (int)buf[3] << 0;
130 }
131 fclose(fp);
132 }
133 return address;
134}
135
136#if defined __linux__
137uint32_t SBC_Version::GetPeripheralAddress(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected