Nil RTOS
Classes | Macros | Typedefs | Functions
nilcore.h File Reference

Nil RTOS AVR port main header file. More...

#include <avr/io.h>
#include <avr/interrupt.h>
Include dependency graph for nilcore.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  port_extctx
 Interrupt saved context. More...
 
struct  port_intctx
 System saved context. More...
 

Macros

#define NIL_WORKING_AREA(s, n)   stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)]
 Static working area allocation. More...
 
#define port_disable()   asm volatile ("cli" : : : "memory")
 Disables all the interrupt sources.
 
#define port_enable()   asm volatile ("sei" : : : "memory")
 Enables all the interrupt sources.
 
#define port_init()
 Port-related initialization code. More...
 
#define PORT_INT_REQUIRED_STACK   32
 Per-thread stack overhead for interrupts servicing. More...
 
#define PORT_IRQ_EPILOGUE()
 IRQ epilogue code. More...
 
#define PORT_IRQ_HANDLER(id)   ISR(id)
 IRQ handler function declaration. More...
 
#define PORT_IRQ_PROLOGUE()
 IRQ prologue code. More...
 
#define port_lock()   asm volatile ("cli" : : : "memory")
 Kernel-lock action. More...
 
#define port_lock_from_isr()
 Kernel-lock action from an interrupt handler. More...
 
#define port_suspend()   asm volatile ("cli" : : : "memory")
 Disables the interrupt sources below kernel-level priority.
 
#define port_switch(ntp, otp)   _port_switch(ntp, otp)
 Performs a context switch between two threads. More...
 
#define PORT_THREAD(tname, arg)   __attribute__((noreturn)) void tname(void *arg)
 Thread declaration macro optimized for GCC.
 
#define port_unlock()   asm volatile ("sei" : : : "memory")
 Kernel-unlock action. More...
 
#define port_unlock_from_isr()
 Kernel-unlock action from an interrupt handler. More...
 
#define port_wait_for_interrupt()   asm volatile ("sleep" : : : "memory")
 Enters an architecture-dependent IRQ-waiting mode. More...
 
#define SETUP_CONTEXT(tp, workspace, wsize, pf, arg)
 Platform dependent context creation for new threads. More...
 
#define STACK_ALIGN(n)   ((((n) - 1) | (sizeof(stkalign_t) - 1)) + 1)
 Enforces a correct alignment for a stack area size value.
 
#define THD_WA_SIZE(n)
 Computes the thread working area global size.
 

Typedefs

typedef uint8_t stkalign_t
 Stack and memory alignment enforcement.
 

Functions

void _port_switch (thread_t *ntp, thread_t *otp)
 Performs a context switch between two threads. More...
 
void _port_thread_start (void)
 Start a thread by invoking its work function. More...
 
void port_halt (void)
 Halts the system. More...
 

Detailed Description

Nil RTOS AVR port main header file.