2019-10-26 18:45:45 +02:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
|
|
|
|
*
|
|
|
|
* Bootinfo tags from linux bootinfo.h and bootinfo-mac.h:
|
|
|
|
* This is an easily parsable and extendable structure containing all
|
|
|
|
* information to be passed from the bootstrap to the kernel
|
|
|
|
*
|
|
|
|
* This structure is copied right after the kernel by the bootstrap
|
|
|
|
* routine.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_M68K_BOOTINFO_H
|
|
|
|
#define HW_M68K_BOOTINFO_H
|
|
|
|
|
2022-10-23 21:13:41 +02:00
|
|
|
#define BOOTINFO0(base, id) \
|
2019-10-26 18:45:45 +02:00
|
|
|
do { \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, id); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, sizeof(struct bi_record)); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 21:13:41 +02:00
|
|
|
#define BOOTINFO1(base, id, value) \
|
2019-10-26 18:45:45 +02:00
|
|
|
do { \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, id); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, sizeof(struct bi_record) + 4); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stl_p(base, value); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 21:13:41 +02:00
|
|
|
#define BOOTINFO2(base, id, value1, value2) \
|
2019-10-26 18:45:45 +02:00
|
|
|
do { \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, id); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, sizeof(struct bi_record) + 8); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stl_p(base, value1); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 4; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stl_p(base, value2); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 21:13:41 +02:00
|
|
|
#define BOOTINFOSTR(base, id, string) \
|
2019-10-26 18:45:45 +02:00
|
|
|
do { \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, id); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, \
|
2022-09-26 13:39:00 +02:00
|
|
|
(sizeof(struct bi_record) + strlen(string) + \
|
|
|
|
1 /* null termination */ + 3 /* padding */) & ~3); \
|
2019-10-26 18:45:45 +02:00
|
|
|
base += 2; \
|
2023-09-04 18:12:24 +02:00
|
|
|
for (unsigned i_ = 0; string[i_]; i_++) { \
|
|
|
|
stb_p(base++, string[i_]); \
|
2019-10-26 18:45:45 +02:00
|
|
|
} \
|
2022-10-23 21:13:41 +02:00
|
|
|
stb_p(base++, 0); \
|
|
|
|
base = QEMU_ALIGN_PTR_UP(base, 4); \
|
2019-10-26 18:45:45 +02:00
|
|
|
} while (0)
|
2022-06-26 13:18:04 +02:00
|
|
|
|
2022-10-23 21:13:41 +02:00
|
|
|
#define BOOTINFODATA(base, id, data, len) \
|
2022-06-26 13:18:04 +02:00
|
|
|
do { \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, id); \
|
2022-06-26 13:18:04 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, \
|
2022-09-26 13:39:00 +02:00
|
|
|
(sizeof(struct bi_record) + len + \
|
|
|
|
2 /* length field */ + 3 /* padding */) & ~3); \
|
2022-06-26 13:18:04 +02:00
|
|
|
base += 2; \
|
2022-10-23 21:13:41 +02:00
|
|
|
stw_p(base, len); \
|
2022-06-26 13:18:04 +02:00
|
|
|
base += 2; \
|
2023-09-04 18:12:24 +02:00
|
|
|
for (unsigned i_ = 0; i_ < len; ++i_) { \
|
|
|
|
stb_p(base++, data[i_]); \
|
2022-06-26 13:18:04 +02:00
|
|
|
} \
|
2022-10-23 21:13:41 +02:00
|
|
|
base = QEMU_ALIGN_PTR_UP(base, 4); \
|
2022-06-26 13:18:04 +02:00
|
|
|
} while (0)
|
2019-10-26 18:45:45 +02:00
|
|
|
#endif
|