Lines Matching defs:block
55 static int sram_add_pool(struct sram_dev *sram, struct sram_reserve *block,
61 NUMA_NO_NODE, block->label);
66 block->size, NUMA_NO_NODE);
75 static int sram_add_export(struct sram_dev *sram, struct sram_reserve *block,
88 part->battr.size = block->size;
93 static int sram_add_partition(struct sram_dev *sram, struct sram_reserve *block,
100 part->base = sram->virt_base + block->start;
102 if (block->pool) {
103 ret = sram_add_pool(sram, block, start, part);
107 if (block->export) {
108 ret = sram_add_export(sram, block, start, part);
112 if (block->protect_exec) {
113 ret = sram_check_protect_exec(sram, block, part);
117 ret = sram_add_pool(sram, block, start, part);
160 struct sram_reserve *rblocks, *block;
171 * We need an additional block to mark the end of the memory region
179 block = &rblocks[0];
193 "reserved block %pOF outside the sram area\n",
199 block->start = child_res.start - res->start;
200 block->size = resource_size(&child_res);
201 list_add_tail(&block->list, &reserve_list);
204 block->export = true;
207 block->pool = true;
210 block->protect_exec = true;
212 if ((block->export || block->pool || block->protect_exec) &&
213 block->size) {
227 block->label = devm_kstrdup(sram->dev,
229 if (!block->label) {
235 block->export ? "exported " : "", block->label,
236 block->start, block->start + block->size);
238 dev_dbg(sram->dev, "found reserved block 0x%x-0x%x\n",
239 block->start, block->start + block->size);
242 block++;
264 list_for_each_entry(block, &reserve_list, list) {
266 if (block->start < cur_start) {
268 "block at 0x%x starts after current offset 0x%lx\n",
269 block->start, cur_start);
275 if ((block->export || block->pool || block->protect_exec) &&
276 block->size) {
277 ret = sram_add_partition(sram, block,
278 res->start + block->start);
285 /* current start is in a reserved block, so continue after it */
286 if (block->start == cur_start) {
287 cur_start = block->start + block->size;
293 * address and the following reserved block, or the
296 cur_size = block->start - cur_start;
309 /* next allocation after this reserved block */
310 cur_start = block->start + block->size;