mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core: remove COREIF_NG
This commit is contained in:
parent
27a41496aa
commit
bb4a5c5cdf
@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup core_arch
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Interrupt handling interface for globally en- and disabling interrupts
|
||||
*
|
||||
* This file acts as a wrapper between the kernels interrupt interface and the architecture
|
||||
* dependent implementation of the interfaces.
|
||||
*
|
||||
* @note All functions in this module have to be implemented in a way that it
|
||||
* is safe to call them from within the context of an ISR.
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef ARCH_IRQ_ARCH_H
|
||||
#define ARCH_IRQ_ARCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Define mapping between kernel internal and arch interfaces
|
||||
*
|
||||
* This mapping is done for compatibility of existing platforms,
|
||||
* new platforms should always use the *_arch_* interfaces.
|
||||
* @{
|
||||
*/
|
||||
#ifdef COREIF_NG
|
||||
#define irq_enable irq_arch_enable
|
||||
#define irq_disable irq_arch_disable
|
||||
#define irq_restore irq_arch_restore
|
||||
#define irq_is_in irq_arch_in
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Globally enable maskable interrupt sources
|
||||
*
|
||||
* @return the IRQ state after enabling interrupts
|
||||
*/
|
||||
unsigned int irq_arch_enable(void);
|
||||
|
||||
/**
|
||||
* @brief Globally disable all maskable interrupt sources
|
||||
*
|
||||
* @return the IRQ state before disabling interrupts
|
||||
*/
|
||||
unsigned int irq_arch_disable(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Restore a previously recorded IRQ state
|
||||
*
|
||||
* @param[in] state the state to set the IRQ flags to
|
||||
*/
|
||||
void irq_arch_restore(unsigned int state);
|
||||
|
||||
/**
|
||||
* @brief See if the current context is inside an ISR
|
||||
*
|
||||
* @return 1 if currently in interrupt context, 0 otherwise
|
||||
*/
|
||||
int irq_arch_in(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARCH_IRQ_ARCH_H */
|
||||
/** @} */
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 INRIA
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup core_arch
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Architecture dependent panic function
|
||||
*
|
||||
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
||||
*/
|
||||
|
||||
#ifndef ARCH_PANIC_ARCH_H
|
||||
#define ARCH_PANIC_ARCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief architecture dependent handling of an panic case
|
||||
*
|
||||
* This function gives the CPU the possibility to execute architecture
|
||||
* dependent code in case of an severe error.
|
||||
*/
|
||||
void panic_arch(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARCH_PANIC_ARCH_H */
|
||||
/** @} */
|
@ -1,96 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup core_arch
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Architecture dependent kernel interface for handling and managing threads
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef ARCH_THREAD_ARCH_H
|
||||
#define ARCH_THREAD_ARCH_H
|
||||
|
||||
#include "kernel_defines.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Define the mapping between the architecture independent interfaces
|
||||
* and the kernel internal interfaces
|
||||
*
|
||||
* This mapping is done for compatibility of existing platforms,
|
||||
* new platforms should always use the *_arch_* interfaces.
|
||||
* @{
|
||||
*/
|
||||
#ifdef COREIF_NG
|
||||
#define thread_stack_init thread_arch_stack_init
|
||||
#define thread_print_stack thread_arch_stack_print
|
||||
#define cpu_switch_context_exit thread_arch_start_threading
|
||||
#define thread_yield_higher thread_arch_yield
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Prototype for a thread entry function
|
||||
*/
|
||||
typedef void *(*thread_task_func_t)(void *arg);
|
||||
|
||||
/**
|
||||
* @brief Initialize a thread's stack
|
||||
*
|
||||
* @param[in] task_func pointer to the thread's code
|
||||
* @param[in] arg argument to task_func
|
||||
* @param[in] stack_start pointer to the start address of the thread
|
||||
* @param[in] stack_size the maximum size of the stack
|
||||
*
|
||||
* @return pointer to the new top of the stack
|
||||
*/
|
||||
char *thread_arch_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size);
|
||||
|
||||
/**
|
||||
* @brief Get the number of bytes used on the ISR stack
|
||||
*/
|
||||
int thread_arch_isr_stack_usage(void);
|
||||
|
||||
/**
|
||||
* @brief Get the current ISR stack pointer
|
||||
*/
|
||||
void *thread_arch_isr_stack_pointer(void);
|
||||
|
||||
/**
|
||||
* @brief Get the start of the ISR stack
|
||||
*/
|
||||
void *thread_arch_isr_stack_start(void);
|
||||
|
||||
/**
|
||||
* @brief Print the current stack to stdout
|
||||
*/
|
||||
void thread_arch_stack_print(void);
|
||||
|
||||
/**
|
||||
* @brief Start threading by loading a threads initial information from the stack
|
||||
*/
|
||||
void thread_arch_start_threading(void) NORETURN;
|
||||
|
||||
/**
|
||||
* @brief Pause the current thread and schedule the next pending, if available
|
||||
*/
|
||||
void thread_arch_yield(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARCH_THREAD_ARCH_H */
|
||||
/** @} */
|
@ -22,7 +22,6 @@
|
||||
#define IRQ_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "arch/irq_arch.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -74,6 +74,14 @@ typedef enum {
|
||||
* */
|
||||
NORETURN void core_panic(core_panic_t crash_code, const char *message);
|
||||
|
||||
/**
|
||||
* @brief architecture dependent handling of an panic case
|
||||
*
|
||||
* This function gives the CPU the possibility to execute architecture
|
||||
* dependent code in case of an severe error.
|
||||
*/
|
||||
void panic_arch(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -136,7 +136,11 @@ void sched_switch(uint16_t other_prio);
|
||||
/**
|
||||
* @brief Call context switching at thread exit
|
||||
*/
|
||||
NORETURN void cpu_switch_context_exit(void);
|
||||
extern void thread_start_threading(void);
|
||||
NORETURN static inline void cpu_switch_context_exit(void)
|
||||
{
|
||||
thread_start_threading();
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag indicating whether a context switch is necessary after handling an
|
||||
|
@ -122,7 +122,6 @@
|
||||
#include "clist.h"
|
||||
#include "cib.h"
|
||||
#include "msg.h"
|
||||
#include "arch/thread_arch.h"
|
||||
#include "cpu_conf.h"
|
||||
#include "sched.h"
|
||||
|
||||
@ -167,6 +166,11 @@
|
||||
#define STATUS_PENDING 10 /**< waiting to be scheduled to run */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Prototype for a thread entry function
|
||||
*/
|
||||
typedef void *(*thread_task_func_t)(void *arg);
|
||||
|
||||
/**
|
||||
* @brief @c thread_t holds thread's context data.
|
||||
*/
|
||||
@ -462,11 +466,36 @@ const char *thread_getname(kernel_pid_t pid);
|
||||
uintptr_t thread_measure_stack_free(char *stack);
|
||||
#endif /* DEVELHELP */
|
||||
|
||||
/**
|
||||
* @brief Get the number of bytes used on the ISR stack
|
||||
*/
|
||||
int thread_isr_stack_usage(void);
|
||||
|
||||
/**
|
||||
* @brief Get the current ISR stack pointer
|
||||
*/
|
||||
void *thread_isr_stack_pointer(void);
|
||||
|
||||
/**
|
||||
* @brief Get the start of the ISR stack
|
||||
*/
|
||||
void *thread_isr_stack_start(void);
|
||||
|
||||
/**
|
||||
* @brief Print the current stack to stdout
|
||||
*/
|
||||
void thread_stack_print(void);
|
||||
|
||||
/**
|
||||
* @brief Prints human readable, ps-like thread information for debugging purposes
|
||||
*/
|
||||
void thread_print_stack(void);
|
||||
|
||||
/**
|
||||
* @brief Start threading by loading a threads initial information from the stack
|
||||
*/
|
||||
void thread_start_threading(void) NORETURN;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "cpu.h"
|
||||
#include "irq.h"
|
||||
#include "panic.h"
|
||||
#include "arch/panic_arch.h"
|
||||
#include "periph/pm.h"
|
||||
#include "log.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user