17.11.2012 Views

MVME5100 Single Board Computer Programmer's Reference Guide

MVME5100 Single Board Computer Programmer's Reference Guide

MVME5100 Single Board Computer Programmer's Reference Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

B<br />

<strong>MVME5100</strong> VPD <strong>Reference</strong> Information<br />

Configuration Checksum Calculation Code<br />

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *<br />

*<br />

* cssect - checksum section<br />

* description:<br />

* This component's purpose is to checksum the buffer pointed to<br />

* by the buffer pointer.<br />

* notes:<br />

* call:<br />

* argument #1 = buffer (section) to checksum<br />

* argument #2 = number of bytes in buffer<br />

* return:<br />

* 0xXX = checksum<br />

*/<br />

UCHAR<br />

cssect(nvram_ptr, count)<br />

register UCHAR *nvram_ptr; /* NVRAM buffer pointer */<br />

register UINT count; /* count, number of bytes */<br />

{<br />

register UCHAR y, isum, sum;<br />

for (sum = 0; count; count--) {<br />

}<br />

y = *nvram_ptr++;<br />

isum = sum + y;<br />

if ((isum < y) || (isum < sum)) isum += 1;<br />

sum = isum;<br />

return (sum); /* return calculated checksum */<br />

}<br />

B-14 <strong>Computer</strong> Group Literature Center Web Site

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!