update codes
This commit is contained in:
@@ -98,7 +98,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; // used in buddy system, stores the order (the X in 2^X) of the continuous memory block
|
||||
int zone_num; // used in buddy system, the No. of zone which the page belongs to
|
||||
|
||||
@@ -122,22 +122,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