2017-01-23 00:21:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Cadence Design Systems, Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-19 23:32:08 +08:00
|
|
|
#include <zephyr/types.h>
|
2017-01-23 00:21:34 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <xtensa_api.h>
|
|
|
|
#include <kernel_arch_data.h>
|
|
|
|
#include <misc/__assert.h>
|
|
|
|
/*
|
|
|
|
* @internal
|
|
|
|
*
|
|
|
|
* @brief Set an interrupt's priority
|
|
|
|
*
|
|
|
|
* The priority is verified if ASSERT_ON is enabled.
|
|
|
|
*
|
2017-02-11 04:58:08 +08:00
|
|
|
* The priority is verified if ASSERT_ON is enabled. The maximum number of
|
|
|
|
* priority levels is a little complex, as there are some hardware priority
|
|
|
|
* levels which are reserved: three for various types of exceptions, and
|
|
|
|
* possibly one additional to support zero latency interrupts.
|
2017-01-23 00:21:34 +08:00
|
|
|
*
|
|
|
|
* Valid values are from 1 to 6. Interrupts of priority 1 are not masked when
|
2017-02-11 04:58:08 +08:00
|
|
|
* interrupts are locked system-wide, so care must be taken when using them.
|
|
|
|
* ISR installed with priority 0 interrupts cannot make kernel calls.
|
2017-01-23 00:21:34 +08:00
|
|
|
*
|
|
|
|
* @return N/A
|
|
|
|
*/
|
|
|
|
|
2017-04-21 02:30:33 +08:00
|
|
|
void _irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags)
|
2017-01-23 00:21:34 +08:00
|
|
|
{
|
|
|
|
__ASSERT(prio < XCHAL_EXCM_LEVEL + 1,
|
|
|
|
"invalid priority %d! values must be less than %d\n",
|
|
|
|
prio, XCHAL_EXCM_LEVEL + 1);
|
2017-02-11 04:58:08 +08:00
|
|
|
/* TODO: Write code to set priority if this is ever possible on
|
|
|
|
* Xtensa
|
|
|
|
*/
|
2017-01-23 00:21:34 +08:00
|
|
|
}
|
2018-11-01 08:01:03 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_DYNAMIC_INTERRUPTS
|
|
|
|
int _arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
|
|
|
|
void (*routine)(void *parameter), void *parameter,
|
|
|
|
u32_t flags)
|
|
|
|
{
|
|
|
|
ARG_UNUSED(flags);
|
|
|
|
ARG_UNUSED(priority);
|
|
|
|
|
|
|
|
z_isr_install(irq, routine, parameter);
|
|
|
|
return irq;
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_DYNAMIC_INTERRUPTS */
|