Mark3 Realtime Kernel
threadport.h File Reference

ATMega1284p Multithreading support. More...

#include "portcfg.h"
#include "kerneltypes.h"
#include <avr/io.h>
#include <avr/interrupt.h>

Go to the source code of this file.

Namespaces

 Mark3
 

Macros

#define ASM(x)   asm volatile(x);
 
#define PORT_TOP_OF_STACK(x, y)   (reinterpret_cast<K_WORD*>(reinterpret_cast<K_ADDR>(x) + (static_cast<K_ADDR>(y) - 1)))
 Macro to find the top of a stack given its size and top address. More...
 
#define PORT_PUSH_TO_STACK(x, y)   *x = y; x--;
 Push a value y to the stack pointer x and decrement the stack pointer. More...
 
#define Thread_SaveContext()
 Save the context of the Thread. More...
 
#define Thread_RestoreContext()
 Restore the context of the Thread. More...
 

Functions

uint8_t Mark3::PORT_CLZ (uint8_t in_)
 
void Mark3::PORT_IRQ_ENABLE ()
 
void Mark3::PORT_IRQ_DISABLE ()
 
void Mark3::PORT_CS_ENTER ()
 
void Mark3::PORT_CS_EXIT ()
 
K_WORD Mark3::PORT_CS_NESTING ()
 

Variables

static constexpr auto Mark3::SR_ = uint8_t{0x3F}
 
K_WORD Mark3::g_kwSFR
 
K_WORD Mark3::g_kwCriticalCount
 

Detailed Description

ATMega1284p Multithreading support.

Definition in file threadport.h.

Macro Definition Documentation

◆ ASM

#define ASM (   x)    asm volatile(x);

Definition at line 32 of file threadport.h.

◆ PORT_PUSH_TO_STACK

#define PORT_PUSH_TO_STACK (   x,
 
)    *x = y; x--;

Push a value y to the stack pointer x and decrement the stack pointer.

Definition at line 38 of file threadport.h.

◆ PORT_TOP_OF_STACK

#define PORT_TOP_OF_STACK (   x,
 
)    (reinterpret_cast<K_WORD*>(reinterpret_cast<K_ADDR>(x) + (static_cast<K_ADDR>(y) - 1)))

Macro to find the top of a stack given its size and top address.

Definition at line 36 of file threadport.h.

◆ Thread_RestoreContext

#define Thread_RestoreContext ( )

Restore the context of the Thread.

Definition at line 91 of file threadport.h.

◆ Thread_SaveContext

#define Thread_SaveContext ( )

Save the context of the Thread.

Definition at line 42 of file threadport.h.