diff options
author | Monte Copeland <copelanm@us.ibm.com> | 2011-08-04 11:15:39 -0500 |
---|---|---|
committer | Monte K. Copeland <copelanm@us.ibm.com> | 2011-08-15 13:25:06 -0500 |
commit | b0ceda93e7d5b6b06465a5fcc0b261a52dad987d (patch) | |
tree | fcaffe55a2357fd3e8837fb3c76a56e387e8eb34 /src/usr | |
parent | c7b83cbaf5b18e72846e24e26f990babc5b02708 (diff) | |
download | talos-hostboot-b0ceda93e7d5b6b06465a5fcc0b261a52dad987d.tar.gz talos-hostboot-b0ceda93e7d5b6b06465a5fcc0b261a52dad987d.zip |
Implement fapi::delay()
Change-Id: Id24144813b72005d410a12ec5a400d7d50afef00
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/227
Tested-by: Jenkins Server
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatUtil.C | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C index 8a3e22bf9..7962ba4bb 100644 --- a/src/usr/hwpf/plat/fapiPlatUtil.C +++ b/src/usr/hwpf/plat/fapiPlatUtil.C @@ -7,8 +7,10 @@ */ #include <assert.h> +#include <fapi.H> #include <trace/interface.H> -#include <fapiPlatTrace.H> +#include <sys/time.h> + //****************************************************************************** // Trace descriptors @@ -37,4 +39,32 @@ void fapiAssert(bool i_expression) assert(i_expression); } +//****************************************************************************** +// delay +// +// At the present time, VBU runs hostboot without a Simics +// front end. If a HW procedure wants to delay, we just make the +// syscall nanosleep(). In the syscall, the kernel will continue to consume +// clock cycles as it looks for a runnable task. When the sleep time expires, +// the calling task will resume running. +// +// In the future there could be a Simics front end to hostboot VBU. Then +// a possible implementation will be to use the Simics magic instruction +// to trigger a Simics hap. The Simics hap handler can call the simdispatcher +// client/server API to tell the Awan to advance some number of cycles. +// +// Monte 4 Aug 2011 +//****************************************************************************** + +fapi::ReturnCode delay( uint64_t i_nanoSeconds, uint64_t i_simCycles ) +{ + FAPI_DBG( INFO_MRK "delay %lld nanosec", i_nanoSeconds ); + nanosleep( 0, i_nanoSeconds ); + return fapi::FAPI_RC_SUCCESS; +} + + + + + } |