Changeset 8c441bd in mainline
- Timestamp:
- 2010-11-09T23:54:27Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 10285ad
- Parents:
- 854bfa5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/adt/bitmap.c
r854bfa5 r8c441bd 69 69 void bitmap_set_range(bitmap_t *bitmap, size_t start, size_t bits) 70 70 { 71 size_t i = 0;71 size_t i; 72 72 size_t aligned_start; 73 73 size_t lub; /* leading unaligned bits */ … … 81 81 amb = bits > lub ? bits - lub : 0; 82 82 tab = amb % 8; 83 84 if (start + bits < aligned_start) {85 /* Set bits in the middle of byte. */86 bitmap->map[start / 8] |= ((1 << lub) - 1) << (start & 7);87 return;88 }89 83 90 84 if (lub) { … … 111 105 void bitmap_clear_range(bitmap_t *bitmap, size_t start, size_t bits) 112 106 { 113 size_t i = 0;107 size_t i; 114 108 size_t aligned_start; 115 109 size_t lub; /* leading unaligned bits */ … … 123 117 amb = bits > lub ? bits - lub : 0; 124 118 tab = amb % 8; 125 126 if (start + bits < aligned_start) {127 /* Set bits in the middle of byte */128 bitmap->map[start / 8] &= ~(((1 << lub) - 1) << (start & 7));129 return;130 }131 119 132 120 if (lub) {
Note:
See TracChangeset
for help on using the changeset viewer.