diff options
author | Anshuman Khandual <khandual@linux.vnet.ibm.com> | 2014-08-13 14:27:45 +0530 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-13 19:01:36 +1000 |
commit | 087e04598ed74146c2f2eab5666cd4d4b53b6974 (patch) | |
tree | d0d4c15c2f4fae090f05cda1a2df20d51baf7d46 /include | |
parent | 0a22f85f524f366a3e2ef2af4a3faa0e9cef26ca (diff) | |
download | skiboot-087e04598ed74146c2f2eab5666cd4d4b53b6974.zip skiboot-087e04598ed74146c2f2eab5666cd4d4b53b6974.tar.gz skiboot-087e04598ed74146c2f2eab5666cd4d4b53b6974.tar.bz2 |
dpo: Add OPAL interface to access the DPO timeout
This patch adds a OPAL interface to fetch the DPO timeout. This
functionality is required to synchronously query Sapphire about
how much seconds are remaining for a forced system shutdown which
is useful in cases where the host has missed the OPAL_MSG_DPO for
some reason like system boot, reboot or kexec operations. This
ensures host can still query about the DPO timeout status and act.
This patch also adds helper routine to convert time base into seconds.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/opal.h | 3 | ||||
-rw-r--r-- | include/timebase.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/opal.h b/include/opal.h index eac7eb6..99a3335 100644 --- a/include/opal.h +++ b/include/opal.h @@ -140,7 +140,8 @@ #define OPAL_UNREGISTER_DUMP_REGION 102 #define OPAL_WRITE_TPO 103 #define OPAL_READ_TPO 104 -#define OPAL_LAST 104 +#define OPAL_GET_DPO_STATUS 105 +#define OPAL_LAST 105 #ifndef __ASSEMBLY__ diff --git a/include/timebase.h b/include/timebase.h index a1b787f..4537256 100644 --- a/include/timebase.h +++ b/include/timebase.h @@ -57,6 +57,11 @@ static inline unsigned long secs_to_tb(unsigned long secs) return secs * tb_hz; } +static inline unsigned long tb_to_secs(unsigned long tb) +{ + return tb / tb_hz; +} + static inline unsigned long msecs_to_tb(unsigned long msecs) { return msecs * (tb_hz / 1000); |