Changeset 23 for trunk/kernel/mm/page.c
- Timestamp:
- Jun 18, 2017, 10:06:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/page.c
r22 r23 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016 )5 * Alain Greiner (2016,2017) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites … … 44 44 page->flags = 0; 45 45 page->order = 0; 46 page->mapper = NULL; 46 47 page->index = 0; 47 page->mapper = NULL; 48 page->private = 0; 48 page->fork_nr = 0; 49 49 page->refcount = 0; 50 50 51 spinlock_init( &page->lock ); 51 52 list_entry_init( &page->list ); 53 xlist_root_init( XPTR( local_cxy , &page->wait_root ) ); 52 54 } 53 55 54 56 //////////////////////////////////////////// 55 57 inline void page_set_flag( page_t * page, 56 uint 16_t value )58 uint32_t value ) 57 59 { 58 60 hal_atomic_or( (uint32_t *)&page->flags , (uint32_t)value ); … … 61 63 ////////////////////////////////////////////// 62 64 inline void page_clear_flag( page_t * page, 63 uint 16_t value )65 uint32_t value ) 64 66 { 65 67 hal_atomic_and( (uint32_t *)&page->flags , ~((uint32_t)value) ); … … 68 70 ////////////////////////////////////////////// 69 71 inline bool_t page_is_flag( page_t * page, 70 uint 16_t value )71 { 72 return (bool_t)(page->flags & value);72 uint32_t value ) 73 { 74 return ( (page->flags & value) ? 1 : 0 ); 73 75 } 74 76 … … 150 152 151 153 // sync the page 152 mapper_sync_page( mapper , index ,page );154 vfs_move_page_from_mapper( page ); 153 155 154 156 // unlock the page … … 226 228 inline void page_refcount_up( page_t *page ) 227 229 { 228 hal_atomic_inc( &page->refcount);230 hal_atomic_add( &page->refcount , +1 ); 229 231 } 230 232 … … 232 234 inline void page_refcount_down( page_t *page ) 233 235 { 234 hal_atomic_dec( &page->refcount);236 hal_atomic_add( &page->refcount , -1 ); 235 237 } 236 238
Note: See TracChangeset
for help on using the changeset viewer.