1 /* 2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT 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, 29 uint8 protection, bool exactAddress); 30 extern status_t platform_free_region(void *address, size_t size); 31 32 /* boot options */ 33 #define BOOT_OPTION_MENU 1 34 #define BOOT_OPTION_DEBUG_OUTPUT 2 35 36 extern uint32 platform_boot_options(void); 37 38 /* misc functions */ 39 extern status_t platform_init_video(void); 40 extern void platform_switch_to_logo(void); 41 extern void platform_switch_to_text_mode(void); 42 extern void platform_start_kernel(void); 43 extern void platform_exit(void); 44 45 #ifdef __cplusplus 46 } 47 48 // these functions have to be implemented in C++ 49 50 /* device functions */ 51 52 class Node; 53 namespace boot { 54 class Partition; 55 } 56 57 extern status_t platform_add_boot_device(struct stage2_args *args, NodeList *devicesList); 58 extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList); 59 extern status_t platform_get_boot_partition(struct stage2_args *args, Node *bootDevice, 60 NodeList *partitions, boot::Partition **_partition); 61 extern status_t platform_register_boot_device(Node *device); 62 63 /* menu functions */ 64 65 class Menu; 66 class MenuItem; 67 68 extern void platform_add_menus(Menu *menu); 69 extern void platform_update_menu_item(Menu *menu, MenuItem *item); 70 extern void platform_run_menu(Menu *menu); 71 72 #endif 73 74 #endif /* KERNEL_BOOT_PLATFORM_H */ 75