2003-06-24 17:22:11 +00:00
|
|
|
/*
|
2005-10-14 11:34:18 +00:00
|
|
|
* Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de.
|
2004-11-15 17:59:15 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-06-24 17:22:11 +00:00
|
|
|
#ifndef KERNEL_BOOT_PLATFORM_H
|
|
|
|
#define KERNEL_BOOT_PLATFORM_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
2003-10-14 00:26:04 +00:00
|
|
|
#include <boot/vfs.h>
|
2003-06-24 17:22:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct stage2_args;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-10-01 01:02:36 +00:00
|
|
|
/* debug functions */
|
2003-06-24 17:22:11 +00:00
|
|
|
extern void panic(const char *format, ...);
|
2003-09-03 17:08:08 +00:00
|
|
|
extern void dprintf(const char *format, ...);
|
|
|
|
|
2003-10-01 01:02:36 +00:00
|
|
|
/* heap functions */
|
2003-10-07 22:10:55 +00:00
|
|
|
extern void platform_release_heap(struct stage2_args *args, void *base);
|
2003-06-24 17:22:11 +00:00
|
|
|
extern status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top);
|
|
|
|
|
2003-10-16 17:55:21 +00:00
|
|
|
/* MMU/memory functions */
|
|
|
|
extern status_t platform_allocate_region(void **_virtualAddress, size_t size, uint8 protection);
|
|
|
|
extern status_t platform_free_region(void *address, size_t size);
|
|
|
|
|
2004-06-18 15:25:32 +00:00
|
|
|
/* boot options */
|
|
|
|
#define BOOT_OPTION_MENU 1
|
|
|
|
#define BOOT_OPTION_DEBUG_OUTPUT 2
|
|
|
|
|
|
|
|
extern uint32 platform_boot_options(void);
|
|
|
|
|
2003-10-01 01:02:36 +00:00
|
|
|
/* misc functions */
|
2004-06-22 00:27:04 +00:00
|
|
|
extern status_t platform_init_video(void);
|
2004-06-16 13:25:37 +00:00
|
|
|
extern void platform_switch_to_logo(void);
|
|
|
|
extern void platform_switch_to_text_mode(void);
|
2004-04-20 23:41:38 +00:00
|
|
|
extern void platform_start_kernel(void);
|
2004-08-25 15:18:33 +00:00
|
|
|
extern void platform_exit(void);
|
2003-10-01 01:02:36 +00:00
|
|
|
|
2003-06-24 17:22:11 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2003-10-01 01:02:36 +00:00
|
|
|
|
2004-06-21 15:51:59 +00:00
|
|
|
// these functions have to be implemented in C++
|
|
|
|
|
|
|
|
/* device functions */
|
|
|
|
|
2003-10-01 01:02:36 +00:00
|
|
|
class Node;
|
|
|
|
namespace boot {
|
|
|
|
class Partition;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern status_t platform_get_boot_device(struct stage2_args *args, Node **_device);
|
2003-10-14 00:26:04 +00:00
|
|
|
extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList);
|
2004-04-21 11:10:32 +00:00
|
|
|
extern status_t platform_get_boot_partition(struct stage2_args *args, Node *bootDevice,
|
|
|
|
NodeList *partitions, boot::Partition **_partition);
|
2004-11-15 17:59:15 +00:00
|
|
|
extern status_t platform_register_boot_device(Node *device);
|
2003-10-01 01:02:36 +00:00
|
|
|
|
2004-06-21 15:51:59 +00:00
|
|
|
/* menu functions */
|
|
|
|
|
|
|
|
class Menu;
|
|
|
|
class MenuItem;
|
|
|
|
|
|
|
|
extern void platform_add_menus(Menu *menu);
|
|
|
|
extern void platform_update_menu_item(Menu *menu, MenuItem *item);
|
|
|
|
extern void platform_run_menu(Menu *menu);
|
|
|
|
|
2003-06-24 17:22:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* KERNEL_BOOT_PLATFORM_H */
|