ppc64: Don't set Kp bit on SLB
[openbios.git] / libopenbios / load.c
blob2a2a7f98a2f858c39b892f87b713496ce8bdd84c
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;
47 ucell valid;
49 #ifdef CONFIG_LOADER_ELF
51 /* Grab the boot arguments */
52 push_str("bootargs");
53 push_str("/chosen");
54 fword("(find-dev)");
55 POP();
56 fword("get-package-property");
57 POP();
58 param = pop_fstr_copy();
60 elf_load(&sys_info, dev, param, &elf_boot_notes);
61 feval("state-valid @");
62 valid = POP();
63 if (valid) {
64 return;
66 #endif
68 #ifdef CONFIG_LOADER_AOUT
69 aout_load(&sys_info, dev);
70 feval("state-valid @");
71 valid = POP();
72 if (valid) {
73 return;
75 #endif
77 #ifdef CONFIG_LOADER_FCODE
78 fcode_load(dev);
79 feval("state-valid @");
80 valid = POP();
81 if (valid) {
82 return;
84 #endif
86 #ifdef CONFIG_LOADER_FORTH
87 forth_load(dev);
88 feval("state-valid @");
89 valid = POP();
90 if (valid) {
91 return;
93 #endif