]>
Commit | Line | Data |
---|---|---|
04e7ca8d LV |
1 | /* |
2 | * SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note | |
3 | * | |
4 | * Bootinfo tags from linux bootinfo.h and bootinfo-mac.h: | |
5 | * This is an easily parsable and extendable structure containing all | |
6 | * information to be passed from the bootstrap to the kernel | |
7 | * | |
8 | * This structure is copied right after the kernel by the bootstrap | |
9 | * routine. | |
10 | */ | |
11 | ||
12 | #ifndef HW_M68K_BOOTINFO_H | |
13 | #define HW_M68K_BOOTINFO_H | |
04e7ca8d | 14 | |
281ac13e | 15 | #define BOOTINFO0(base, id) \ |
04e7ca8d | 16 | do { \ |
281ac13e | 17 | stw_p(base, id); \ |
04e7ca8d | 18 | base += 2; \ |
281ac13e | 19 | stw_p(base, sizeof(struct bi_record)); \ |
04e7ca8d LV |
20 | base += 2; \ |
21 | } while (0) | |
22 | ||
281ac13e | 23 | #define BOOTINFO1(base, id, value) \ |
04e7ca8d | 24 | do { \ |
281ac13e | 25 | stw_p(base, id); \ |
04e7ca8d | 26 | base += 2; \ |
281ac13e | 27 | stw_p(base, sizeof(struct bi_record) + 4); \ |
04e7ca8d | 28 | base += 2; \ |
281ac13e | 29 | stl_p(base, value); \ |
04e7ca8d LV |
30 | base += 4; \ |
31 | } while (0) | |
32 | ||
281ac13e | 33 | #define BOOTINFO2(base, id, value1, value2) \ |
04e7ca8d | 34 | do { \ |
281ac13e | 35 | stw_p(base, id); \ |
04e7ca8d | 36 | base += 2; \ |
281ac13e | 37 | stw_p(base, sizeof(struct bi_record) + 8); \ |
04e7ca8d | 38 | base += 2; \ |
281ac13e | 39 | stl_p(base, value1); \ |
04e7ca8d | 40 | base += 4; \ |
281ac13e | 41 | stl_p(base, value2); \ |
04e7ca8d LV |
42 | base += 4; \ |
43 | } while (0) | |
44 | ||
281ac13e | 45 | #define BOOTINFOSTR(base, id, string) \ |
04e7ca8d | 46 | do { \ |
281ac13e | 47 | stw_p(base, id); \ |
04e7ca8d | 48 | base += 2; \ |
281ac13e | 49 | stw_p(base, \ |
2cfa9631 JD |
50 | (sizeof(struct bi_record) + strlen(string) + \ |
51 | 1 /* null termination */ + 3 /* padding */) & ~3); \ | |
04e7ca8d | 52 | base += 2; \ |
5f87dddb PMD |
53 | for (unsigned i_ = 0; string[i_]; i_++) { \ |
54 | stb_p(base++, string[i_]); \ | |
04e7ca8d | 55 | } \ |
281ac13e JD |
56 | stb_p(base++, 0); \ |
57 | base = QEMU_ALIGN_PTR_UP(base, 4); \ | |
04e7ca8d | 58 | } while (0) |
a988465d | 59 | |
281ac13e | 60 | #define BOOTINFODATA(base, id, data, len) \ |
a988465d | 61 | do { \ |
281ac13e | 62 | stw_p(base, id); \ |
a988465d | 63 | base += 2; \ |
281ac13e | 64 | stw_p(base, \ |
2cfa9631 JD |
65 | (sizeof(struct bi_record) + len + \ |
66 | 2 /* length field */ + 3 /* padding */) & ~3); \ | |
a988465d | 67 | base += 2; \ |
281ac13e | 68 | stw_p(base, len); \ |
a988465d | 69 | base += 2; \ |
5f87dddb PMD |
70 | for (unsigned i_ = 0; i_ < len; ++i_) { \ |
71 | stb_p(base++, data[i_]); \ | |
a988465d | 72 | } \ |
281ac13e | 73 | base = QEMU_ALIGN_PTR_UP(base, 4); \ |
a988465d | 74 | } while (0) |
04e7ca8d | 75 | #endif |