corn/include/sys/physalloc.h

31 lines
720 B
C
Raw Permalink Normal View History

2024-01-29 00:22:09 +00:00
#pragma once
#ifndef MEMORY_INTERNAL
2024-02-04 19:19:54 +00:00
#error "Do not include headers from <sys/physalloc.h>, only use <memory.h>"
2024-01-29 00:22:09 +00:00
#endif
/**
* Allocates a single physical page in memory
* @preturns the physical address of the page
*/
2024-02-01 03:30:35 +00:00
void *alloc_phys_page(void);
2024-01-29 00:22:09 +00:00
/**
* Allocates count physical pages in memory
* @returns the physical address of the first page
*/
2024-02-01 03:30:35 +00:00
void *alloc_phys_pages(int count);
2024-01-29 00:22:09 +00:00
/**
* Frees a single physical page in memory
* @param ptr - the physical address of the page
*/
2024-02-01 03:30:35 +00:00
void free_phys_page(void *ptr);
2024-01-29 00:22:09 +00:00
/**
* Frees count physical pages in memory
* @param ptr - the physical address of the first page
* @param count - the number of pages in the list
*/
2024-02-01 03:30:35 +00:00
void free_phys_pages(void *ptr, int count);