10SN/A/*
2157SN/A * Copyright 2003-2006, Axel D��rfler, axeld@pinc-software.de.
30SN/A * Distributed under the terms of the MIT License.
40SN/A */
50SN/A#ifndef KERNEL_BOOT_PLATFORM_H
60SN/A#define KERNEL_BOOT_PLATFORM_H
7157SN/A
80SN/A
9157SN/A#include <SupportDefs.h>
100SN/A#include <boot/vfs.h>
110SN/A
120SN/A
130SN/Astruct stage2_args;
140SN/A
150SN/A#ifdef __cplusplus
160SN/Aextern "C" {
170SN/A#endif
180SN/A
190SN/A/* debug functions */
200SN/Aextern void panic(const char *format, ...);
21157SN/Aextern void dprintf(const char *format, ...);
22157SN/A
23157SN/A/* heap functions */
240SN/Aextern void platform_release_heap(struct stage2_args *args, void *base);
250SN/Aextern status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top);
260SN/A
270SN/A/* MMU/memory functions */
280SN/Aextern status_t platform_allocate_region(void **_virtualAddress, size_t size,
290SN/A	uint8 protection, bool exactAddress);
300SN/Aextern status_t platform_free_region(void *address, size_t size);
310SN/A
320SN/A/* boot options */
330SN/A#define BOOT_OPTION_MENU			1
340SN/A#define BOOT_OPTION_DEBUG_OUTPUT	2
350SN/A
360SN/Aextern uint32 platform_boot_options(void);
370SN/A
380SN/A/* misc functions */
390SN/Aextern status_t platform_init_video(void);
400SN/Aextern void platform_switch_to_logo(void);
410SN/Aextern void platform_switch_to_text_mode(void);
420SN/Aextern void platform_start_kernel(void);
430SN/Aextern void platform_exit(void);
440SN/A
450SN/A#ifdef __cplusplus
460SN/A}
470SN/A
480SN/A// these functions have to be implemented in C++
490SN/A
500SN/A/* device functions */
510SN/A
520SN/Aclass Node;
530SN/Anamespace boot {
540SN/A	class Partition;
550SN/A}
560SN/A
570SN/Aextern status_t platform_add_boot_device(struct stage2_args *args, NodeList *devicesList);
580SN/Aextern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList);
590SN/Aextern status_t platform_get_boot_partition(struct stage2_args *args, Node *bootDevice,
600SN/A					NodeList *partitions, boot::Partition **_partition);
610SN/Aextern status_t platform_register_boot_device(Node *device);
620SN/A
630SN/A/* menu functions */
640SN/A
650SN/Aclass Menu;
660SN/Aclass MenuItem;
670SN/A
680SN/Aextern void platform_add_menus(Menu *menu);
690SN/Aextern void platform_update_menu_item(Menu *menu, MenuItem *item);
700SN/Aextern void platform_run_menu(Menu *menu);
710SN/Aextern size_t platform_get_user_input_text(Menu *menu, MenuItem *item,
720SN/A	char *buffer, size_t bufferSize);
730SN/Aextern char* platform_debug_get_log_buffer(size_t* _size);
740SN/A
750SN/A#endif
760SN/A
770SN/A#endif	/* KERNEL_BOOT_PLATFORM_H */
780SN/A