coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mcall.h File Reference
#include <arch/encoding.h>
#include <arch/smp/atomic.h>
#include <stdint.h>
Include dependency graph for mcall.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sbi_device_message
 
struct  blocker
 
struct  hls_t
 

Macros

#define MENTRY_FRAME_SIZE   (HLS_SIZE + 37 * __SIZEOF_POINTER__)
 
#define MACHINE_STACK_TOP()
 
#define HLS()   ((hls_t*)(MACHINE_STACK_TOP() - HLS_SIZE))
 
#define OTHER_HLS(id)   ((hls_t*)((void*)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id)))
 
#define MACHINE_STACK_SIZE   RISCV_PGSIZE
 

Functions

 _Static_assert (sizeof(hls_t)==HLS_SIZE, "HLS_SIZE must equal to sizeof(hls_t)")
 
void hls_init (uint32_t hart_id, void *fdt)
 
void mtime_init (void)
 
void set_msip (int hartid, int val)
 

Macro Definition Documentation

◆ HLS

#define HLS ( )    ((hls_t*)(MACHINE_STACK_TOP() - HLS_SIZE))

Definition at line 63 of file mcall.h.

◆ MACHINE_STACK_SIZE

#define MACHINE_STACK_SIZE   RISCV_PGSIZE

Definition at line 66 of file mcall.h.

◆ MACHINE_STACK_TOP

#define MACHINE_STACK_TOP ( )
Value:
({ \
/* coverity[uninit_use] : FALSE */ \
register uintptr_t sp asm ("sp"); \
(void*)((sp + RISCV_PGSIZE) & -RISCV_PGSIZE); })
unsigned long uintptr_t
Definition: stdint.h:21

Definition at line 57 of file mcall.h.

◆ MENTRY_FRAME_SIZE

#define MENTRY_FRAME_SIZE   (HLS_SIZE + 37 * __SIZEOF_POINTER__)

Definition at line 17 of file mcall.h.

◆ OTHER_HLS

#define OTHER_HLS (   id)    ((hls_t*)((void*)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id)))

Definition at line 64 of file mcall.h.

Function Documentation

◆ _Static_assert()

_Static_assert ( sizeof(hls_t = =HLS_SIZE,
"HLS_SIZE must equal to sizeof(hls_t)"   
)

◆ hls_init()

void hls_init ( uint32_t  hart_id,
void fdt 
)

Definition at line 7 of file mcall.c.

References HLS, memset(), and mtime_init().

Here is the call graph for this function:

◆ mtime_init()

void mtime_init ( void  )

Definition at line 8 of file clint.c.

References FU540_CLINT, HLS, QEMU_VIRT_CLINT, and SPIKE_CLINT_BASE.

Referenced by hls_init().

Here is the caller graph for this function:

◆ set_msip()

void set_msip ( int  hartid,
int  val 
)

Definition at line 15 of file clint.c.

References FU540_CLINT, QEMU_VIRT_CLINT, SPIKE_CLINT_BASE, val, and write32().

Referenced by send_ipi(), smp_pause(), and smp_resume().

Here is the call graph for this function:
Here is the caller graph for this function: