Add _ASMLANGUAGE guard to the event logger and the profiler.

Add _ASMLANGUAGE guard to allow using the header file in assembly
code.

Change-Id: I7feb6c720e335c6d4baeac274a6f550cdfed7b78
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
Yonattan Louise 2015-08-21 18:56:36 -05:00 committed by Anas Nashif
commit 46feabf7f7
2 changed files with 14 additions and 5 deletions

View file

@ -33,15 +33,15 @@
* @brief Event logger support. * @brief Event logger support.
*/ */
#include <nanokernel.h>
#include <errno.h>
#ifndef __EVENT_LOGGER_H__ #ifndef __EVENT_LOGGER_H__
#define __EVENT_LOGGER_H__ #define __EVENT_LOGGER_H__
#define EVENT_HEADER_SIZE 1 #define EVENT_HEADER_SIZE 1
#ifndef _ASMLANGUAGE
#include <nanokernel.h>
#include <errno.h>
struct event_header_bits { struct event_header_bits {
/* length in 32-bit words */ /* length in 32-bit words */
@ -165,4 +165,5 @@ int sys_event_logger_get_wait_timeout(struct event_logger *logger,
uint32_t *buffer, uint8_t buffer_size, uint32_t timeout); uint32_t *buffer, uint8_t buffer_size, uint32_t timeout);
#endif /* CONFIG_NANO_TIMEOUTS */ #endif /* CONFIG_NANO_TIMEOUTS */
#endif /* _ASMLANGUAGE */
#endif /* __EVENT_LOGGER_H__ */ #endif /* __EVENT_LOGGER_H__ */

View file

@ -43,8 +43,9 @@
#ifdef CONFIG_PROFILER_CONTEXT_SWITCH #ifdef CONFIG_PROFILER_CONTEXT_SWITCH
#define PROFILER_CONTEXT_SWITCH_EVENT_ID 0x0001 #define PROFILER_CONTEXT_SWITCH_EVENT_ID 0x0001
#endif /* CONFIG_PROFILER_CONTEXT_SWITCH */ #endif
#ifndef _ASMLANGUAGE
/** /**
* Global variable of the ring buffer that allows user to implement * Global variable of the ring buffer that allows user to implement
* their own reading routine. * their own reading routine.
@ -163,11 +164,18 @@ void sys_profiler_register_as_collector(void);
static inline void sys_profiler_register_as_collector(void) {}; static inline void sys_profiler_register_as_collector(void) {};
#endif /* CONFIG_PROFILER_CONTEXT_SWITCH */ #endif /* CONFIG_PROFILER_CONTEXT_SWITCH */
#endif /* _ASMLANGUAGE */
#else /* !CONFIG_KERNEL_PROFILER */ #else /* !CONFIG_KERNEL_PROFILER */
#ifndef _ASMLANGUAGE
static inline void sys_profiler_put(uint16_t event_id, uint32_t *event_data, static inline void sys_profiler_put(uint16_t event_id, uint32_t *event_data,
uint8_t data_size) {}; uint8_t data_size) {};
static inline void sys_profiler_put_timed(uint16_t event_id) {}; static inline void sys_profiler_put_timed(uint16_t event_id) {};
#endif /* _ASMLANGUAGE */
#endif /* CONFIG_KERNEL_PROFILER */ #endif /* CONFIG_KERNEL_PROFILER */
#endif /* __PROFILE_H__ */ #endif /* __PROFILE_H__ */