2025-01-17 21:46:47 +04:00
|
|
|
#pragma once
|
2025-02-01 17:25:59 +04:00
|
|
|
#include <stdint.h>
|
2025-01-17 21:46:47 +04:00
|
|
|
|
2026-04-07 23:07:51 +03:00
|
|
|
static inline void stosl(void *addr, int data, int cnt) {
|
|
|
|
|
asm volatile("cld; rep stosl"
|
|
|
|
|
:
|
|
|
|
|
: "D"(addr), "c"(cnt), "a"(data)
|
|
|
|
|
: "memory");
|
2025-01-17 21:46:47 +04:00
|
|
|
}
|
|
|
|
|
|
2026-04-07 23:07:51 +03:00
|
|
|
static inline void stosb(void *addr, unsigned char data, int cnt) {
|
|
|
|
|
asm volatile("cld; rep stosb"
|
|
|
|
|
:
|
|
|
|
|
: "D"(addr), "c"(cnt), "a"(data)
|
|
|
|
|
: "memory");
|
2025-01-17 21:46:47 +04:00
|
|
|
}
|
2025-01-17 23:29:01 +04:00
|
|
|
|
2026-04-07 23:07:51 +03:00
|
|
|
static inline void lcr3(uint32_t val) {
|
|
|
|
|
asm volatile("mov %0,%%cr3" : : "r"(val));
|
2025-01-17 23:29:01 +04:00
|
|
|
}
|