Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

ARM-specific Functions

10.2cksum.s

The file cksum.s contains optimized ARM and Thumb versions of the cksum() function. IP, UDP, TCP, and PPP use this function to calculate the checksum of a block of data. The algorithm implemented is described by RFC 1072. A C version of this function is also provided, in the \inet directory, but this should only be used if you suspect that there is some problem with these optimized versions.

It is possible to optimize the ARM implementation of this function by setting the NREG variable within this file to a value between one and eight. NREG controls the number of registers used to perform the checksumming operation. The default value of five has been selected through a benchmarking process. The ARMulator is used to emulate an ARM7TDMI core without caching, while performing TCP and UDP transfers of varying block sizes using the Loopback example program. You may want to run performance tests on your system to determine the best value to use, especially if the processor you are using has a data cache.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

10-5