Changes in kernel/generic/include/mm/frame.h [bbfdf62:9dae191e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/frame.h
rbbfdf62 r9dae191e 38 38 39 39 #include <typedefs.h> 40 #include <trace.h>41 40 #include <adt/list.h> 42 41 #include <mm/buddy.h> … … 82 81 83 82 typedef struct { 84 size_t refcount; 83 size_t refcount; /**< Tracking of shared frames */ 85 84 uint8_t buddy_order; /**< Buddy system block order */ 86 85 link_t buddy_link; /**< Link to the next free block inside … … 92 91 pfn_t base; /**< Frame_no of the first frame 93 92 in the frames array */ 94 size_t count; 95 size_t free_count; 93 size_t count; /**< Size of zone */ 94 size_t free_count; /**< Number of free frame_t 96 95 structures */ 97 size_t busy_count; 96 size_t busy_count; /**< Number of busy frame_t 98 97 structures */ 99 98 zone_flags_t flags; /**< Type of the zone */ … … 109 108 */ 110 109 typedef struct { 111 IRQ_SPINLOCK_DECLARE(lock);110 SPINLOCK_DECLARE(lock); 112 111 size_t count; 113 112 zone_t info[ZONES_MAX]; … … 116 115 extern zones_t zones; 117 116 118 NO_TRACEstatic inline uintptr_t PFN2ADDR(pfn_t frame)117 static inline uintptr_t PFN2ADDR(pfn_t frame) 119 118 { 120 119 return (uintptr_t) (frame << FRAME_WIDTH); 121 120 } 122 121 123 NO_TRACEstatic inline pfn_t ADDR2PFN(uintptr_t addr)122 static inline pfn_t ADDR2PFN(uintptr_t addr) 124 123 { 125 124 return (pfn_t) (addr >> FRAME_WIDTH); 126 125 } 127 126 128 NO_TRACEstatic inline size_t SIZE2FRAMES(size_t size)127 static inline size_t SIZE2FRAMES(size_t size) 129 128 { 130 129 if (!size) … … 133 132 } 134 133 135 NO_TRACEstatic inline size_t FRAMES2SIZE(size_t frames)134 static inline size_t FRAMES2SIZE(size_t frames) 136 135 { 137 136 return (size_t) (frames << FRAME_WIDTH); 138 137 } 139 138 140 NO_TRACEstatic inline bool zone_flags_available(zone_flags_t flags)139 static inline bool zone_flags_available(zone_flags_t flags) 141 140 { 142 141 return ((flags & (ZONE_RESERVED | ZONE_FIRMWARE)) == 0); … … 167 166 extern void frame_set_parent(pfn_t, void *, size_t); 168 167 extern void frame_mark_unavailable(pfn_t, size_t); 169 extern size_t zone_conf_size(size_t);168 extern uintptr_t zone_conf_size(size_t); 170 169 extern bool zone_merge(size_t, size_t); 171 170 extern void zone_merge_all(void);
Note:
See TracChangeset
for help on using the changeset viewer.