summaryrefslogtreecommitdiffstats
path: root/src/include/sys
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-06-08 10:49:39 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-06-08 14:01:38 -0500
commit63657a69627ca1dbd10fb683a8096ab2e8e77f2b (patch)
treef5aa6875dfbdd887c52541c779ff275596ad8f6d /src/include/sys
parent74b9b31c9ae811dd527d4eb328e9fa93327442ab (diff)
downloadtalos-hostboot-63657a69627ca1dbd10fb683a8096ab2e8e77f2b.tar.gz
talos-hostboot-63657a69627ca1dbd10fb683a8096ab2e8e77f2b.zip
Create per-CPU mutex for XSCOM usage.
Change-Id: I76ad5c1d553d544b52910afd82e2716781ea13b9 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/140 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Diffstat (limited to 'src/include/sys')
-rw-r--r--src/include/sys/mmio.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h
index eb146da72..c36a13821 100644
--- a/src/include/sys/mmio.h
+++ b/src/include/sys/mmio.h
@@ -2,6 +2,7 @@
#define __SYS_MMIO_H
#include <stdint.h>
+#include <sys/mutex.h>
#ifdef __cplusplus
extern "C"
@@ -25,6 +26,20 @@ uint64_t mmio_hmer_read();
*/
int mmio_hmer_write(uint64_t value);
+/** @fn mmio_xscom_mutex()
+ * @brief Returns the per-CPU mutex for the XSCOM hardware logic.
+ *
+ * @pre Task must be pinned to a CPU by task_affinity_pin. Function will
+ * assert if not met.
+ *
+ * @returns The existing mutex for the CPU or creates a new one.
+ *
+ * @note The task should only interact with the mutex while protected by an
+ * affinity pin. If the pin is moved the mutex is no longer
+ * guarenteed for the CPU the task is executing on.
+ */
+mutex_t mmio_xscom_mutex();
+
#ifdef __cplusplus
}
#endif
OpenPOWER on IntegriCloud