MCPcopy Create free account
hub / github.com/coreboot/coreboot / options_checksum_valid

Function options_checksum_valid

payloads/libpayload/drivers/options.c:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62int options_checksum_valid(const struct nvram_accessor *nvram)
63{
64 int i;
65 int range_start = lib_sysinfo.cmos_range_start / 8;
66 int range_end = lib_sysinfo.cmos_range_end / 8;
67 int checksum_location = lib_sysinfo.cmos_checksum_location / 8;
68 u16 checksum = 0, checksum_old;
69
70 for(i = range_start; i <= range_end; i++) {
71 checksum += nvram->read(i);
72 }
73
74 checksum_old = ((nvram->read(checksum_location)<<8) | nvram->read(checksum_location+1));
75
76 return (checksum_old == checksum);
77}
78
79void fix_options_checksum_with(const struct nvram_accessor *nvram)
80{

Callers 1

get_option_withFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected