HomeFreeBSD

MFC 306565,306566: Use timercmp() and timersub() in kdump.

Description

MFC 306565,306566: Use timercmp() and timersub() in kdump.

306565:
Use timercmp() and timersub() in kdump.

Previously, kdump used the kernel-only timervalsub() macro which required
defining _KERNEL when including <sys/time.h>. Now, kdump uses the existing
userland API. The timercmp() usage to check for a backwards timestamp is
also clearer and simpler than the previous code which checked the result of
the subtraction for a negative value.

While here, take advantage of the 3-arg timersub() to store the subtraction
results in a tempory timeval instead of overwriting the timestamp in the
ktrace record and then having to restore it.

306566:
Don't declare the 'temp' timeval as static.

Details

Provenance
jhbAuthored on
Parents
rS311838: rtwn_usb(4): do not try to modify global static structure.
Branches
Unknown
Tags
Unknown