Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
phys_window.h
Go to the documentation of this file.
1#ifndef __MEMORY__PHYS_WINDOW_H__
2#define __MEMORY__PHYS_WINDOW_H__
3
4#include <spinlock.h>
5#include <type.h>
6
8enum {
12};
13
15enum {
19};
20
21typedef struct {
24 _Atomic int lock;
26} __attribute__((aligned(64))) mem_physwindow_t;
27
29 uintptr_t* virt_addr,
32mem_physwindow_t* mem_resolve_physwindow(uintptr_t virt_addr);
33
34#endif // __MEMORY__PHYS_WINDOW_H__
typedef __attribute__
Definition msi.c:47
mem_physwindow_status_t mem_release_physwindow(uintptr_t virt_addr)
Definition phys_window.c:60
mem_physwindow_status_t mem_create_physwindow(uintptr_t phys_addr, uintptr_t *virt_addr, mem_physwindow_flag_t flag)
Definition phys_window.c:28
mem_physwindow_t * mem_resolve_physwindow(uintptr_t virt_addr)
resolve a physical memory window by virtual address
Definition phys_window.c:18
@ PHYS_WINDOW_FLAG_READ
Definition phys_window.h:16
@ PHYS_WINDOW_FLAG_LOCK
Definition phys_window.h:18
@ PHYS_WINDOW_FLAG_WRITE
Definition phys_window.h:17
int mem_physwindow_status_t
Definition phys_window.h:7
int mem_physwindow_flag_t
Definition phys_window.h:14
@ PHYS_WINDOW_STATUS_OK
Definition phys_window.h:9
@ PHYS_WINDOW_STATUS_NOT_FOUND
Definition phys_window.h:11
@ PHYS_WINDOW_STATUS_ERROR
Definition phys_window.h:10
uintptr_t phys_addr
Definition slab.h:6
mem_physwindow_flag_t flag
Definition phys_window.h:25
_Atomic int lock
Definition phys_window.h:24
uintptr_t virt_addr
Definition phys_window.h:22
uintptr_t phys_addr
Definition phys_window.h:23
unsigned long uintptr_t
Definition type.h:73