843 B
843 B
ASM instructions
Introduction
While the Shelter kernel is made in C, somes basic CPU functions require using ASM instructions. For that, we define wrappers that can be used anywhere in the kernel. These wrappers are defined inside the header file shelter/lib/include/cpu/asm.h which act as the only place in the entire kernel where the __asm__ should be used. The subsystem prefix is sh_asm_.
Overview
Here is a list of all the wrappers available. They are all defined as static inline function:
inb: take ash_uint16in input for specifying the port and return the inputed byteoutb: take ash_uint16for specifying the port and ash_uint8for specifying the byte to outputrdtsc: take no arguments and return the current TSC as ash_uint64invlpg: take avoid *as an address and return nothing