Browse Source

c++: core: add extern C in header files

dev/timer
Pham Huu Dang Nhat 8 years ago
parent
commit
2ded32dee7
  1. 7
      core/include/arch/atomic_arch.h
  2. 7
      core/include/arch/hwtimer_arch.h
  3. 7
      core/include/arch/io_arch.h
  4. 7
      core/include/arch/irq_arch.h
  5. 7
      core/include/arch/lpm_arch.h
  6. 7
      core/include/arch/reboot_arch.h
  7. 7
      core/include/arch/thread_arch.h
  8. 8
      core/include/atomic.h
  9. 8
      core/include/attributes.h
  10. 8
      core/include/bitarithm.h
  11. 8
      core/include/cib.h
  12. 8
      core/include/clist.h
  13. 8
      core/include/config.h
  14. 8
      core/include/crash.h
  15. 8
      core/include/debug.h
  16. 8
      core/include/flags.h
  17. 8
      core/include/hwtimer.h
  18. 8
      core/include/io.h
  19. 8
      core/include/irq.h
  20. 8
      core/include/kernel.h
  21. 8
      core/include/kernel_internal.h
  22. 8
      core/include/kernel_types.h
  23. 8
      core/include/lifo.h
  24. 8
      core/include/lpm.h
  25. 8
      core/include/msg.h
  26. 8
      core/include/mutex.h
  27. 8
      core/include/priority_queue.h
  28. 8
      core/include/sched.h
  29. 8
      core/include/tcb.h
  30. 7
      core/include/thread.h

7
core/include/arch/atomic_arch.h

@ -19,6 +19,10 @@
#ifndef __ATOMIC_ARCH_H
#define __ATOMIC_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Define mappings between arch and internal interfaces
*
@ -41,6 +45,9 @@
*/
unsigned int atomic_arch_set_return(unsigned int *to_set, unsigned int value);
#ifdef __cplusplus
}
#endif
#endif /* __ATOMIC_ARCH_H */
/** @} */

7
core/include/arch/hwtimer_arch.h

@ -22,6 +22,10 @@
#ifndef HWTIMER_ARCH_H_
#define HWTIMER_ARCH_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
@ -73,6 +77,9 @@ void hwtimer_arch_unset(short timer);
*/
unsigned long hwtimer_arch_now(void);
#ifdef __cplusplus
}
#endif
#endif /* HWTIMER_ARCH_H_ */
/** @} */

7
core/include/arch/io_arch.h

@ -19,6 +19,10 @@
#ifndef __IO_ARCH_H
#define __IO_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Define mapping between kernel internal and arch interfaces
*
@ -44,6 +48,9 @@
*/
int io_arch_puts(char *data, int count);
#ifdef __cplusplus
}
#endif
#endif /* __IO_ARCH_H */
/** @} */

7
core/include/arch/irq_arch.h

@ -22,6 +22,10 @@
#ifndef __IRQ_ARCH_H
#define __IRQ_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Define mapping between kernel internal and arch interfaces
*
@ -66,6 +70,9 @@ void irq_arch_restore(unsigned int state);
*/
int irq_arch_in(void);
#ifdef __cplusplus
}
#endif
#endif /* __IRQ_ARCH_H */
/** @} */

7
core/include/arch/lpm_arch.h

@ -22,6 +22,10 @@
#ifndef __LPM_ARCH_H
#define __LPM_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Define the mapping between the architecture independent interfaces
and the kernel internal interfaces
@ -88,6 +92,9 @@ void lpm_arch_begin_awake(void);
*/
void lpm_arch_end_awake(void);
#ifdef __cplusplus
}
#endif
#endif /* __LPM_ARCH_H */
/** @} */

7
core/include/arch/reboot_arch.h

@ -20,6 +20,10 @@
#ifndef __REBOOT_ARCH_H
#define __REBOOT_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Reboot the system
*
@ -30,6 +34,9 @@
*/
int reboot_arch(int mode);
#ifdef __cplusplus
}
#endif
#endif /* __REBOOT_ARCH_H */
/** @} */

7
core/include/arch/thread_arch.h

@ -19,6 +19,10 @@
#ifndef __THREAD_ARCH_H
#define __THREAD_ARCH_H
#ifdef __cplusplus
extern "C" {
#endif
#include "attributes.h"
/**
@ -65,6 +69,9 @@ void thread_arch_start_threading(void) NORETURN;
*/
void thread_arch_yield(void);
#ifdef __cplusplus
}
#endif
#endif /* __THREAD_ARCH_H */
/** @} */

8
core/include/atomic.h

@ -19,6 +19,10 @@
#ifndef _ATOMIC_H
#define _ATOMIC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "arch/atomic_arch.h"
/**
@ -31,5 +35,9 @@
*/
unsigned int atomic_set_return(unsigned int *val, unsigned int set);
#ifdef __cplusplus
}
#endif
#endif /* _ATOMIC_H */
/** @} */

8
core/include/attributes.h

@ -19,6 +19,10 @@
#ifndef ATTRIBUTES_H_
#define ATTRIBUTES_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @def NORETURN
* @brief The *NORETURN* keyword tells the compiler to assume that the function
@ -68,5 +72,9 @@
#define UNREACHABLE() do { /* nothing */ } while (1)
#endif
#ifdef __cplusplus
}
#endif
#endif /* ATTRIBUTES_H_ */
/** @} */

8
core/include/bitarithm.h

@ -20,6 +20,10 @@
#ifndef BITARITHM_H_
#define BITARITHM_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @def SETBIT
* @brief Sets a bitmask for a bitfield
@ -114,5 +118,9 @@ unsigned bitarithm_lsb(register unsigned v);
*/
unsigned bitarithm_bits_set(unsigned v);
#ifdef __cplusplus
}
#endif
#endif /* BITARITHM_H_ */
/** @} */

8
core/include/cib.h

@ -21,6 +21,10 @@
#ifndef __CIB_H
#define __CIB_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief circular integer buffer structure
*/
@ -68,5 +72,9 @@ int cib_put(cib_t *cib);
*/
int cib_avail(cib_t *cib);
#ifdef __cplusplus
}
#endif
#endif /* __CIB_H */
/** @} */

8
core/include/clist.h

@ -19,6 +19,10 @@
#ifndef __CLIST_H
#define __CLIST_H
#ifdef __cplusplus
extern "C" {
#endif
#include "kernel_macros.h"
/**
@ -85,5 +89,9 @@ static inline void clist_advance(clist_node_t **list)
void clist_print(clist_node_t *clist);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CLIST_H */
/** @} */

8
core/include/config.h

@ -19,6 +19,10 @@
#ifndef CONFIG_H
#define CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define CONFIG_KEY (0x1701) /**< key to identify configuration */
@ -66,5 +70,9 @@ uint8_t config_save(void);
*/
void config_load(void);
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_H */
/** @} */

8
core/include/crash.h

@ -22,6 +22,10 @@
#ifndef __CRASH_H
#define __CRASH_H
#ifdef __cplusplus
extern "C" {
#endif
#include "kernel.h"
/**
@ -46,5 +50,9 @@
* */
NORETURN void core_panic(int crash_code, const char *message);
#ifdef __cplusplus
}
#endif
#endif /* __CRASH_H */
/** @} */

8
core/include/debug.h

@ -21,6 +21,10 @@
#ifndef __DEBUG_H
#define __DEBUG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "sched.h"
@ -80,5 +84,9 @@
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* __DEBUG_H */
/** @} */

8
core/include/flags.h

@ -19,6 +19,10 @@
#ifndef _FLAGS_H
#define _FLAGS_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Optional flags for controlling a threads initial state.
* @{
@ -30,5 +34,9 @@
usage (for debugging) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* _FLAGS_H */
/** @} */

8
core/include/hwtimer.h

@ -33,6 +33,10 @@
#ifndef __HWTIMER_H
#define __HWTIMER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "hwtimer_cpu.h"
#include "board.h"
@ -172,5 +176,9 @@ void hwtimer_init_comp(uint32_t fcpu);
*/
void hwtimer_spin(unsigned long ticks);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* __HWTIMER_H */

8
core/include/io.h

@ -21,6 +21,10 @@
#ifndef IO_H
#define IO_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Firmware putstring implementation
*
@ -29,5 +33,9 @@
*/
int fw_puts(char *data, int count);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* IO_H */

8
core/include/irq.h

@ -21,6 +21,10 @@
#ifndef IRQ_H_
#define IRQ_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include "arch/irq_arch.h"
@ -69,5 +73,9 @@ void restoreIRQ(unsigned state);
*/
int inISR(void);
#ifdef __cplusplus
}
#endif
#endif /* IRQ_H_ */
/** @} */

8
core/include/kernel.h

@ -22,6 +22,10 @@
#ifndef KERNEL_H_
#define KERNEL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
@ -136,5 +140,9 @@ int reboot(int mode);
*/
#define RB_AUTOBOOT 0
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_H_ */
/** @} */

8
core/include/kernel_internal.h

@ -19,6 +19,10 @@
#ifndef KERNEL_INTERNAL_H_
#define KERNEL_INTERNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "attributes.h"
/**
@ -55,5 +59,9 @@ NORETURN void sched_task_exit(void);
*/
void thread_print_stack(void);
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_INTERNAL_H_ */
/** @} */

8
core/include/kernel_types.h

@ -9,6 +9,10 @@
#ifndef KERNEL_TYPES_H
#define KERNEL_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <inttypes.h>
#include <limits.h>
@ -63,4 +67,8 @@
*/
typedef int16_t kernel_pid_t;
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_TYPES_H */

8
core/include/lifo.h

@ -23,6 +23,10 @@
#ifndef __LIFO_H_
#define __LIFO_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Check if the given lifo is empty.
*
@ -62,5 +66,9 @@ void lifo_insert(int *array, int i);
*/
int lifo_get(int *array);
#ifdef __cplusplus
}
#endif
#endif /* __LIFO_H_ */
/** @} */

8
core/include/lpm.h

@ -23,6 +23,10 @@
#ifndef LPM_H_
#define LPM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "arch/lpm_arch.h"
/**
@ -60,5 +64,9 @@ void lpm_end_awake(void);
*/
enum lpm_mode lpm_get(void);
#ifdef __cplusplus
}
#endif
#endif /* __LPM_H_ */
/** @} */

8
core/include/msg.h

@ -32,6 +32,10 @@
#ifndef __MSG_H_
#define __MSG_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include "kernel_types.h"
@ -180,5 +184,9 @@ int msg_reply(msg_t *m, msg_t *reply);
*/
int msg_init_queue(msg_t *array, int num);
#ifdef __cplusplus
}
#endif
#endif /* __MSG_H_ */
/** @} */

8
core/include/mutex.h

@ -21,6 +21,10 @@
#ifndef __MUTEX_H_
#define __MUTEX_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "priority_queue.h"
/**
@ -92,5 +96,9 @@ void mutex_unlock(mutex_t *mutex);
*/
void mutex_unlock_and_sleep(mutex_t *mutex);
#ifdef __cplusplus
}
#endif
#endif /* __MUTEX_H_ */
/** @} */

8
core/include/priority_queue.h

@ -19,6 +19,10 @@
#ifndef __QUEUE_H
#define __QUEUE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
@ -110,5 +114,9 @@ void priority_queue_print(priority_queue_t *root);
void priority_queue_print_node(priority_queue_t *root);
#endif
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* __QUEUE_H */

8
core/include/sched.h

@ -80,6 +80,10 @@
#ifndef _SCHEDULER_H
#define _SCHEDULER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include "bitarithm.h"
#include "tcb.h"
@ -178,5 +182,9 @@ void sched_register_cb(void (*callback)(uint32_t, uint32_t));
#endif
#ifdef __cplusplus
}
#endif
#endif // _SCHEDULER_H
/** @} */

8
core/include/tcb.h

@ -20,6 +20,10 @@
#ifndef TCB_H_
#define TCB_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "priority_queue.h"
#include "clist.h"
@ -78,5 +82,9 @@ typedef struct tcb_t {
#endif
} tcb_t;
#ifdef __cplusplus
}
#endif
#endif /* TCB_H_ */
/** @} */

7
core/include/thread.h

@ -21,6 +21,9 @@
#ifndef __THREAD_H
#define __THREAD_H
#ifdef __cplusplus
extern "C" {
#endif
#include "kernel.h"
#include "tcb.h"
@ -156,5 +159,9 @@ static inline kernel_pid_t thread_getpid(void)
int thread_measure_stack_free(char *stack);
#endif
#ifdef __cplusplus
}
#endif
/* @} */
#endif /* __THREAD_H */

Loading…
Cancel
Save