xref: /haiku/headers/private/kernel/boot/platform.h (revision 81f5654c124bf46fba0fd251f208e2d88d81e1ce)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 #ifndef KERNEL_BOOT_PLATFORM_H
6 #define KERNEL_BOOT_PLATFORM_H
7 
8 
9 #include <SupportDefs.h>
10 #include <boot/vfs.h>
11 
12 
13 struct stage2_args;
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /* debug functions */
20 extern void panic(const char *format, ...);
21 extern void dprintf(const char *format, ...);
22 
23 /* heap functions */
24 extern void platform_release_heap(struct stage2_args *args, void *base);
25 extern status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top);
26 
27 /* MMU/memory functions */
28 extern status_t platform_allocate_region(void **_virtualAddress, size_t size, uint8 protection);
29 extern status_t platform_free_region(void *address, size_t size);
30 
31 /* misc functions */
32 extern bool platform_user_menu_requested(void);
33 extern void platform_start_kernel(void);
34 
35 #ifdef __cplusplus
36 }
37 
38 class Node;
39 namespace boot {
40 	class Partition;
41 }
42 
43 /* device functions */
44 
45 // these functions have to be implemented in C++
46 extern status_t platform_get_boot_device(struct stage2_args *args, Node **_device);
47 extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList);
48 extern status_t platform_get_boot_partition(struct stage2_args *args, Node *bootDevice,
49 					NodeList *partitions, boot::Partition **_partition);
50 
51 #endif
52 
53 #endif	/* KERNEL_BOOT_PLATFORM_H */
54