mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:37:45 +00:00
Kernel: Add safe atomic functions
This allows us to perform atomic operations on potentially unsafe user space pointers.
This commit is contained in:
parent
992f513ad2
commit
b17a889320
10 changed files with 573 additions and 166 deletions
|
@ -284,10 +284,6 @@ void flush_idt();
|
|||
void load_task_register(u16 selector);
|
||||
void handle_crash(RegisterState&, const char* description, int signal, bool out_of_memory = false);
|
||||
|
||||
[[nodiscard]] bool safe_memcpy(void* dest_ptr, const void* src_ptr, size_t n, void*& fault_at);
|
||||
[[nodiscard]] ssize_t safe_strnlen(const char* str, size_t max_n, void*& fault_at);
|
||||
[[nodiscard]] bool safe_memset(void* dest_ptr, int c, size_t n, void*& fault_at);
|
||||
|
||||
#define LSW(x) ((u32)(x)&0xFFFF)
|
||||
#define MSW(x) (((u32)(x) >> 16) & 0xFFFF)
|
||||
#define LSB(x) ((x)&0xFF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue