hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/powerpc/platforms/powermac/bootx_init.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Early boot support code for BootX bootloader
34 *
45 * 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.
106 */
117
128 #include <linux/kernel.h>
....@@ -112,7 +108,7 @@
112108
113109 #define dt_push_token(token, mem) \
114110 do { \
115
- *(mem) = _ALIGN_UP(*(mem),4); \
111
+ *(mem) = ALIGN(*(mem),4); \
116112 *((u32 *)*(mem)) = token; \
117113 *(mem) += 4; \
118114 } while(0)
....@@ -154,7 +150,7 @@
154150 /* push property content */
155151 if (size && data) {
156152 memcpy((void *)*mem_end, data, size);
157
- *mem_end = _ALIGN_UP(*mem_end + size, 4);
153
+ *mem_end = ALIGN(*mem_end + size, 4);
158154 }
159155 }
160156
....@@ -307,7 +303,7 @@
307303 *lp++ = *p;
308304 }
309305 *lp = 0;
310
- *mem_end = _ALIGN_UP((unsigned long)lp + 1, 4);
306
+ *mem_end = ALIGN((unsigned long)lp + 1, 4);
311307
312308 /* get and store all properties */
313309 while (*ppp) {
....@@ -360,11 +356,11 @@
360356 /* Start using memory after the big blob passed by BootX, get
361357 * some space for the header
362358 */
363
- mem_start = mem_end = _ALIGN_UP(((unsigned long)bi) + start, 4);
359
+ mem_start = mem_end = ALIGN(((unsigned long)bi) + start, 4);
364360 DBG("Boot params header at: %x\n", mem_start);
365361 hdr = (struct boot_param_header *)mem_start;
366362 mem_end += sizeof(struct boot_param_header);
367
- rsvmap = (u64 *)(_ALIGN_UP(mem_end, 8));
363
+ rsvmap = (u64 *)(ALIGN(mem_end, 8));
368364 hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - mem_start;
369365 mem_end = ((unsigned long)rsvmap) + 8 * sizeof(u64);
370366
....@@ -390,7 +386,7 @@
390386 hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase;
391387
392388 /* Build structure */
393
- mem_end = _ALIGN(mem_end, 16);
389
+ mem_end = ALIGN(mem_end, 16);
394390 DBG("Building device tree structure at: %x\n", mem_end);
395391 hdr->off_dt_struct = mem_end - mem_start;
396392 bootx_scan_dt_build_struct(base, 4, &mem_end);
....@@ -408,7 +404,7 @@
408404 * also bump mem_reserve_cnt to cause further reservations to
409405 * fail since it's too late.
410406 */
411
- mem_end = _ALIGN(mem_end, PAGE_SIZE);
407
+ mem_end = ALIGN(mem_end, PAGE_SIZE);
412408 DBG("End of boot params: %x\n", mem_end);
413409 rsvmap[0] = mem_start;
414410 rsvmap[1] = mem_end;