@@ -60,4 +60,9 @@ typedef u64 uint64_t;
#define U16_MAX ((u16)(~0U))
#define UINT_MAX (~0U)
+typedef unsigned long long paddr_t;
+
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+ typedef uint64_t struct_name ## _ptr_t;
+
#endif /* __BOOT_DEFS_H__ */
@@ -6,6 +6,7 @@ struct arch_bootmodule {
uint32_t flags;
unsigned headroom;
};
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
struct arch_boot_info {
uint32_t flags;
@@ -19,6 +20,7 @@ struct arch_boot_info {
uint32_t mmap_length;
paddr_t mmap_addr;
};
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
struct __packed mb_memmap {
uint32_t size;
@@ -35,17 +35,18 @@ struct boot_module {
mfn_t mfn;
size_t size;
- struct arch_bootmodule *arch;
+ arch_bootmodule_ptr_t arch;
struct boot_string string;
};
+DEFINE_STRUCT_PTR_TYPE(boot_module);
struct boot_info {
char *cmdline;
unsigned int nr_mods;
- struct boot_module *mods;
+ boot_module_ptr_t mods;
- struct arch_boot_info *arch;
+ arch_boot_info_ptr_t arch;
};
#endif
@@ -71,4 +71,9 @@ typedef bool bool_t;
#define test_and_set_bool(b) xchg(&(b), true)
#define test_and_clear_bool(b) xchg(&(b), false)
+#ifndef DEFINE_STRUCT_PTR_TYPE
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+ typedef struct struct_name * struct_name ## _ptr_t;
+#endif
+
#endif /* __TYPES_H__ */