Memtest86+: Refactor serial port code to reduce global variables

The serial port code in lib.c used global variables all over the
place. Instead, constrict all the serial related variables to one
global structure, and only allow the top-level functions to access
it. Since we're at it, I've also reversed the order of arguments in
the serial register accessors to be consistent with C syntax.

The main motivation behind this is to enable support MMIO UARTS, which
are almost impossible to escape nowadays.
Stay tuned (or read next patch).

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Change-Id: Ibb9b8c49614aaf124df5f05048fa298b9afbf3d8
Reviewed-on: https://review.coreboot.org/c/memtest86plus/+/37058
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
1 file changed