From 5cf79723ecb9a22de432d169ce65eb19aa651e8a Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Tue, 3 Jan 2012 04:39:56 +0000 Subject: move PP specific files to pp/ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31533 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/pp/kernel-pp.c | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 firmware/target/arm/pp/kernel-pp.c (limited to 'firmware/target/arm/pp/kernel-pp.c') diff --git a/firmware/target/arm/pp/kernel-pp.c b/firmware/target/arm/pp/kernel-pp.c new file mode 100644 index 0000000000..2a00254173 --- /dev/null +++ b/firmware/target/arm/pp/kernel-pp.c @@ -0,0 +1,64 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Björn Stenberg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "system.h" +#include "kernel.h" + +#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE) +void TIMER1(void) +{ + /* Run through the list of tick tasks (using main core) */ + TIMER1_VAL; /* Read value to ack IRQ */ + + /* Run through the list of tick tasks using main CPU core - + wake up the COP through its control interface to provide pulse */ + call_tick_tasks(); + +#if NUM_CORES > 1 + /* Pulse the COP */ + core_wake(COP); +#endif /* NUM_CORES */ +} +#endif + +/* Must be last function called init kernel/thread initialization */ +void tick_start(unsigned int interval_in_ms) +{ +#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE) + TIMER1_CFG = 0x0; + TIMER1_VAL; + /* enable timer */ + TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000 - 1); + /* unmask interrupt source */ + CPU_INT_EN = TIMER1_MASK; +#else + /* We don't enable interrupts in the bootloader */ + (void)interval_in_ms; +#endif +} + +#ifdef HAVE_BOOTLOADER_USB_MODE +void tick_stop(void) +{ + CPU_INT_DIS = TIMER1_MASK; + TIMER1_CFG = 0; +} +#endif -- cgit v1.2.3