summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/qoriq/include/tm27.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-21 15:18:02 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-21 15:18:02 +0000
commitdc0a7df67469f1170cfb95114c03f5980710c1be (patch)
tree202b566de761b1f6090696c89ccf4b787f3dc0cb /c/src/lib/libbsp/powerpc/qoriq/include/tm27.h
parent2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-dc0a7df67469f1170cfb95114c03f5980710c1be.tar.bz2
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1799/bsps * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac, clock/clock-config.c, console/console-config.c, console/uart-bridge-master.c, console/uart-bridge-slave.c, include/.cvsignore, include/bsp.h, include/hwreg_vals.h, include/intercom.h, include/irq.h, include/mmu.h, include/qoriq.h, include/tm27.h, include/tsec-config.h, include/u-boot-config.h, include/uart-bridge.h, irq/irq.c, make/custom/qoriq.inc, make/custom/qoriq_core_0.cfg, make/custom/qoriq_core_1.cfg, make/custom/qoriq_p1020rdb.cfg, network/if_intercom.c, network/network.c, rtc/rtc-config.c, shmsupp/intercom-mpci.c, shmsupp/intercom.c, shmsupp/lock.S, start/start.S, startup/bsppredriverhook.c, startup/bspreset.c, startup/bspstart.c, startup/linkcmds.base, startup/linkcmds.qoriq_core_0, startup/linkcmds.qoriq_core_1, startup/linkcmds.qoriq_p1020rdb, startup/mmu-config.c, startup/mmu-tlb1.S, startup/mmu.c: New files.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/include/tm27.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/tm27.h b/c/src/lib/libbsp/powerpc/qoriq/include/tm27.h
new file mode 100644
index 0000000000..bc38d5f559
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/qoriq/include/tm27.h
@@ -0,0 +1,67 @@
+/**
+ * @file
+ *
+ * @ingroup QorIQ
+ *
+ * @brief Support file for Timer Test 27.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifndef _RTEMS_TMTEST27
+ #error "This is an RTEMS internal file you must not include directly."
+#endif /* _RTEMS_TMTEST27 */
+
+#ifndef TMTESTS_TM27_H
+#define TMTESTS_TM27_H
+
+#include <libcpu/powerpc-utility.h>
+#include <bsp/vectors.h>
+
+#define MUST_WAIT_FOR_INTERRUPT 1
+
+static rtems_isr_entry tm27_interrupt_handler = NULL;
+
+static int tm27_exception_handler( BSP_Exception_frame *frame, unsigned number)
+{
+ tm27_interrupt_handler( 0);
+
+ return 0;
+}
+
+void Install_tm27_vector( rtems_isr_entry handler)
+{
+ int rv = 0;
+
+ tm27_interrupt_handler = handler;
+
+ rv = ppc_exc_set_handler( ASM_DEC_VECTOR, tm27_exception_handler);
+ if (rv < 0) {
+ printk( "Error installing clock interrupt handler!\n");
+ }
+}
+
+#define Cause_tm27_intr() \
+ ppc_set_decrementer_register( 8)
+
+#define Clear_tm27_intr() \
+ ppc_set_decrementer_register( UINT32_MAX)
+
+#define Lower_tm27_intr() \
+ (void) ppc_external_exceptions_enable()
+
+#endif /* TMTESTS_TM27_H */