| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Early boot support code for BootX bootloader |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2005 Ben. Herrenschmidt (benh@kernel.crashing.org) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public License |
|---|
| 8 | | - * as published by the Free Software Foundation; either version |
|---|
| 9 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 112 | 108 | |
|---|
| 113 | 109 | #define dt_push_token(token, mem) \ |
|---|
| 114 | 110 | do { \ |
|---|
| 115 | | - *(mem) = _ALIGN_UP(*(mem),4); \ |
|---|
| 111 | + *(mem) = ALIGN(*(mem),4); \ |
|---|
| 116 | 112 | *((u32 *)*(mem)) = token; \ |
|---|
| 117 | 113 | *(mem) += 4; \ |
|---|
| 118 | 114 | } while(0) |
|---|
| .. | .. |
|---|
| 154 | 150 | /* push property content */ |
|---|
| 155 | 151 | if (size && data) { |
|---|
| 156 | 152 | memcpy((void *)*mem_end, data, size); |
|---|
| 157 | | - *mem_end = _ALIGN_UP(*mem_end + size, 4); |
|---|
| 153 | + *mem_end = ALIGN(*mem_end + size, 4); |
|---|
| 158 | 154 | } |
|---|
| 159 | 155 | } |
|---|
| 160 | 156 | |
|---|
| .. | .. |
|---|
| 307 | 303 | *lp++ = *p; |
|---|
| 308 | 304 | } |
|---|
| 309 | 305 | *lp = 0; |
|---|
| 310 | | - *mem_end = _ALIGN_UP((unsigned long)lp + 1, 4); |
|---|
| 306 | + *mem_end = ALIGN((unsigned long)lp + 1, 4); |
|---|
| 311 | 307 | |
|---|
| 312 | 308 | /* get and store all properties */ |
|---|
| 313 | 309 | while (*ppp) { |
|---|
| .. | .. |
|---|
| 360 | 356 | /* Start using memory after the big blob passed by BootX, get |
|---|
| 361 | 357 | * some space for the header |
|---|
| 362 | 358 | */ |
|---|
| 363 | | - mem_start = mem_end = _ALIGN_UP(((unsigned long)bi) + start, 4); |
|---|
| 359 | + mem_start = mem_end = ALIGN(((unsigned long)bi) + start, 4); |
|---|
| 364 | 360 | DBG("Boot params header at: %x\n", mem_start); |
|---|
| 365 | 361 | hdr = (struct boot_param_header *)mem_start; |
|---|
| 366 | 362 | mem_end += sizeof(struct boot_param_header); |
|---|
| 367 | | - rsvmap = (u64 *)(_ALIGN_UP(mem_end, 8)); |
|---|
| 363 | + rsvmap = (u64 *)(ALIGN(mem_end, 8)); |
|---|
| 368 | 364 | hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - mem_start; |
|---|
| 369 | 365 | mem_end = ((unsigned long)rsvmap) + 8 * sizeof(u64); |
|---|
| 370 | 366 | |
|---|
| .. | .. |
|---|
| 390 | 386 | hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; |
|---|
| 391 | 387 | |
|---|
| 392 | 388 | /* Build structure */ |
|---|
| 393 | | - mem_end = _ALIGN(mem_end, 16); |
|---|
| 389 | + mem_end = ALIGN(mem_end, 16); |
|---|
| 394 | 390 | DBG("Building device tree structure at: %x\n", mem_end); |
|---|
| 395 | 391 | hdr->off_dt_struct = mem_end - mem_start; |
|---|
| 396 | 392 | bootx_scan_dt_build_struct(base, 4, &mem_end); |
|---|
| .. | .. |
|---|
| 408 | 404 | * also bump mem_reserve_cnt to cause further reservations to |
|---|
| 409 | 405 | * fail since it's too late. |
|---|
| 410 | 406 | */ |
|---|
| 411 | | - mem_end = _ALIGN(mem_end, PAGE_SIZE); |
|---|
| 407 | + mem_end = ALIGN(mem_end, PAGE_SIZE); |
|---|
| 412 | 408 | DBG("End of boot params: %x\n", mem_end); |
|---|
| 413 | 409 | rsvmap[0] = mem_start; |
|---|
| 414 | 410 | rsvmap[1] = mem_end; |
|---|