summaryrefslogtreecommitdiff
path: root/cesar/hal/ipmbox/inc/ecos.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/hal/ipmbox/inc/ecos.h')
-rw-r--r--cesar/hal/ipmbox/inc/ecos.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/cesar/hal/ipmbox/inc/ecos.h b/cesar/hal/ipmbox/inc/ecos.h
new file mode 100644
index 0000000000..d30f0d16ec
--- /dev/null
+++ b/cesar/hal/ipmbox/inc/ecos.h
@@ -0,0 +1,50 @@
+#ifndef hal_ipmbox_inc_ipmbox_ecos_h
+#define hal_ipmbox_inc_ipmbox_ecos_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2012 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hal/ipmbox/inc/ipmbox_ecos.h
+ * \brief HAL IPMBox eCos management data.
+ * \ingroup hal_ipmbox
+ */
+#if defined (ECOS) && ECOS
+#include <cyg/hal/drv_api.h>
+#include <cyg/hal/hal_intr.h>
+#include "hal/leon/itc2.h"
+
+/* eCos function is dawn too slow, use HAL_INTERRUPT_ACKNOWLEDGE instead of
+ * cyg_drv_interrupt_acknowledge. */
+# define ipmbox_interrupt_acknowledge HAL_INTERRUPT_ACKNOWLEDGE
+
+/** Rx IPMBox DATA and MBX interrupt number. */
+# define IPMBOX_RX_IT_NUM CYGNUM_HAL_INTERRUPT_GIC2_14
+/** Rx Empty buf interrupt number. */
+# define IPMBOX_EMPTY_BUF_IT_NUM CYGNUM_HAL_INTERRUPT_GIC2_13
+
+/* We need this undocumented eCos function for budget. */
+extern void cyg_interrupt_post_dsr (CYG_ADDRWORD intr_obj);
+
+/* eCos interrupt management structure. */
+typedef struct ipmbox_ecos_t
+{
+ cyg_interrupt rx_it;
+ cyg_handle_t rx_it_handle;
+ cyg_interrupt empty_buf_it;
+ cyg_handle_t empty_buf_it_handle;
+} ipmbox_ecos_t;
+
+#else /* ! eCos */
+
+/** Rx IPMBox DATA and MBX interrupt number. */
+# define IPMBOX_RX_IT_NUM 0
+/** Rx Empty buf interrupt number. */
+# define IPMBOX_EMPTY_BUF_IT_NUM 1
+
+#endif
+
+#endif /* hal_ipmbox_inc_ipmbox_ecos_h */