2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @file asm.h
|
|
|
|
|
* @brief Assembly wrappers
|
|
|
|
|
* @author Jake "lordtet" Holtham
|
|
|
|
|
* @date 2025
|
|
|
|
|
* Wrapper functions for using assembly files.
|
|
|
|
|
*/
|
2025-07-03 01:17:57 +00:00
|
|
|
#ifndef ASM_H
|
|
|
|
|
#define ASM_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2025-07-17 11:36:45 +00:00
|
|
|
/**
|
|
|
|
|
* @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
|
|
|
|
|
*/
|
2025-07-03 01:17:57 +00:00
|
|
|
void outb(uint16_t port, uint8_t data);
|
2025-07-17 11:36:45 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @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.
|
|
|
|
|
*/
|
2025-07-03 01:17:57 +00:00
|
|
|
uint8_t inb(uint16_t port);
|
2025-07-17 11:36:45 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Refresh the CR3 register.
|
|
|
|
|
* Moves CR3 into a scratch register and back into CR3. Usually used to nuke the TLB.
|
|
|
|
|
*/
|
2025-07-16 03:14:33 +00:00
|
|
|
void cr3_reload();
|
2025-07-03 01:17:57 +00:00
|
|
|
|
|
|
|
|
#endif
|