aboutsummaryrefslogtreecommitdiff
path: root/include/helpers.h
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-07-24 14:26:42 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-07-24 14:46:22 +0530
commit3ee6dcc87520f02ce09c59c61158ba0c2b5d0e10 (patch)
tree56646d014afc5944366243ddf4aeb0b269b0f5f1 /include/helpers.h
parentf904d529765b8866997d6b05cb7442b3b108054d (diff)
downloadSLOF-3ee6dcc87520f02ce09c59c61158ba0c2b5d0e10.zip
SLOF-3ee6dcc87520f02ce09c59c61158ba0c2b5d0e10.tar.gz
SLOF-3ee6dcc87520f02ce09c59c61158ba0c2b5d0e10.tar.bz2
usb-slof: forth support routines for C
Code inherited from libusb code written by former SLOF team Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'include/helpers.h')
-rw-r--r--include/helpers.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/helpers.h b/include/helpers.h
new file mode 100644
index 0000000..60dbda2
--- /dev/null
+++ b/include/helpers.h
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * Copyright (c) 2007, 2012, 2013 IBM Corporation
+ * All rights reserved.
+ * This program and the accompanying materials
+ * are made available under the terms of the BSD License
+ * which accompanies this distribution, and is available at
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation
+ *****************************************************************************/
+/*
+ * USB SLOF Prototypes
+ */
+
+#ifndef _USB_SLOF_H
+#define _USB_SLOF_H
+
+#include <stdint.h>
+
+extern uint32_t SLOF_GetTimer(void);
+extern void SLOF_msleep(uint32_t time);
+extern void *SLOF_dma_alloc(long size);
+extern void SLOF_dma_free(void *virt, long size);
+extern long SLOF_dma_map_in(void *virt, long size, int cacheable);
+extern void SLOF_dma_map_out(long phys, void *virt, long size);
+
+static inline void barrier(void)
+{
+ asm volatile("" : : : "memory");
+}
+#define cpu_relax() barrier()
+
+#endif