mynewt-core error types
More...
mynewt-core error types
Definition in file os.h.
#include <assert.h>
#include <stdint.h>
#include "irq.h"
#include "os/os_types.h"
#include "os/os_error.h"
#include "os/endian.h"
#include "os/os_callout.h"
#include "os/os_cputime.h"
#include "os/os_dev.h"
#include "os/os_eventq.h"
#include "os/os_mbuf.h"
#include "os/os_mempool.h"
#include "os/os_mutex.h"
#include "os/os_sem.h"
#include "os/os_task.h"
#include "os/os_time.h"
#include "os/os_trace_api.h"
#include "os/queue.h"
Go to the source code of this file.
|
| typedef uint32_t | os_sr_t |
| | CPU status register.
|
| |
|
PLEASE NOTE: Following macro definitions where copied directly from apache/mynewt-core and are under the copyright specified in the header.
|
| #define | min(a, b) |
| |
| #define | max(a, b) |
| |
| #define | OS_ALIGN(__n, __a) |
| |
| #define | OS_ALIGNMENT (4) |
| |
◆ max
Value:
Definition at line 43 of file os.h.
◆ min
Value:
Definition at line 39 of file os.h.
◆ OS_ALIGN
| #define OS_ALIGN |
( |
| __n, |
|
|
| __a ) |
Value: ( \
(((__n) & ((__a) - 1)) == 0) ? \
(__n) : \
((__n) + ((__a) - ((__n) & ((__a) - 1)))) \
)
Definition at line 46 of file os.h.
◆ OS_ALIGNMENT
Definition at line 51 of file os.h.
◆ OS_ASSERT_CRITICAL
| #define OS_ASSERT_CRITICAL |
( |
| ) |
|
Value:
#define assert(cond)
abort the program if assertion is false
static bool os_hw_is_in_critical(void)
Check if is in critical section.
Definition at line 65 of file os.h.
◆ OS_ENTER_CRITICAL
| #define OS_ENTER_CRITICAL |
( |
| _sr | ) |
|
Value:
static uint32_t os_hw_enter_critical(void)
Disable ISRs.
Definition at line 63 of file os.h.
◆ OS_EXIT_CRITICAL
| #define OS_EXIT_CRITICAL |
( |
| _sr | ) |
|
Value:
static void os_hw_exit_critical(uint32_t ctx)
Restores ISR context.
Definition at line 64 of file os.h.
◆ os_sr_t
CPU status register.
Definition at line 57 of file os.h.
◆ os_hw_enter_critical()
| static uint32_t os_hw_enter_critical |
( |
void | | ) |
|
|
inlinestatic |
Disable ISRs.
- Returns
- current isr context
Definition at line 73 of file os.h.
◆ os_hw_exit_critical()
| static void os_hw_exit_critical |
( |
uint32_t | ctx | ) |
|
|
inlinestatic |
Restores ISR context.
- Parameters
-
| [in] | ctx | ISR context to restore. |
Definition at line 84 of file os.h.
◆ os_hw_is_in_critical()
| static bool os_hw_is_in_critical |
( |
void | | ) |
|
|
inlinestatic |
Check if is in critical section.
- Returns
- true, if in critical section, false otherwise
Definition at line 94 of file os.h.