diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2025-06-06 10:05:23 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2025-06-06 10:05:23 +0000 |
commit | 755cc582a2473d06f3a2131d506d0311cc70e9f9 (patch) | |
tree | 3efb1ddb8d57bbb4539ac0d229b384871c57820f /hw/m68k/bootinfo.h | |
parent | Initial commit. (diff) | |
download | qemu-upstream.tar.xz qemu-upstream.zip |
Adding upstream version 1:7.2+dfsg.upstream/1%7.2+dfsgupstream
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'hw/m68k/bootinfo.h')
-rw-r--r-- | hw/m68k/bootinfo.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/hw/m68k/bootinfo.h b/hw/m68k/bootinfo.h new file mode 100644 index 00000000..a3d37e3c --- /dev/null +++ b/hw/m68k/bootinfo.h @@ -0,0 +1,77 @@ +/* + * 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 + +#define BOOTINFO0(base, id) \ + do { \ + stw_p(base, id); \ + base += 2; \ + stw_p(base, sizeof(struct bi_record)); \ + base += 2; \ + } while (0) + +#define BOOTINFO1(base, id, value) \ + do { \ + stw_p(base, id); \ + base += 2; \ + stw_p(base, sizeof(struct bi_record) + 4); \ + base += 2; \ + stl_p(base, value); \ + base += 4; \ + } while (0) + +#define BOOTINFO2(base, id, value1, value2) \ + do { \ + stw_p(base, id); \ + base += 2; \ + stw_p(base, sizeof(struct bi_record) + 8); \ + base += 2; \ + stl_p(base, value1); \ + base += 4; \ + stl_p(base, value2); \ + base += 4; \ + } while (0) + +#define BOOTINFOSTR(base, id, string) \ + do { \ + int i; \ + stw_p(base, id); \ + base += 2; \ + stw_p(base, \ + (sizeof(struct bi_record) + strlen(string) + \ + 1 /* null termination */ + 3 /* padding */) & ~3); \ + base += 2; \ + for (i = 0; string[i]; i++) { \ + stb_p(base++, string[i]); \ + } \ + stb_p(base++, 0); \ + base = QEMU_ALIGN_PTR_UP(base, 4); \ + } while (0) + +#define BOOTINFODATA(base, id, data, len) \ + do { \ + int i; \ + stw_p(base, id); \ + base += 2; \ + stw_p(base, \ + (sizeof(struct bi_record) + len + \ + 2 /* length field */ + 3 /* padding */) & ~3); \ + base += 2; \ + stw_p(base, len); \ + base += 2; \ + for (i = 0; i < len; ++i) { \ + stb_p(base++, data[i]); \ + } \ + base = QEMU_ALIGN_PTR_UP(base, 4); \ + } while (0) +#endif |