1 |
/* |
/* |
2 |
* PUPA -- Preliminary Universal Programming Architecture for GRUB |
* PUPA -- Preliminary Universal Programming Architecture for GRUB |
3 |
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org> |
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org> |
4 |
|
* Copyright (C) 2003 Jeroen Dekkers <jeroen@dekkers.cx> |
5 |
* |
* |
6 |
* PUPA is free software; you can redistribute it and/or modify |
* PUPA is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
33 |
pupa_err_t (*unload) (void)) |
pupa_err_t (*unload) (void)) |
34 |
{ |
{ |
35 |
if (pupa_loader_loaded && pupa_loader_unload_func) |
if (pupa_loader_loaded && pupa_loader_unload_func) |
36 |
if (pupa_loader_unload_func () != PUPA_ERR_NONE) |
pupa_loader_unload_func (); |
|
return; |
|
37 |
|
|
38 |
pupa_loader_boot_func = boot; |
pupa_loader_boot_func = boot; |
39 |
pupa_loader_unload_func = unload; |
pupa_loader_unload_func = unload; |
41 |
pupa_loader_loaded = 1; |
pupa_loader_loaded = 1; |
42 |
} |
} |
43 |
|
|
44 |
|
void |
45 |
|
pupa_loader_unset(void) |
46 |
|
{ |
47 |
|
if (pupa_loader_loaded && pupa_loader_unload_func) |
48 |
|
pupa_loader_unload_func (); |
49 |
|
|
50 |
|
pupa_loader_boot_func = 0; |
51 |
|
pupa_loader_unload_func = 0; |
52 |
|
|
53 |
|
pupa_loader_loaded = 0; |
54 |
|
} |
55 |
|
|
56 |
pupa_err_t |
pupa_err_t |
57 |
pupa_loader_boot (void) |
pupa_loader_boot (void) |
58 |
{ |
{ |