Changeset e6c4b94 in mainline for kernel/generic/include/mm/frame.h
- Timestamp:
- 2011-11-16T19:52:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fadb07a
- Parents:
- 19c8030
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/frame.h
r19c8030 re6c4b94 50 50 typedef uint8_t frame_flags_t; 51 51 52 #define FRAME_NONE 0x0 52 53 /** Convert the frame address to kernel VA. */ 53 54 #define FRAME_KA 0x1 … … 60 61 /** Allocate a frame which can be identity-mapped. */ 61 62 #define FRAME_LOWMEM 0x10 63 /** Allocate a frame which cannot be identity-mapped. */ 64 #define FRAME_HIGHMEM 0x20 62 65 63 66 typedef uint8_t zone_flags_t; 64 67 68 #define ZONE_NONE 0x0 65 69 /** Available zone (free for allocation) */ 66 #define ZONE_AVAILABLE 0x 070 #define ZONE_AVAILABLE 0x1 67 71 /** Zone is reserved (not available for allocation) */ 68 #define ZONE_RESERVED 0x 872 #define ZONE_RESERVED 0x2 69 73 /** Zone is used by firmware (not available for allocation) */ 70 #define ZONE_FIRMWARE 0x 1074 #define ZONE_FIRMWARE 0x4 71 75 /** Zone contains memory that can be identity-mapped */ 72 #define ZONE_LOWMEM 0x20 76 #define ZONE_LOWMEM 0x8 77 /** Zone contains memory that cannot be identity-mapped */ 78 #define ZONE_HIGHMEM 0x10 73 79 74 #define FRAME_TO_ZONE_FLAGS(ff) (((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : 0) 80 /** Mask of zone bits that must be matched exactly. */ 81 #define ZONE_EF_MASK 0x7 82 83 #define FRAME_TO_ZONE_FLAGS(ff) \ 84 ((((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : \ 85 (((ff) & FRAME_HIGHMEM) ? ZONE_HIGHMEM : ZONE_NONE)) | \ 86 (ZONE_AVAILABLE | ZONE_LOWMEM | ZONE_HIGHMEM)) 87 88 #define ZONE_FLAGS_MATCH(zf, f) \ 89 (((((zf) & ZONE_EF_MASK)) == ((f) & ZONE_EF_MASK)) && \ 90 (((zf) & ~ZONE_EF_MASK) & (f))) 75 91 76 92 typedef struct { … … 131 147 } 132 148 133 NO_TRACE static inline bool zone_flags_available(zone_flags_t flags)134 {135 return ((flags & (ZONE_RESERVED | ZONE_FIRMWARE)) == 0);136 }137 138 149 #define IS_BUDDY_ORDER_OK(index, order) \ 139 150 ((~(((sysarg_t) -1) << (order)) & (index)) == 0)
Note:
See TracChangeset
for help on using the changeset viewer.