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 <>
Change-Id: Ibb9b8c49614aaf124df5f05048fa298b9afbf3d8
Tested-by: build bot (Jenkins) <>
Reviewed-by: Stefan Reinauer <>
1 file changed