2lib: Move context-related functions from 2misc.c into 2context.c

This patch separates out some code into an extra file so that it's
easier to link into hostlib without pulling in all additional
dependencies from the random 2misc.c crap. The functions are copied
wholesale with no changes.

BRANCH=None
BUG=chromium:1024732
TEST=make runtests

Change-Id: Ia00d1da277e5fc0956c8a1ae608d842224016c91
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1917819
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
3 files changed