sparc32: move /uuid property setup to openbios.c
[openbios.git] / libopenbios / load.c
blobee2a46ecc6e52efb1c2ad625162cc79bffa1d678
1 /*
2 * Creation Date: <2010/06/25 20:00:00 mcayland>
3 * Time-stamp: <2010/06/25 20:00:00 mcayland>
5 * <load.c>
7 * C implementation of load
9 * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland@siriusit.co.uk)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * version 2
17 #include "config.h"
18 #include "kernel/kernel.h"
19 #include "libopenbios/bindings.h"
20 #include "libopenbios/sys_info.h"
21 #include "libopenbios/load.h"
23 #ifdef CONFIG_LOADER_ELF
24 #include "libopenbios/elf_load.h"
25 #endif
27 #ifdef CONFIG_LOADER_AOUT
28 #include "libopenbios/aout_load.h"
29 #endif
31 #ifdef CONFIG_LOADER_FCODE
32 #include "libopenbios/fcode_load.h"
33 #endif
35 #ifdef CONFIG_LOADER_FORTH
36 #include "libopenbios/forth_load.h"
37 #endif
40 struct sys_info sys_info;
41 void *elf_boot_notes = NULL;
43 void load(ihandle_t dev)
45 /* Invoke the loaders on the specified device */
46 char *param;
48 #ifdef CONFIG_LOADER_ELF
50 /* Grab the boot arguments */
51 push_str("bootargs");
52 push_str("/chosen");
53 fword("(find-dev)");
54 POP();
55 fword("get-package-property");
56 POP();
57 param = pop_fstr_copy();
59 elf_load(&sys_info, dev, param, &elf_boot_notes);
60 #endif
62 #ifdef CONFIG_LOADER_AOUT
63 aout_load(&sys_info, dev);
64 #endif
66 #ifdef CONFIG_LOADER_FCODE
67 fcode_load(dev);
68 #endif
70 #ifdef CONFIG_LOADER_FORTH
71 forth_load(dev);
72 #endif