Flush cache after every write to in memory serial

This commit is contained in:
Zhuowei Zhang 2019-02-23 16:37:11 -08:00
parent 941ccaf626
commit aa8f3cccae
2 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include <Base.h>
#include <Library/SerialPortLib.h>
#include <Library/CacheMaintenanceLib.h>
/**
Initialize the serial device hardware.
@ -50,6 +51,7 @@ static void mem_putchar(UINT8 c) {
if (offset >= size) {
offset = 0;
}
WriteBackInvalidateDataCacheRange(base, size);
}
/**

View File

@ -34,3 +34,6 @@
[Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
CacheMaintenanceLib