Lines Matching refs:offset
28 long chksum_bios_get_offset( byte* data, long offset );
29 byte chksum_bios_calc_value( byte* data, long offset );
30 byte chksum_bios_get_value( byte* data, long offset );
31 void chksum_bios_set_value( byte* data, long offset, byte value );
36 long chksum_pmid_get_offset( byte* data, long offset );
37 byte chksum_pmid_calc_value( byte* data, long offset );
38 byte chksum_pmid_get_value( byte* data, long offset );
39 void chksum_pmid_set_value( byte* data, long offset, byte value );
43 long chksum_pcir_get_offset( byte* data, long offset );
53 long offset, tmp_offset, pcir_offset;
92 offset = 0L;
93 while( (tmp_offset = chksum_pmid_get_offset( bios_data, offset )) != -1L ) {
94 offset = tmp_offset;
95 cur_val = chksum_pmid_get_value( bios_data, offset );
96 new_val = chksum_pmid_calc_value( bios_data, offset );
97 printf( "\nPMID entry at: 0x%4lX\n", offset );
104 chksum_pmid_set_value( bios_data, offset, new_val );
118 offset = 0L;
119 pcir_offset = chksum_pcir_get_offset( bios_data, offset );
132 offset = 0L;
134 offset = chksum_bios_get_offset(bios_data, offset);
135 cur_val = chksum_bios_get_value(bios_data, offset);
136 new_val = chksum_bios_calc_value(bios_data, offset);
145 printf("\nBios checksum at: 0x%4lX\n", offset);
150 chksum_bios_set_value(bios_data, offset, new_val);
184 long chksum_bios_get_offset( byte* data, long offset ) {
190 byte chksum_bios_calc_value( byte* data, long offset ) {
196 for( i = 0; i < offset; i++ ) {
204 byte chksum_bios_get_value( byte* data, long offset ) {
206 return( *( data + offset ) );
210 void chksum_bios_set_value( byte* data, long offset, byte value ) {
212 *( data + offset ) = value;
216 byte chksum_pmid_calc_value( byte* data, long offset ) {
223 check((offset + len) <= (bios_len - 1), "PMID entry length out of bounds" );
227 sum = sum + *( data + offset + i );
235 long chksum_pmid_get_offset( byte* data, long offset ) {
239 while ((offset + PMID_LEN) < (bios_len - 1)) {
240 offset = offset + 1;
241 if( *( data + offset + 0 ) == 'P' && \
242 *( data + offset + 1 ) == 'M' && \
243 *( data + offset + 2 ) == 'I' && \
244 *( data + offset + 3 ) == 'D' ) {
245 result = offset;
253 byte chksum_pmid_get_value( byte* data, long offset ) {
255 check((offset + PMID_CHKSUM) <= (bios_len - 1), "PMID checksum out of bounds" );
256 return( *( data + offset + PMID_CHKSUM ) );
260 void chksum_pmid_set_value( byte* data, long offset, byte value ) {
262 check((offset + PMID_CHKSUM) <= (bios_len - 1), "PMID checksum out of bounds" );
263 *( data + offset + PMID_CHKSUM ) = value;
267 long chksum_pcir_get_offset( byte* data, long offset ) {
271 while ((offset + PCIR_LEN) < (bios_len - 1)) {
272 offset = offset + 1;
273 if( *( data + offset + 0 ) == 'P' && \
274 *( data + offset + 1 ) == 'C' && \
275 *( data + offset + 2 ) == 'I' && \
276 *( data + offset + 3 ) == 'R' ) {
277 result = offset;