Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
Loading...
Searching...
No Matches
Macros
asm_helper.h File Reference

Assembly helper macros for system register access. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define READ_SYS_REG(reg, val)
 
#define WRITE_SYS_REG(reg, val)
 

Detailed Description

Assembly helper macros for system register access.

Declares macros that wrap MRS/MSR instructions for reading and writing ARM64 system registers from C.

Author
Abhin Parekadan Jose
Date
2026-05-16

Macro Definition Documentation

◆ READ_SYS_REG

#define READ_SYS_REG (   reg,
  val 
)
Value:
do { \
asm volatile("mrs %0, " #reg : "=r"(val)); \
} while (0)

Read a system register

◆ WRITE_SYS_REG

#define WRITE_SYS_REG (   reg,
  val 
)
Value:
do { \
asm volatile("msr " #reg ", %0" : : "r"(val)); \
} while (0)

Write to a system register