grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / bootloader / getbootinfo.c
blobe46701029c781ba367a96b8212ab4c547872c192
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 GetBootInfo() function.
6 */
8 #include <aros/debug.h>
9 #include <aros/bootloader.h>
11 #include "bootloader_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/bootloader.h>
18 AROS_LH1(APTR, GetBootInfo,
20 /* SYNOPSIS */
21 AROS_LHA(ULONG, infoType, D0),
23 /* LOCATION */
24 struct BootLoaderBase *, BootLoaderBase, 1, Bootloader)
26 /* FUNCTION
27 Return information from the bootloader
29 INPUTS
30 infoType - The type of information requested. Valid types are:
31 BL_Video (struct VesaInfo*) - VESA video mode data
32 BL_LoaderName (STRPTR) - Name of bootloader
33 BL_Args (struct List *) - Kernel arguments. Data item is struct Node.
34 ln_Name points to argument text.
35 BL_Drives (struct List *) - Legacy disk drives present in the system.
36 Data item is struct DriveInfoNode.
38 RESULT
39 Pointer to data or NULL if not supplied
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 D(bug("[BootLdr] GetBootInfo(%u)\n", infoType));
56 switch (infoType)
58 case BL_LoaderName:
59 return BootLoaderBase->LdrName;
61 case BL_Args:
62 if (BootLoaderBase->Flags & BL_FLAGS_CMDLINE)
63 return &(BootLoaderBase->Args);
64 break;
66 case BL_Video:
67 return BootLoaderBase->Vesa;
69 case BL_Drives:
70 if (BootLoaderBase->Flags & BL_FLAGS_DRIVES)
71 return (APTR)&(BootLoaderBase->DriveInfo);
72 break;
75 D(bug("[BootLdr] GetBootInfo: Unknown info requested\n"));
76 return NULL;
78 AROS_LIBFUNC_EXIT
79 } /* GetBootInfo */