update codes
This commit is contained in:
@@ -97,7 +97,7 @@ struct e820map {
|
||||
* that convert Page to other data types, such as phyical address.
|
||||
* */
|
||||
struct Page {
|
||||
atomic_t ref; // page frame's reference counter
|
||||
int ref; // page frame's reference counter
|
||||
uint32_t flags; // array of flags that describe the status of the page frame
|
||||
unsigned int property; // the num of free block, used in first fit pm manager
|
||||
list_entry_t page_link; // free list link
|
||||
|
||||
@@ -117,22 +117,24 @@ pde2page(pde_t pde) {
|
||||
|
||||
static inline int
|
||||
page_ref(struct Page *page) {
|
||||
return atomic_read(&(page->ref));
|
||||
return page->ref;
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_page_ref(struct Page *page, int val) {
|
||||
atomic_set(&(page->ref), val);
|
||||
page->ref = val;
|
||||
}
|
||||
|
||||
static inline int
|
||||
page_ref_inc(struct Page *page) {
|
||||
return atomic_add_return(&(page->ref), 1);
|
||||
page->ref += 1;
|
||||
return page->ref;
|
||||
}
|
||||
|
||||
static inline int
|
||||
page_ref_dec(struct Page *page) {
|
||||
return atomic_sub_return(&(page->ref), 1);
|
||||
page->ref -= 1;
|
||||
return page->ref;
|
||||
}
|
||||
|
||||
extern char bootstack[], bootstacktop[];
|
||||
|
||||
Reference in New Issue
Block a user