2019-10-26 19:45:45 +03: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 22:13:41 +03:00
|
|
|
#define BOOTINFO0(base, id) \
|
2019-10-26 19:45:45 +03:00
|
|
|
do { \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, id); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, sizeof(struct bi_record)); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 22:13:41 +03:00
|
|
|
#define BOOTINFO1(base, id, value) \
|
2019-10-26 19:45:45 +03:00
|
|
|
do { \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, id); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, sizeof(struct bi_record) + 4); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stl_p(base, value); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 22:13:41 +03:00
|
|
|
#define BOOTINFO2(base, id, value1, value2) \
|
2019-10-26 19:45:45 +03:00
|
|
|
do { \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, id); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, sizeof(struct bi_record) + 8); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stl_p(base, value1); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 4; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stl_p(base, value2); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 4; \
|
|
|
|
} while (0)
|
|
|
|
|
2022-10-23 22:13:41 +03:00
|
|
|
#define BOOTINFOSTR(base, id, string) \
|
2019-10-26 19:45:45 +03:00
|
|
|
do { \
|
|
|
|
int i; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, id); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, \
|
2022-09-26 14:39:00 +03:00
|
|
|
(sizeof(struct bi_record) + strlen(string) + \
|
|
|
|
1 /* null termination */ + 3 /* padding */) & ~3); \
|
2019-10-26 19:45:45 +03:00
|
|
|
base += 2; \
|
|
|
|
for (i = 0; string[i]; i++) { \
|
2022-10-23 22:13:41 +03:00
|
|
|
stb_p(base++, string[i]); \
|
2019-10-26 19:45:45 +03:00
|
|
|
} \
|
2022-10-23 22:13:41 +03:00
|
|
|
stb_p(base++, 0); \
|
|
|
|
base = QEMU_ALIGN_PTR_UP(base, 4); \
|
2019-10-26 19:45:45 +03:00
|
|
|
} while (0)
|
2022-06-26 14:18:04 +03:00
|
|
|
|
2022-10-23 22:13:41 +03:00
|
|
|
#define BOOTINFODATA(base, id, data, len) \
|
2022-06-26 14:18:04 +03:00
|
|
|
do { \
|
|
|
|
int i; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, id); \
|
2022-06-26 14:18:04 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, \
|
2022-09-26 14:39:00 +03:00
|
|
|
(sizeof(struct bi_record) + len + \
|
|
|
|
2 /* length field */ + 3 /* padding */) & ~3); \
|
2022-06-26 14:18:04 +03:00
|
|
|
base += 2; \
|
2022-10-23 22:13:41 +03:00
|
|
|
stw_p(base, len); \
|
2022-06-26 14:18:04 +03:00
|
|
|
base += 2; \
|
|
|
|
for (i = 0; i < len; ++i) { \
|
2022-10-23 22:13:41 +03:00
|
|
|
stb_p(base++, data[i]); \
|
2022-06-26 14:18:04 +03:00
|
|
|
} \
|
2022-10-23 22:13:41 +03:00
|
|
|
base = QEMU_ALIGN_PTR_UP(base, 4); \
|
2022-06-26 14:18:04 +03:00
|
|
|
} while (0)
|
2019-10-26 19:45:45 +03:00
|
|
|
#endif
|