5 Copyright (C) 2006-2011 The AROS Development Team. All rights reserved.
9 #include <aros/multiboot.h>
14 #define D(x) /* eps */
17 #ifdef MULTIBOOT_64BIT
20 * Our kickstart is 64-bit but we are being compiled in 32-bit mode.
21 * So we need a correct definition of TagItem
25 unsigned long long ti_Tag
;
26 unsigned long long ti_Data
;
31 #define TagItem64 TagItem
35 /* A pointer used for building boot taglist */
36 extern struct TagItem64
*tag
;
37 extern struct vbe_mode VBEModeInfo
;
38 extern struct vbe_controller VBEControllerInfo
;
40 /* The target base address of 64-bit kernel */
41 #define KERNEL_TARGET_ADDRESS 0x01000000
43 /* Our kickstart will operate with page size = 4KB */
44 #define PAGE_SIZE 4096
46 //#define KERNEL_HIGH_OFFSET 0x1ffULL
47 //#define KERNEL_HIGH_OFFSET 0x1ffULL
48 //#define KERNEL_HIGH_OFFSET 31ULL
49 //#define KERNEL_OFFSET 0x01000000
50 #define KERNEL_OFFSET 0
51 //#define KERNEL_OFFSET 0xfffffffff8000000ULL
52 //#define KERNEL_OFFSET 0x0000000000000000ULL
56 #define TOP_ADDR(a1, a2) ((unsigned long)a2 > a1 ? (unsigned long)a2 : a1)
57 #define STR_TOP_ADDR(a1, s) TOP_ADDR(a1, s + strlen(s) + 1)
60 void kick(void *kick_base
, struct TagItem64
*km
);
62 unsigned long AddModule(unsigned long mod_start
, unsigned long mod_end
, unsigned long end
);
65 int ParseCmdLine(const char *cmdline
);
66 struct mb_mmap
*mmap_make(unsigned long *len
, unsigned long mem_lower
, unsigned long long mem_upper
);
67 void panic(const char *str
);
68 unsigned long mb1_parse(struct multiboot
*mb
, struct mb_mmap
**mmap_addr
, unsigned long *mmap_len
);
69 unsigned long mb2_parse(void *mb
, struct mb_mmap
**mmap_addr
, unsigned long *mmap_len
);
70 void setupVESA(char *str
);
72 #if defined(__i386__) || defined(__x86_64__)
73 #define LONG2BE(v) ({ unsigned int __v32; asm volatile("bswap %0":"=a"(__v32):"0"((v))); __v32; })
75 #define LONG2BE(v) (v)
78 #endif // _BOOTSTRAP_H