Untitled_Kernel/include/asm.h
lordtet 7b4e4afd43 Defined a couple of functions, added documentation templates
Didn't feel the need to make a new branch for this one, but i added some
doxygen documentation templates to all of the headers. It's a bit
overdue.
2025-07-17 07:36:45 -04:00

32 lines
743 B
C

/**
* @file asm.h
* @brief Assembly wrappers
* @author Jake "lordtet" Holtham
* @date 2025
* Wrapper functions for using assembly files.
*/
#ifndef ASM_H
#define ASM_H
#include <stdint.h>
/**
* @brief Wrapper for asm instruction `out` that feeds a byte.
* @param port I/O Address for the port to send to
* @param data Data to send
*/
void outb(uint16_t port, uint8_t data);
/**
* @brief Wrapper for asm instruction "in" that receives bytewise.
* @param port I/O Address for the port to listen from
* @return (uint8_t) The received byte.
*/
uint8_t inb(uint16_t port);
/**
* @brief Refresh the CR3 register.
* Moves CR3 into a scratch register and back into CR3. Usually used to nuke the TLB.
*/
void cr3_reload();
#endif