summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-03 02:19:49 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-03 02:19:49 +0000
commitbe5f16148584b0d771bdab651455cd9e27f556ce (patch)
tree3ef631d9392cdd3ff1c3f3876a9596c66ad9586a /MdePkg
parentf90eb36c1558f2728843bd81bda4958aaa4236a6 (diff)
downloadedk2-be5f16148584b0d771bdab651455cd9e27f556ce.zip
edk2-be5f16148584b0d771bdab651455cd9e27f556ce.tar.gz
edk2-be5f16148584b0d771bdab651455cd9e27f556ce.tar.bz2
Add AsmEnableCache() and AsmDisableCache() as the IA32 & x64 specific BaseLib API.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6807 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/BaseLib.h28
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DisableCache.c6
-rw-r--r--MdePkg/Library/BaseLib/Ia32/EnableCache.c6
3 files changed, 34 insertions, 6 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 4ffddfd..3cb2cdb 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -5213,6 +5213,34 @@ AsmCpuidEx (
/**
+ Set CD bit and clear NW bit of CR0 followed by a WBINVD.
+
+ Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0,
+ and executing a WBINVD instruction. This function is only available on IA-32 and x64.
+
+**/
+VOID
+EFIAPI
+AsmDisableCache (
+ VOID
+ );
+
+
+/**
+ Perform a WBINVD and clear both the CD and NW bits of CR0.
+
+ Enables the caches by executing a WBINVD instruction and then clear both the CD and NW
+ bits of CR0 to 0. This function is only available on IA-32 and x64.
+
+**/
+VOID
+EFIAPI
+AsmEnableCache (
+ VOID
+ );
+
+
+/**
Returns the lower 32-bits of a Machine Specific Register(MSR).
Reads and returns the lower 32-bits of the MSR specified by Index.
diff --git a/MdePkg/Library/BaseLib/Ia32/DisableCache.c b/MdePkg/Library/BaseLib/Ia32/DisableCache.c
index d2d028a..4ee3b88 100644
--- a/MdePkg/Library/BaseLib/Ia32/DisableCache.c
+++ b/MdePkg/Library/BaseLib/Ia32/DisableCache.c
@@ -13,10 +13,10 @@
**/
/**
- Disables caches.
+ Set CD bit and clear NW bit of CR0 followed by a WBINVD.
- Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a
- WBINVD instruction.
+ Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0,
+ and executing a WBINVD instruction. This function is only available on IA-32 and x64.
**/
VOID
diff --git a/MdePkg/Library/BaseLib/Ia32/EnableCache.c b/MdePkg/Library/BaseLib/Ia32/EnableCache.c
index 59e2b43..dab8903 100644
--- a/MdePkg/Library/BaseLib/Ia32/EnableCache.c
+++ b/MdePkg/Library/BaseLib/Ia32/EnableCache.c
@@ -13,10 +13,10 @@
**/
/**
- Enabled caches.
+ Perform a WBINVD and clear both the CD and NW bits of CR0.
- Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
- the NW bit of CR0 to 0
+ Enables the caches by executing a WBINVD instruction and then clear both the CD and NW
+ bits of CR0 to 0. This function is only available on IA-32 and x64.
**/
VOID