mirror of
https://git.stationery.faith/corn/corn.git
synced 2024-11-10 04:02:08 +00:00
31 lines
745 B
C
31 lines
745 B
C
|
#pragma once
|
||
|
|
||
|
#ifndef MEMORY_INTERNAL
|
||
|
#error "Do not include headers from <memory/___.h>, only use <memory.h>"
|
||
|
#endif
|
||
|
|
||
|
/**
|
||
|
* Allocates a single physical page in memory
|
||
|
* @preturns the physical address of the page
|
||
|
*/
|
||
|
extern void *alloc_phys_page(void);
|
||
|
|
||
|
/**
|
||
|
* Allocates count physical pages in memory
|
||
|
* @returns the physical address of the first page
|
||
|
*/
|
||
|
extern void *alloc_phys_pages(int count);
|
||
|
|
||
|
/**
|
||
|
* Frees a single physical page in memory
|
||
|
* @param ptr - the physical address of the page
|
||
|
*/
|
||
|
extern void free_phys_page(void *ptr);
|
||
|
|
||
|
/**
|
||
|
* Frees count physical pages in memory
|
||
|
* @param ptr - the physical address of the first page
|
||
|
* @param count - the number of pages in the list
|
||
|
*/
|
||
|
extern void free_phys_pages(void *ptr, int count);
|