<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26577">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">arch/x86: Introduce postcar_frame_add_romcache()<br><br>Provide a common implementation to add an MTRR entry for memory-<br>mapped boot ROMs.<br><br>Change-Id: I9fabc6b87fb36dc3d970805eb804cd950b8849d4<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M src/arch/x86/include/arch/cpu.h<br>1 file changed, 13 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/26577/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h</span><br><span>index 5d44aae..beef70a 100644</span><br><span>--- a/src/arch/x86/include/arch/cpu.h</span><br><span>+++ b/src/arch/x86/include/arch/cpu.h</span><br><span>@@ -17,6 +17,7 @@</span><br><span> #include <stdint.h></span><br><span> #include <stddef.h></span><br><span> #include <rules.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <cpu/x86/mtrr.h></span><br><span> </span><br><span> /*</span><br><span>  * EFLAGS bits</span><br><span>@@ -283,6 +284,18 @@</span><br><span>                                 uintptr_t addr, size_t size, int type);</span><br><span> </span><br><span> /*</span><br><span style="color: hsl(120, 100%, 40%);">+ * Add variable MTRR covering the memory-mapped ROM with given MTRR type.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+static inline void postcar_frame_add_romcache(</span><br><span style="color: hsl(120, 100%, 40%);">+             struct postcar_frame *pcf, int type)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           postcar_frame_add_mtrr(</span><br><span style="color: hsl(120, 100%, 40%);">+                       pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, MTRR_TYPE_WRPROT);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span>  * Push used MTRR and Max MTRRs on to the stack</span><br><span>  * and return pointer to stack top.</span><br><span>  */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26577">change 26577</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26577"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9fabc6b87fb36dc3d970805eb804cd950b8849d4 </div>
<div style="display:none"> Gerrit-Change-Number: 26577 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>