summaryrefslogtreecommitdiffstats
path: root/src/include/arch
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-04-06 14:25:41 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-04-16 11:25:16 -0500
commit3cad095a5c2a1c6e70e56d5b7be773d148d86844 (patch)
treec72d11eecfd743aab0e7e6efd6dd4cf2dc02e0c5 /src/include/arch
parentd82aa02fa9b3fb5a5ca512241bc796ac8be3b9fd (diff)
downloadtalos-hostboot-3cad095a5c2a1c6e70e56d5b7be773d148d86844.tar.gz
talos-hostboot-3cad095a5c2a1c6e70e56d5b7be773d148d86844.zip
Code optimizations.
- Reduce DCBZ and ICBI calls in memory copy and init functions. - Reduce strlen calls in trace. - Set thread to low priority while waiting on in-kernel barrier. Change-Id: Ic9c23b1e26797ff393e5862819830de60554747e Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/871 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/arch')
-rw-r--r--src/include/arch/ppc.H42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/include/arch/ppc.H b/src/include/arch/ppc.H
index ae70f3547..77122be0d 100644
--- a/src/include/arch/ppc.H
+++ b/src/include/arch/ppc.H
@@ -258,21 +258,33 @@ inline void doze()
asm volatile("doze");
}
-/** @brief This is a special assembler instruction that is a nop on
+ALWAYS_INLINE
+inline size_t getCacheLineBytes()
+{
+ return 128;
+}
+
+ALWAYS_INLINE
+inline size_t getCacheLineWords()
+{
+ return getCacheLineBytes() / sizeof(uint64_t);
+}
+
+/** @brief This is a special assembler instruction that is a nop on
* regular hardware, but has special meaning to Simics. Code that
- * executes this instruction in Simics will cause a "hap," a
+ * executes this instruction in Simics will cause a "hap," a
* Simics term. If there is no hap handler registered, and magic
* breakpoints have not been enabled with
- * simics> enable-magic-breakpoint
- * then this instruction is also a nop in Simics.
- *
+ * simics> enable-magic-breakpoint
+ * then this instruction is also a nop in Simics.
+ *
* If magic breakpoints are enabled, and there is no hap handler, then
* when Hostboot code executes this instruction in Simics, Simics will
* stop the simulation. (Prompt changes from running> to simics> )
- *
+ *
* If a hap is registered, then Simics will call the hap handler. Hap
* handlers are written in Python, and the best place for them is
- *
+ *
* src/build/debug/simics-debug-framework.py
*
* Sample code to register the hap handler:
@@ -282,17 +294,17 @@ inline void doze()
* print "Hit magic instruction ", arg
* # Or else stop the simulation...
* SIM_break_simulation( "Stopped at magic instruction" )
- *
+ *
* # Register the magic instruction callback.
* SIM_hap_add_callback( "Core_Magic_Instruction", magic_instruction_callback, None )
*
* # Better to register the Hostboot range 7000-7999
* # so that PHYP and others won't be affected.
* SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback, None, 7000, 7999 )
- *
+ *
* The argument n is an integer from 0..8191 which Simics passes to the hap
- * handler in parameter 3, or "arg" in the sample code above.
- */
+ * handler in parameter 3, or "arg" in the sample code above.
+ */
ALWAYS_INLINE
inline void MAGIC_INSTRUCTION(int _n)
{
@@ -303,10 +315,10 @@ inline void MAGIC_INSTRUCTION(int _n)
"i" ((((n) >> 0) & 0xf) | 16));
}
-// Arguments to MAGIC_INSTRUCTION().
-// To ensure they do not conflict with haps from other groups (PHYP
+// Arguments to MAGIC_INSTRUCTION().
+// To ensure they do not conflict with haps from other groups (PHYP
// for example), assign hap numbers in the range 7000..7999 (decimal).
-// Presently, the hap handler for magic instruction is found in
+// Presently, the hap handler for magic instruction is found in
// src/build/debug/simics-debug-framework.py
// Jan 2012 Monte
@@ -314,7 +326,7 @@ enum
{
MAGIC_SHUTDOWN = 7006, // KernelMisc::shutdown() called.
MAGIC_BREAK = 7007, // hard-code a breakpoint
- MAGIC_CONTINUOUS_TRACE = 7055 // extract mixed trace buffer
+ MAGIC_CONTINUOUS_TRACE = 7055 // extract mixed trace buffer
};
OpenPOWER on IntegriCloud