Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
arch.h File Reference

RISCV specific kernel interface header This header contains the RISCV specific kernel interface. More...

Go to the source code of this file.

Data Structures

struct  k_mem_partition_attr_t
 
struct  arch_mem_domain
 

Macros

#define ARCH_STACK_PTR_ALIGN   16
 
#define ARCH_THREAD_STACK_RESERVED
 
#define ARCH_THREAD_STACK_SIZE_ADJUST(size)
 
#define ARCH_THREAD_STACK_OBJ_ALIGN(size)
 
#define RV_REGSIZE   4
 
#define RV_REGSHIFT   2
 
#define MSTATUS_IEN   (1UL << 3)
 
#define MSTATUS_MPP_M   (3UL << 11)
 
#define MSTATUS_MPIE_EN   (1UL << 7)
 
#define MSTATUS_FS_OFF   (0UL << 13)
 
#define MSTATUS_FS_INIT   (1UL << 13)
 
#define MSTATUS_FS_CLEAN   (2UL << 13)
 
#define MSTATUS_FS_DIRTY   (3UL << 13)
 
#define MSTATUS_DEF_RESTORE   (MSTATUS_MPP_M | MSTATUS_MPIE_EN)
 
#define K_MEM_PARTITION_P_RW_U_RW
 
#define K_MEM_PARTITION_P_RW_U_RO
 
#define K_MEM_PARTITION_P_RW_U_NA
 
#define K_MEM_PARTITION_P_RO_U_RO
 
#define K_MEM_PARTITION_P_RO_U_NA
 
#define K_MEM_PARTITION_P_NA_U_NA
 
#define K_MEM_PARTITION_P_RWX_U_RWX
 
#define K_MEM_PARTITION_P_RX_U_RX
 

Functions

static ALWAYS_INLINE unsigned int arch_irq_lock (void)
 
static ALWAYS_INLINE void arch_irq_unlock (unsigned int key)
 
static ALWAYS_INLINE bool arch_irq_unlocked (unsigned int key)
 
static ALWAYS_INLINE void arch_nop (void)
 
uint32_t sys_clock_cycle_get_32 (void)
 
static uint32_t arch_k_cycle_get_32 (void)
 
uint64_t sys_clock_cycle_get_64 (void)
 
static uint64_t arch_k_cycle_get_64 (void)
 

Detailed Description

RISCV specific kernel interface header This header contains the RISCV specific kernel interface.

It is included by the generic kernel interface header (arch/cpu.h)

Macro Definition Documentation

◆ ARCH_STACK_PTR_ALIGN

#define ARCH_STACK_PTR_ALIGN   16

◆ ARCH_THREAD_STACK_OBJ_ALIGN

#define ARCH_THREAD_STACK_OBJ_ALIGN ( size)
Value:
Z_RISCV_STACK_PMP_ALIGN

◆ ARCH_THREAD_STACK_RESERVED

#define ARCH_THREAD_STACK_RESERVED
Value:
ROUND_UP(Z_RISCV_STACK_GUARD_SIZE + CONFIG_PRIVILEGED_STACK_SIZE, \
Z_RISCV_STACK_PMP_ALIGN)
#define ROUND_UP(x, align)
Value of x rounded up to the next multiple of align.
Definition util.h:322

◆ ARCH_THREAD_STACK_SIZE_ADJUST

#define ARCH_THREAD_STACK_SIZE_ADJUST ( size)
Value:
ROUND_UP(size, Z_RISCV_STACK_PMP_ALIGN)

◆ K_MEM_PARTITION_P_NA_U_NA

#define K_MEM_PARTITION_P_NA_U_NA
Value:
{0})
uint32_t k_mem_partition_attr_t
Definition arch.h:346

◆ K_MEM_PARTITION_P_RO_U_NA

#define K_MEM_PARTITION_P_RO_U_NA
Value:

◆ K_MEM_PARTITION_P_RO_U_RO

#define K_MEM_PARTITION_P_RO_U_RO
Value:
{PMP_R})
#define PMP_R
Definition csr.h:136

◆ K_MEM_PARTITION_P_RW_U_NA

#define K_MEM_PARTITION_P_RW_U_NA
Value:

◆ K_MEM_PARTITION_P_RW_U_RO

#define K_MEM_PARTITION_P_RW_U_RO
Value:

◆ K_MEM_PARTITION_P_RW_U_RW

#define K_MEM_PARTITION_P_RW_U_RW
Value:
{PMP_R | PMP_W})
#define PMP_W
Definition csr.h:137

◆ K_MEM_PARTITION_P_RWX_U_RWX

#define K_MEM_PARTITION_P_RWX_U_RWX
Value:
{PMP_R | PMP_W | PMP_X})
#define PMP_X
Definition csr.h:138

◆ K_MEM_PARTITION_P_RX_U_RX

#define K_MEM_PARTITION_P_RX_U_RX

◆ MSTATUS_DEF_RESTORE

#define MSTATUS_DEF_RESTORE   (MSTATUS_MPP_M | MSTATUS_MPIE_EN)

◆ MSTATUS_FS_CLEAN

#define MSTATUS_FS_CLEAN   (2UL << 13)

◆ MSTATUS_FS_DIRTY

#define MSTATUS_FS_DIRTY   (3UL << 13)

◆ MSTATUS_FS_INIT

#define MSTATUS_FS_INIT   (1UL << 13)

◆ MSTATUS_FS_OFF

#define MSTATUS_FS_OFF   (0UL << 13)

◆ MSTATUS_IEN

#define MSTATUS_IEN   (1UL << 3)

◆ MSTATUS_MPIE_EN

#define MSTATUS_MPIE_EN   (1UL << 7)

◆ MSTATUS_MPP_M

#define MSTATUS_MPP_M   (3UL << 11)

◆ RV_REGSHIFT

#define RV_REGSHIFT   2

◆ RV_REGSIZE

#define RV_REGSIZE   4

Function Documentation

◆ arch_irq_lock()

static ALWAYS_INLINE unsigned int arch_irq_lock ( void )
static

◆ arch_irq_unlock()

static ALWAYS_INLINE void arch_irq_unlock ( unsigned int key)
static

◆ arch_irq_unlocked()

static ALWAYS_INLINE bool arch_irq_unlocked ( unsigned int key)
static

◆ arch_k_cycle_get_32()

static uint32_t arch_k_cycle_get_32 ( void )
inlinestatic

◆ arch_k_cycle_get_64()

static uint64_t arch_k_cycle_get_64 ( void )
inlinestatic

◆ arch_nop()

static ALWAYS_INLINE void arch_nop ( void )
static

◆ sys_clock_cycle_get_32()

uint32_t sys_clock_cycle_get_32 ( void )
extern

◆ sys_clock_cycle_get_64()

uint64_t sys_clock_cycle_get_64 ( void )
extern